Bug 72983

Summary: [chromium] Preserve original pageScale limits in WebViewImpl
Product: WebKit Reporter: Alexandre Elias <aelias>
Component: New BugsAssignee: Alexandre Elias <aelias>
Status: RESOLVED FIXED    
Severity: Normal CC: aelias, dglazkov, fishd, fsamuel, jamesr, nduca, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 70559, 73495    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Alexandre Elias
Reported 2011-11-22 12:47:24 PST
[chromium] Preserve original pageScale limits in WebViewImpl
Attachments
Patch (6.03 KB, patch)
2011-11-22 12:49 PST, Alexandre Elias
no flags
Patch (8.02 KB, patch)
2011-11-22 23:56 PST, Alexandre Elias
no flags
Patch (8.45 KB, patch)
2011-11-25 02:25 PST, Alexandre Elias
no flags
Patch (8.61 KB, patch)
2011-12-01 00:17 PST, Alexandre Elias
no flags
Patch (8.88 KB, patch)
2011-12-01 13:09 PST, Alexandre Elias
no flags
Patch (8.90 KB, patch)
2011-12-07 11:24 PST, Alexandre Elias
no flags
Patch (9.12 KB, patch)
2011-12-07 11:49 PST, Alexandre Elias
no flags
Alexandre Elias
Comment 1 2011-11-22 12:49:15 PST
Fady Samuel
Comment 2 2011-11-22 12:57:16 PST
This looks fine to me. Thanks.
Alexandre Elias
Comment 3 2011-11-22 23:56:07 PST
Alexandre Elias
Comment 4 2011-11-22 23:58:22 PST
I ended up adding a call site to the computePageScaleLimits function -- it's generally needed to call it on contents size change. I also put in a couple more clamping fixes that turned up during debugging. Please take another look.
WebKit Review Bot
Comment 5 2011-11-23 04:17:44 PST
Comment on attachment 116324 [details] Patch Attachment 116324 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/10615267 New failing tests: compositing/geometry/fixed-in-composited.html compositing/geometry/limit-layer-bounds-clipping-ancestor.html compositing/geometry/fixed-position-iframe-composited-page-scale-down.html compositing/geometry/limit-layer-bounds-fixed-positioned.html compositing/iframes/become-composited-nested-iframes.html compositing/geometry/vertical-scroll-composited.html compositing/geometry/limit-layer-bounds-transformed-overflow.html compositing/layers-inside-overflow-scroll.html compositing/geometry/fixed-position-composited-page-scale-down.html accessibility/dimensions-include-descendants.html compositing/direct-image-compositing.html compositing/flat-with-transformed-child.html compositing/geometry/tall-page-composited.html compositing/generated-content.html animations/state-at-end-event.html compositing/geometry/transfrom-origin-on-zero-size-layer.html animations/suspend-transform-animation.html animations/opacity-transform-animation.html animations/missing-values-last-keyframe.html animations/missing-values-first-keyframe.html
Alexandre Elias
Comment 6 2011-11-25 02:25:15 PST
Alexandre Elias
Comment 7 2011-12-01 00:17:37 PST
Fady Samuel
Comment 8 2011-12-01 08:14:01 PST
(In reply to comment #7) > Created an attachment (id=117361) [details] > Patch Why do we need to force a layout when contents size changes?
Fady Samuel
Comment 9 2011-12-01 08:16:18 PST
Making this block viewport upstreaming so I remember to keep an eye on this patch.
Alexandre Elias
Comment 10 2011-12-01 10:57:21 PST
> Why do we need to force a layout when contents size changes? The contents size change in the middle of FrameView::layout(). If we don't relayout after changing the page scale there, then we violate an assertion that no needs-layout flag can be set coming out of that layout function. See http://b/issue?id=5662731
Fady Samuel
Comment 11 2011-12-01 11:01:28 PST
(In reply to comment #10) > > Why do we need to force a layout when contents size changes? > > The contents size change in the middle of FrameView::layout(). If we don't relayout after changing the page scale there, then we violate an assertion that no needs-layout flag can be set coming out of that layout function. See http://b/issue?id=5662731 Ohh good catch! I was thinking that might've been the case as I wrote the question. I handle this from render_view_impl.cc which is probably not the right place to put it. I prefer your solution, frankly, thanks :-)
Alexandre Elias
Comment 12 2011-12-01 13:09:40 PST
Darin Fisher (:fishd, Google)
Comment 13 2011-12-07 10:27:00 PST
Comment on attachment 117470 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=117470&action=review > Source/WebKit/chromium/src/ChromeClientImpl.cpp:558 > + m_webView->didChangeContentsSize(); hmm, are you sure you wouldn't be better off completing your work before delegating out to the embedder? calling webframe->client()->didChangeContentsSize gives control to the embedder. they could drastically change the system in that time, potentially destroying the WebView. usually, it is better to do your work first, and then notify the embedder. > Source/WebKit/chromium/src/WebViewImpl.cpp:2567 > + FrameView* view = mainFrameImpl()->frameView(); what kind of performance impact will this have? it seems like this could cause us to force layout more frequently than we would otherwise do. could this slow down page load? during page load, isn't the content size rapidly changing?
Alexandre Elias
Comment 14 2011-12-07 11:24:37 PST
Alexandre Elias
Comment 15 2011-12-07 11:25:57 PST
Comment on attachment 117470 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=117470&action=review >> Source/WebKit/chromium/src/ChromeClientImpl.cpp:558 >> + m_webView->didChangeContentsSize(); > > hmm, are you sure you wouldn't be better off completing your work before delegating > out to the embedder? calling webframe->client()->didChangeContentsSize gives control > to the embedder. they could drastically change the system in that time, potentially > destroying the WebView. usually, it is better to do your work first, and then notify > the embedder. OK, moved this call above the embedder call. >> Source/WebKit/chromium/src/WebViewImpl.cpp:2567 >> + FrameView* view = mainFrameImpl()->frameView(); > > what kind of performance impact will this have? it seems like this could cause > us to force layout more frequently than we would otherwise do. could this slow > down page load? during page load, isn't the content size rapidly changing? Touch devices do need a few extra layouts to switch to the correct page scale on page load when the content size is determined. I tried to minimize the force layouts to the minimum that are really needed. computePageScaleFactorLimits will only set needsLayout if the content width changes, which in my logs happens only a few times during load. needsLayout cannot be set for any other reason as didChangeContentsSize is called immediately after the main layout in FrameView::layout(). Also, computePageScaleFactorLimits() is a no-op on platforms which have never called setPageScaleFactorLimits().
Alexandre Elias
Comment 16 2011-12-07 11:48:14 PST
On second thought, after discussing with fsamuel, I'm adding an extra early return to make sure we don't force-layout if needsLayout was set for some other unexpected reason.
Alexandre Elias
Comment 17 2011-12-07 11:49:12 PST
WebKit Review Bot
Comment 18 2011-12-07 17:53:57 PST
Comment on attachment 118246 [details] Patch Clearing flags on attachment: 118246 Committed r102292: <http://trac.webkit.org/changeset/102292>
WebKit Review Bot
Comment 19 2011-12-07 17:54:03 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.