Always reposition the scrollbar layers when the frame view size changes
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Dec 2011 22:46:56 +0000 (22:46 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Dec 2011 22:46:56 +0000 (22:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75035

Reviewed by Darin Adler.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
Remove the layersChanged check and unconditionally call positionScrollbarLayers(). This only
worked by accident before because we were recreating horizontal and vertical scrollbars on every call.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index 6d544eb677db634b62bd288761ddc913514e1c35..6d4934b58bbcc456d37b36114c3d2ad683f2c783 100644 (file)
@@ -1,3 +1,15 @@
+2011-12-21  Anders Carlsson  <andersca@apple.com>
+
+        Always reposition the scrollbar layers when the frame view size changes
+        https://bugs.webkit.org/show_bug.cgi?id=75035
+
+        Reviewed by Darin Adler.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
+        Remove the layersChanged check and unconditionally call positionScrollbarLayers(). This only
+        worked by accident before because we were recreating horizontal and vertical scrollbars on every call.
+
 2011-12-21  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
 
         [EFL] Add 'Select All' option to context menus in WebKit-EFL.
index a65bd56b4554aeb7a4e33f4ccfded3608ec6b9cc..ac4464132ea0d62a5872e28aa451d2b163dd6aae 100644 (file)
@@ -1680,8 +1680,6 @@ bool RenderLayerCompositor::requiresOverhangAreasLayer() const
 
 void RenderLayerCompositor::updateOverflowControlsLayers()
 {
-    bool layersChanged = false;
-  
 #if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
     if (requiresOverhangAreasLayer()) {
         if (!m_layerForOverhangAreas) {
@@ -1692,12 +1690,10 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
             m_layerForOverhangAreas->setDrawsContent(false);
             m_layerForOverhangAreas->setSize(m_renderView->frameView()->frameRect().size());
             m_overflowControlsHostLayer->addChild(m_layerForOverhangAreas.get());
-            layersChanged = true;
         }
     } else if (m_layerForOverhangAreas) {
         m_layerForOverhangAreas->removeFromParent();
         m_layerForOverhangAreas = nullptr;
-        layersChanged = true;
     }
 #endif
 
@@ -1708,7 +1704,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
             m_layerForHorizontalScrollbar->setName("horizontal scrollbar");
     #endif
             m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get());
-            layersChanged = true;
 
 #if ENABLE(THREADED_SCROLLING)
             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -1718,7 +1713,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
     } else if (m_layerForHorizontalScrollbar) {
         m_layerForHorizontalScrollbar->removeFromParent();
         m_layerForHorizontalScrollbar = nullptr;
-        layersChanged = true;
 
 #if ENABLE(THREADED_SCROLLING)
         if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -1733,7 +1727,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
             m_layerForVerticalScrollbar->setName("vertical scrollbar");
     #endif
             m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get());
-            layersChanged = true;
 
 #if ENABLE(THREADED_SCROLLING)
             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -1743,7 +1736,6 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
     } else if (m_layerForVerticalScrollbar) {
         m_layerForVerticalScrollbar->removeFromParent();
         m_layerForVerticalScrollbar = nullptr;
-        layersChanged = true;
 
 #if ENABLE(THREADED_SCROLLING)
         if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
@@ -1758,16 +1750,13 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
             m_layerForScrollCorner->setName("scroll corner");
     #endif
             m_overflowControlsHostLayer->addChild(m_layerForScrollCorner.get());
-            layersChanged = true;
         }
     } else if (m_layerForScrollCorner) {
         m_layerForScrollCorner->removeFromParent();
         m_layerForScrollCorner = nullptr;
-        layersChanged = true;
     }
 
-    if (layersChanged)
-        m_renderView->frameView()->positionScrollbarLayers();
+    m_renderView->frameView()->positionScrollbarLayers();
 }
 
 void RenderLayerCompositor::ensureRootLayer()