RenderLayerCompositor should let ScrollingCoordinator update main thread scrolling reasons after change of layers
https://bugs.webkit.org/show_bug.cgi?id=105652

Reviewed by Simon Fraser.

Source/WebCore:

Let ScrollingCoordinator know the change of ViewportConstrainedNotCompositedReason in time.
By the way moved RenderLayerCompositor::FixedPositionLayerNotCompositedReason to RenderLayer::ViewportConstrainedNotCompositedReason.

Tests: compositing/layer-creation/fixed-position-in-view-dynamic.html
       compositing/layer-creation/fixed-position-out-of-view-dynamic.html

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
(WebCore::ScrollingCoordinator::mainThreadScrollingReasons):
(WebCore::ScrollingCoordinator::mainThreadScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(WebCore::ScrollingCoordinatorMac::hasVisibleSlowRepaintViewportConstrainedObjects):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::logThreadedScrollingMode):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::paintLayer):
* rendering/RenderLayer.h:
(RenderLayer): Moved RenderLayerCompositor::FixedPositionLayerNotCompositedReason to here and renamed it to ViewportConstrainedNotCompositedReason.
(WebCore::RenderLayer::setViewportConstrainedNotCompositedReason):
(WebCore::RenderLayer::viewportConstrainedNotCompositedReason):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBacking): Now updates ViewportConstrainedNotCompositedReason here instead of in computeCompositingRequirements before so that the reason is updated in time.
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::needsToBeComposited):
(WebCore::RenderLayerCompositor::requiresCompositingLayer):
(WebCore::RenderLayerCompositor::reasonForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::reportMemoryUsage):
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):

LayoutTests:

Tests to ensure mainThreadScrollingReasons are correctly updated after a fixed element is dynamically inserted into the DOM tree.

* compositing/layer-creation/fixed-position-in-view-dynamic-expected.txt: Added.
* compositing/layer-creation/fixed-position-in-view-dynamic.html: Added.
* compositing/layer-creation/fixed-position-out-of-view-dynamic-expected.txt: Added.
* compositing/layer-creation/fixed-position-out-of-view-dynamic.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139461 268f45cc-cd09-0410-ab3c-d52691b4dbfc