Scrollbars disappear when switching from legacy to overlay scrollbars
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2012 02:01:47 +0000 (02:01 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2012 02:01:47 +0000 (02:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77166

Reviewed by Dan Bernstein.

* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollbarStyleChanged):
Call positionScrollbarLayers to make sure that the new scrollbar layers are positioned correctly.

* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
Call ScrollbarThemeMac::setNewPainterForScrollbar after making the call to the scrollbar painter controller
to set the horizontal or vertical imp, since setting the imp will reset the knob style.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/mac/ScrollAnimatorMac.mm

index d004848..a493183 100644 (file)
@@ -1,3 +1,19 @@
+2012-01-26  Anders Carlsson  <andersca@apple.com>
+
+        Scrollbars disappear when switching from legacy to overlay scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=77166
+
+        Reviewed by Dan Bernstein.
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollbarStyleChanged):
+        Call positionScrollbarLayers to make sure that the new scrollbar layers are positioned correctly.
+
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::updateScrollerStyle):
+        Call ScrollbarThemeMac::setNewPainterForScrollbar after making the call to the scrollbar painter controller
+        to set the horizontal or vertical imp, since setting the imp will reset the knob style.
+
 2012-01-26  Adam Barth  <abarth@webkit.org>
 
         NULL ptr in WebCore::ContainerNode::parserAddChild
index 52ccc5d..d90c842 100644 (file)
@@ -991,6 +991,7 @@ void ScrollView::scrollbarStyleChanged(int, bool forceUpdate)
 
     contentsResized();
     updateScrollbars(scrollOffset());
+    positionScrollbarLayers();
 }
 
 void ScrollView::updateScrollCorner()
index ce97800..7bed38f 100644 (file)
@@ -1090,8 +1090,8 @@ void ScrollAnimatorMac::updateScrollerStyle()
                                                                                     controlSize:(NSControlSize)verticalScrollbar->controlSize() 
                                                                                     horizontal:NO 
                                                                                     replacingScrollerImp:oldVerticalPainter];
-        macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
         [m_scrollbarPainterController.get() setVerticalScrollerImp:newVerticalPainter];
+        macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
 
         // The different scrollbar styles have different thicknesses, so we must re-set the 
         // frameRect to the new thickness, and the re-layout below will ensure the position
@@ -1108,8 +1108,8 @@ void ScrollAnimatorMac::updateScrollerStyle()
                                                                                     controlSize:(NSControlSize)horizontalScrollbar->controlSize() 
                                                                                     horizontal:YES 
                                                                                     replacingScrollerImp:oldHorizontalPainter];
-        macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
         [m_scrollbarPainterController.get() setHorizontalScrollerImp:newHorizontalPainter];
+        macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
 
         // The different scrollbar styles have different thicknesses, so we must re-set the 
         // frameRect to the new thickness, and the re-layout below will ensure the position