Title: [124811] trunk/Source/WebCore
Revision
124811
Author
bda...@apple.com
Date
2012-08-06 16:23:04 -0700 (Mon, 06 Aug 2012)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=93199
REGRESSION (r124489): Crash in FrameView::scrollContentsFastPath when 
scrolling Facebook and Google image search
-and corresponding-
<rdar://problem/12035066>

Reviewed by Anders Carlsson.

As the comment in setShouldUpdateScrollLayerPositionOnMainThread() 
indicates, the goal of adding a call to 
updateMainFrameScrollPositionAndScrollLayerPosition() within that 
function was just to make sure the layer position was up-to-date 
since that is what is not kept up to date when scrolling is happening 
on the scrolling thread. So I'm fixing this crash by having that code 
ONLY update the layer position instead of also updating the scroll 
position, since it was updating the scroll position that led to this 
crash.

New function updateMainFrameScrollLayerPosition() will update JUST 
the layer position.
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):        
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::updateMainFrameScrollLayerPosition):

Update just the layer position here instead of the layer position and 
the scroll position.
(WebCore)::

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124810 => 124811)


--- trunk/Source/WebCore/ChangeLog	2012-08-06 23:22:04 UTC (rev 124810)
+++ trunk/Source/WebCore/ChangeLog	2012-08-06 23:23:04 UTC (rev 124811)
@@ -1,3 +1,35 @@
+2012-08-06  Beth Dakin  <bda...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=93199
+        REGRESSION (r124489): Crash in FrameView::scrollContentsFastPath when 
+        scrolling Facebook and Google image search
+        -and corresponding-
+        <rdar://problem/12035066>
+
+        Reviewed by Anders Carlsson.
+
+        As the comment in setShouldUpdateScrollLayerPositionOnMainThread() 
+        indicates, the goal of adding a call to 
+        updateMainFrameScrollPositionAndScrollLayerPosition() within that 
+        function was just to make sure the layer position was up-to-date 
+        since that is what is not kept up to date when scrolling is happening 
+        on the scrolling thread. So I'm fixing this crash by having that code 
+        ONLY update the layer position instead of also updating the scroll 
+        position, since it was updating the scroll position that led to this 
+        crash.
+
+        New function updateMainFrameScrollLayerPosition() will update JUST 
+        the layer position.
+        * page/scrolling/ScrollingCoordinator.h:
+        (ScrollingCoordinator):        
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::updateMainFrameScrollLayerPosition):
+
+        Update just the layer position here instead of the layer position and 
+        the scroll position.
+        (WebCore)::
+(WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread):
+
 2012-08-06  Anna Cavender  <ann...@chromium.org>
 
         MediaSource should use it's own list of source URLs

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (124810 => 124811)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-08-06 23:22:04 UTC (rev 124810)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-08-06 23:23:04 UTC (rev 124811)
@@ -288,6 +288,23 @@
     frameView->setConstrainsScrollingToContentEdge(true);
 }
 
+void ScrollingCoordinator::updateMainFrameScrollLayerPosition()
+{
+#if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
+    ASSERT(isMainThread());
+
+    if (!m_page)
+        return;
+
+    FrameView* frameView = m_page->mainFrame()->view();
+    if (!frameView)
+        return;
+
+    if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
+        scrollLayer->setPosition(-frameView->scrollPosition());
+#endif
+}
+
 void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition()
 {
 #if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
@@ -419,7 +436,7 @@
     // at this point. So we'll update it before we switch back to main thread scrolling
     // in order to avoid layer positioning bugs.
     if (shouldUpdateScrollLayerPositionOnMainThread)
-        updateMainFrameScrollPositionAndScrollLayerPosition();
+        updateMainFrameScrollLayerPosition();
     m_scrollingTreeState->setShouldUpdateScrollLayerPositionOnMainThread(shouldUpdateScrollLayerPositionOnMainThread);
     scheduleTreeStateCommit();
 }

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (124810 => 124811)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-08-06 23:22:04 UTC (rev 124810)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-08-06 23:23:04 UTC (rev 124811)
@@ -153,6 +153,8 @@
     void setWheelEventHandlerCount(unsigned);
     void setShouldUpdateScrollLayerPositionOnMainThread(bool);
 
+    void updateMainFrameScrollLayerPosition();
+
     Page* m_page;
 
     bool m_forceMainThreadScrollLayerPositionUpdates;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to