Title: [141226] trunk/Source/WebCore
Revision
141226
Author
[email protected]
Date
2013-01-29 22:30:43 -0800 (Tue, 29 Jan 2013)

Log Message

Scrollbar and scroll corner composited layers positioned incorrectly
https://bugs.webkit.org/show_bug.cgi?id=108255

Patch by James Robinson <[email protected]> on 2013-01-29
Reviewed by Simon Fraser.

ScrollView::updateScrollbars() needs to update the overflow controls composited layers if scrollbars are added
or removed. It was doing this by recording on entry to the function if it had horizontal or vertical scrollbars
and then comparing that to m_horizontal/verticalScrollbar on exit. Unfortunately updateScrollbars is recursive
and exits without running the postamble code when nested on the callstack. As a result, scrollbars may be
added or removed several times during the recursion, possibly leaving the overflow control layers in an
inconsistent state, while ending up with the same set of scrollbars.

This changes the "has anything changed" logic to only compare local state (hasXXXScrollbar vs
newHasXXXScrollbar) so changes in recursive calls are not considered.

* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141225 => 141226)


--- trunk/Source/WebCore/ChangeLog	2013-01-30 06:14:58 UTC (rev 141225)
+++ trunk/Source/WebCore/ChangeLog	2013-01-30 06:30:43 UTC (rev 141226)
@@ -1,3 +1,23 @@
+2013-01-29  James Robinson  <[email protected]>
+
+        Scrollbar and scroll corner composited layers positioned incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=108255
+
+        Reviewed by Simon Fraser.
+
+        ScrollView::updateScrollbars() needs to update the overflow controls composited layers if scrollbars are added
+        or removed. It was doing this by recording on entry to the function if it had horizontal or vertical scrollbars
+        and then comparing that to m_horizontal/verticalScrollbar on exit. Unfortunately updateScrollbars is recursive
+        and exits without running the postamble code when nested on the callstack. As a result, scrollbars may be
+        added or removed several times during the recursion, possibly leaving the overflow control layers in an
+        inconsistent state, while ending up with the same set of scrollbars.
+
+        This changes the "has anything changed" logic to only compare local state (hasXXXScrollbar vs
+        newHasXXXScrollbar) so changes in recursive calls are not considered.
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::updateScrollbars):
+
 2013-01-29  Shinya Kawanaka  <[email protected]>
 
         Convert deprecatedShadowAncestorNode() to shadowHost() in Editor.cpp

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (141225 => 141226)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2013-01-30 06:14:58 UTC (rev 141225)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2013-01-30 06:30:43 UTC (rev 141226)
@@ -603,7 +603,7 @@
             m_verticalScrollbar->setSuppressInvalidation(false);
     }
 
-    if (hasHorizontalScrollbar != (m_horizontalScrollbar != 0) || hasVerticalScrollbar != (m_verticalScrollbar != 0)) {
+    if (hasHorizontalScrollbar != newHasHorizontalScrollbar || hasVerticalScrollbar != newHasVerticalScrollbar) {
         // FIXME: Is frameRectsChanged really necessary here? Have any frame rects changed?
         frameRectsChanged();
         positionScrollbarLayers();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to