Summary: | [BlackBerry] Decouple layout viewport from visual viewport | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Arvid Nilsson <anilsson> | ||||||
Component: | WebKit BlackBerry | Assignee: | Arvid Nilsson <anilsson> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | anilsson, cgarcia, jkjiang, jpetsovits, mifenton, mlattanzio, rwlbuis, tonikitoo, webkit.review.bot, xan.lopez | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Arvid Nilsson
2013-04-02 15:10:17 PDT
Created attachment 196237 [details]
Patch
Looks good. Comment on attachment 196237 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196237&action=review Looks good to me in general, but patch doesn't seem to apply. > Source/WebKit/blackberry/Api/WebPage.cpp:3915 > + // If the viewport didn't change, try to apply only the new default layout size Comments should finish with a period. > Source/WebKit/blackberry/Api/WebPage.cpp:3945 > + static ViewportArguments defaultViewportArguments; > + if (d->m_viewportArguments != defaultViewportArguments) { > + setVirtualViewportSize(d->recomputeVirtualViewportFromViewportArguments()); > + needsLayout = true; recomputeVirtualViewportFromViewportArguments already checks whether viewport arguments have changed, so you could avoid checking it twice, by checking if the returned rectangle is empty. > Source/WebKit/blackberry/Api/WebPage.h:144 > + // Returns the size of the visual viewport Ditto. > Source/WebKit/blackberry/Api/WebPage.h:147 > + // Sets the sizes of the visual viewport and the layout viewport Ditto. > Source/WebKit/blackberry/Api/WebPage.h:153 > + // Returns the size of the layout viewport Ditto. Comment on attachment 196237 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196237&action=review >> Source/WebKit/blackberry/Api/WebPage.cpp:3945 >> + needsLayout = true; > > recomputeVirtualViewportFromViewportArguments already checks whether viewport arguments have changed, so you could avoid checking it twice, by checking if the returned rectangle is empty. This is a great idea, to avoid duplicating the ugly "static ViewportArguments defaultViewportArguments" line all over the place. Created attachment 196295 [details]
Patch
Comment on attachment 196295 [details]
Patch
Looks great.
Comment on attachment 196295 [details] Patch Clearing flags on attachment: 196295 Committed r147537: <http://trac.webkit.org/changeset/147537> All reviewed patches have been landed. Closing bug. Thanks for the review, I found one more place where we can apply the idea and get rid of static ViewportArguments defaultViewportArguments;. |