REGRESSION (r116203): overflow sections don't have scrollbars
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jul 2012 17:50:47 +0000 (17:50 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jul 2012 17:50:47 +0000 (17:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90052

Reviewed by Simon Fraser.

This issue stems from RenderLayers with overlay scrollbars not being considered
self-painting.

After r120395 (follow-up of r116203), we ignore subtrees that have no self-painting layer for
painting. Normal scrollbars are painted by their renderer so they were properly painted. However
overlay scrollbars need to be painted by their RenderLayer as a separate phase (see bug 57057) so
they were not painted anymore. The fix is simple: make RenderLayer with overlay scrollbars
self-painting as they should have been in the first place.

Unfortunately no tests as I don't think we have a good way of testing overlay
scrollbars. Tested manually though on the super simple test case from the bug.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeSelfPaintingLayer):
Overlay scrollbars make the layer self-painting.

(WebCore::RenderLayer::updateScrollbarsAfterLayout):
Added a call to updateSelfPaintingLayer.

(WebCore::RenderLayer::styleChanged):
Moved the call to updateSelfPaintingLayer after recomputing the scrollbars to ensure proper behavior.
Added a comment underlining the reason.

(WebCore::RenderLayer::updateSelfPaintingLayer):
Renamed as it is now called during layout too.

* rendering/RenderLayer.h:
(RenderLayer): Updated after updateSelfPaintingLayer rename.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h

index 41ee7aa..9a635a2 100644 (file)
@@ -1,3 +1,39 @@
+2012-07-11  Julien Chaffraix  <jchaffraix@webkit.org>
+
+        REGRESSION (r116203): overflow sections don't have scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=90052
+
+        Reviewed by Simon Fraser.
+
+        This issue stems from RenderLayers with overlay scrollbars not being considered
+        self-painting.
+
+        After r120395 (follow-up of r116203), we ignore subtrees that have no self-painting layer for
+        painting. Normal scrollbars are painted by their renderer so they were properly painted. However
+        overlay scrollbars need to be painted by their RenderLayer as a separate phase (see bug 57057) so
+        they were not painted anymore. The fix is simple: make RenderLayer with overlay scrollbars
+        self-painting as they should have been in the first place.
+
+        Unfortunately no tests as I don't think we have a good way of testing overlay
+        scrollbars. Tested manually though on the super simple test case from the bug.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::shouldBeSelfPaintingLayer):
+        Overlay scrollbars make the layer self-painting.
+
+        (WebCore::RenderLayer::updateScrollbarsAfterLayout):
+        Added a call to updateSelfPaintingLayer.
+
+        (WebCore::RenderLayer::styleChanged):
+        Moved the call to updateSelfPaintingLayer after recomputing the scrollbars to ensure proper behavior.
+        Added a comment underlining the reason.
+
+        (WebCore::RenderLayer::updateSelfPaintingLayer):
+        Renamed as it is now called during layout too.
+
+        * rendering/RenderLayer.h:
+        (RenderLayer): Updated after updateSelfPaintingLayer rename.
+
 2012-07-11  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
 
         NodesFromRect doesn't work on SVG root elements.
index 12794cb..31be2e8 100644 (file)
@@ -2534,6 +2534,8 @@ void RenderLayer::updateScrollbarsAfterLayout()
         if (box->hasAutoVerticalScrollbar())
             setHasVerticalScrollbar(hasVerticalOverflow);
 
+        updateSelfPaintingLayer();
+
 #if ENABLE(DASHBOARD_SUPPORT)
         // Force an update since we know the scrollbars have changed things.
         if (renderer()->document()->hasDashboardRegions())
@@ -4740,6 +4742,7 @@ bool RenderLayer::shouldBeNormalFlowOnly() const
 bool RenderLayer::shouldBeSelfPaintingLayer() const
 {
     return !isNormalFlowOnly()
+        || hasOverlayScrollbars()
         || renderer()->hasReflection()
         || renderer()->hasMask()
         || renderer()->isTableRow()
@@ -4750,7 +4753,7 @@ bool RenderLayer::shouldBeSelfPaintingLayer() const
         || renderer()->isRenderIFrame();
 }
 
-void RenderLayer::updateSelfPaintingLayerAfterStyleChange(const RenderStyle*)
+void RenderLayer::updateSelfPaintingLayer()
 {
     bool isSelfPaintingLayer = shouldBeSelfPaintingLayer();
     if (m_isSelfPaintingLayer == isSelfPaintingLayer)
@@ -4845,9 +4848,11 @@ void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
         m_marquee = 0;
     }
 
-    updateSelfPaintingLayerAfterStyleChange(oldStyle);
     updateStackingContextsAfterStyleChange(oldStyle);
     updateScrollbarsAfterStyleChange(oldStyle);
+    // Overlay scrollbars can make this layer self-painting so we need
+    // to recompute the bit once scrollbars have been updated.
+    updateSelfPaintingLayer();
 
     if (!hasReflection() && m_reflection)
         removeReflection();
index 1c32a4f..b9dc5d7 100644 (file)
@@ -679,7 +679,7 @@ private:
 
     bool shouldRepaintAfterLayout() const;
 
-    void updateSelfPaintingLayerAfterStyleChange(const RenderStyle* oldStyle);
+    void updateSelfPaintingLayer();
     void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle);
 
     void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle);