Title: [112434] trunk/Source/WebCore
Revision
112434
Author
[email protected]
Date
2012-03-28 13:36:39 -0700 (Wed, 28 Mar 2012)

Log Message

"Sticky" or slow scrolling on some sites
https://bugs.webkit.org/show_bug.cgi?id=82512
<rdar://problem/11000372>

Reviewed by Andreas Kling.

When we're in the slow mode and have to update the scroll layer position on the main thread,
get it from the scrolling thread so we'll be in sync with the scrolling tree when the main thread is busy.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameScrollPosition):
(WebCore):
(WebCore::ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition):
* page/scrolling/ScrollingTree.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112433 => 112434)


--- trunk/Source/WebCore/ChangeLog	2012-03-28 20:29:38 UTC (rev 112433)
+++ trunk/Source/WebCore/ChangeLog	2012-03-28 20:36:39 UTC (rev 112434)
@@ -1,3 +1,24 @@
+2012-03-28  Anders Carlsson  <[email protected]>
+
+        "Sticky" or slow scrolling on some sites
+        https://bugs.webkit.org/show_bug.cgi?id=82512
+        <rdar://problem/11000372>
+
+        Reviewed by Andreas Kling.
+
+        When we're in the slow mode and have to update the scroll layer position on the main thread,
+        get it from the scrolling thread so we'll be in sync with the scrolling tree when the main thread is busy.
+
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
+        * page/scrolling/ScrollingCoordinator.h:
+        (ScrollingCoordinator):
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::mainFrameScrollPosition):
+        (WebCore):
+        (WebCore::ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition):
+        * page/scrolling/ScrollingTree.h:
+
 2012-03-28  Adrienne Walker  <[email protected]>
 
         [chromium] Fix tiled layer assert for huge layers

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (112433 => 112434)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-03-28 20:29:38 UTC (rev 112433)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-03-28 20:36:39 UTC (rev 112434)
@@ -278,9 +278,9 @@
     frameView->setConstrainsScrollingToContentEdge(true);
 }
 
-void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition)
+void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition()
 {
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
     ASSERT(isMainThread());
 
     if (!m_page)
@@ -290,6 +290,8 @@
     if (!frameView)
         return;
 
+    IntPoint scrollPosition = m_scrollingTree->mainFrameScrollPosition();
+
     // Make sure to update the main frame scroll position before changing the scroll layer position,
     // otherwise we'll introduce jittering on pages with slow repaint objects (like background-attachment: fixed).
     frameView->updateCompositingLayers();

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (112433 => 112434)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-03-28 20:29:38 UTC (rev 112433)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-03-28 20:36:39 UTC (rev 112434)
@@ -108,7 +108,7 @@
     void updateMainFrameScrollPosition(const IntPoint&);
 
     // Dispatched by the scrolling tree whenever the main frame scroll position changes and the scroll layer position needs to be updated as well.
-    void updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint&);
+    void updateMainFrameScrollPositionAndScrollLayerPosition();
 
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
     // Dispatched by the scrolling tree during handleWheelEvent. This is required as long as scrollbars are painted on the main thread.

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (112433 => 112434)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2012-03-28 20:29:38 UTC (rev 112433)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2012-03-28 20:36:39 UTC (rev 112434)
@@ -161,6 +161,12 @@
     callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition));
 }
 
+IntPoint ScrollingTree::mainFrameScrollPosition()
+{
+    MutexLocker lock(m_mutex);
+    return m_mainFrameScrollPosition;
+}
+
 void ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition)
 {
     if (!m_scrollingCoordinator)
@@ -171,7 +177,7 @@
         m_mainFrameScrollPosition = scrollPosition;
     }
 
-    callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition, m_scrollingCoordinator.get(), scrollPosition));
+    callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition, m_scrollingCoordinator.get()));
 }
 
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (112433 => 112434)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2012-03-28 20:29:38 UTC (rev 112433)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2012-03-28 20:36:39 UTC (rev 112434)
@@ -79,6 +79,7 @@
 
     void updateMainFrameScrollPosition(const IntPoint& scrollPosition);
     void updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition);
+    IntPoint mainFrameScrollPosition();
 
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
     void handleWheelEventPhase(PlatformWheelEventPhase);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to