Bug 105652

Summary: RenderLayerCompositor should let ScrollingCoordinator update main thread scrolling reasons after change of layers
Product: WebKit Reporter: Xianzhu Wang <wangxianzhu>
Component: Layout and RenderingAssignee: Xianzhu Wang <wangxianzhu>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, eric, jamesr, ojan.autocc, simon.fraser, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Fix mac break
none
for landing none

Description Xianzhu Wang 2012-12-21 12:41:17 PST
On Chromium ScrollingCoordinator will force main thread scrolling if there are any viewport-constrained objects not composited. However, sometimes (e.g. when the page is loading) the main thread scrolling reasons are not updated immediately after RLC promotes some fixed position elements to composited layers. This causes slow scrolling before the main thread scrolling reasons are correctly updated.

crbug.com/167312 describes the slow scrolling case.
Comment 1 Xianzhu Wang 2012-12-21 17:32:20 PST
Created attachment 180578 [details]
Patch
Comment 2 Simon Fraser (smfr) 2013-01-02 21:37:39 PST
Comment on attachment 180578 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=180578&action=review

> Source/WebCore/rendering/RenderLayerCompositor.cpp:473
> +        if (scrollingCoordinator && m_fixedPositionLayerNotCompositedReasonMap != originalFixedPositionLayerNotCompositedReasonMap)

I don't really like m_fixedPositionLayerNotCompositedReasonMap, and the fact that you're comparing two HashMaps here.
Comment 3 Xianzhu Wang 2013-01-07 15:23:24 PST
(In reply to comment #2)
> (From update of attachment 180578 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=180578&action=review
> 
> > Source/WebCore/rendering/RenderLayerCompositor.cpp:473
> > +        if (scrollingCoordinator && m_fixedPositionLayerNotCompositedReasonMap != originalFixedPositionLayerNotCompositedReasonMap)
> 
> I don't really like m_fixedPositionLayerNotCompositedReasonMap, and the fact that you're comparing two HashMaps here.

(I thought I posted the following on last Friday, but just found I made it lost somehow)

How about moving the reason information map into individual RenderLayers or RenderLayerModelObjects as a new field?
Comment 4 Xianzhu Wang 2013-01-08 14:35:46 PST
Created attachment 181770 [details]
Patch
Comment 5 Build Bot 2013-01-08 15:17:26 PST
Comment on attachment 181770 [details]
Patch

Attachment 181770 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15758280
Comment 6 Xianzhu Wang 2013-01-08 15:37:37 PST
Created attachment 181789 [details]
Fix mac break
Comment 7 Xianzhu Wang 2013-01-10 09:32:05 PST
Simon, do you like the latest patch?
Comment 8 Xianzhu Wang 2013-01-11 09:55:16 PST
Kindly ping reviewers...
Comment 9 Simon Fraser (smfr) 2013-01-11 10:18:56 PST
Comment on attachment 181789 [details]
Fix mac break

View in context: https://bugs.webkit.org/attachment.cgi?id=181789&action=review

Nice cleanup, thanks!

> Source/WebCore/rendering/RenderLayerCompositor.cpp:636
> +        if (layerChanged)
> +            if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
> +                scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView->frameView());

We put {} around multi-line conditional blocks like this.
Comment 10 Xianzhu Wang 2013-01-11 10:35:54 PST
Created attachment 182365 [details]
for landing
Comment 11 Xianzhu Wang 2013-01-11 10:36:34 PST
Comment on attachment 181789 [details]
Fix mac break

View in context: https://bugs.webkit.org/attachment.cgi?id=181789&action=review

>> Source/WebCore/rendering/RenderLayerCompositor.cpp:636
>> +                scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView->frameView());
> 
> We put {} around multi-line conditional blocks like this.

Done.
Comment 12 WebKit Review Bot 2013-01-11 10:59:06 PST
Comment on attachment 182365 [details]
for landing

Clearing flags on attachment: 182365

Committed r139461: <http://trac.webkit.org/changeset/139461>
Comment 13 WebKit Review Bot 2013-01-11 10:59:11 PST
All reviewed patches have been landed.  Closing bug.