Changeset 182346 in webkit
- Timestamp:
- Apr 4, 2015, 3:39:29 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash-expected.txt (added)
-
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (modified) (4 diffs)
-
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (modified) (3 diffs)
-
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (modified) (2 diffs)
-
Source/WebCore/page/scrolling/ScrollingCoordinator.h (modified) (2 diffs)
-
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (modified) (3 diffs)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm (modified) (1 diff)
-
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r182345 r182346 1 2015-04-04 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r182215): Feedly crashes when closing article 4 https://bugs.webkit.org/show_bug.cgi?id=143405 5 rdar://problem/20382734, rdar://problem/20395497 6 7 Reviewed by Tim Horton. 8 9 Test that triggers a crash without the fix (thanks to Zalan for the test). 10 11 * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash-expected.txt: Added. 12 * platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html: Added. 13 1 14 2015-04-04 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r182345 r182346 1 2015-04-04 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r182215): Feedly crashes when closing article 4 https://bugs.webkit.org/show_bug.cgi?id=143405 5 rdar://problem/20382734, rdar://problem/20395497 6 7 Reviewed by Tim Horton. 8 9 Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go 10 is bad, because it can cause FrameView::layout() to get called in the middle of 11 RenderObject destruction, which leaves the render tree in a bad state. 12 13 Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit. 14 15 AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets 16 a flag to say that the non-fast region needs to be recomputed, and that schedules 17 a scrolling tree commit. When the commit happens, we recompute the region. If the 18 region didn't change, and no other changes are pending, there's no need to commit. 19 20 Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html 21 22 * page/scrolling/AsyncScrollingCoordinator.cpp: 23 (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty): 24 (WebCore::AsyncScrollingCoordinator::willCommitTree): 25 (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion): 26 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): 27 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): 28 (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update 29 the non-fast scrollable region. 30 * page/scrolling/AsyncScrollingCoordinator.h: 31 (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty): 32 * page/scrolling/ScrollingCoordinator.cpp: 33 (WebCore::ScrollingCoordinator::ScrollingCoordinator): 34 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): 35 * page/scrolling/ScrollingCoordinator.h: 36 (WebCore::ScrollingCoordinator::willCommitTree): 37 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 38 (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded): 39 (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit): 40 (WebCore::ScrollingCoordinatorMac::commitTreeState): 41 1 42 2015-04-04 Simon Fraser <simon.fraser@apple.com> 2 43 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r182242 r182346 74 74 } 75 75 76 void AsyncScrollingCoordinator::setNonFastScrollableRegionDirty() 77 { 78 m_nonFastScrollableRegionDirty = true; 79 // We have to schedule a commit, but the computed non-fast region may not have actually changed. 80 scheduleTreeStateCommit(); 81 } 82 83 void AsyncScrollingCoordinator::willCommitTree() 84 { 85 updateNonFastScrollableRegion(); 86 } 87 88 void AsyncScrollingCoordinator::updateNonFastScrollableRegion() 89 { 90 if (!m_nonFastScrollableRegionDirty) 91 return; 92 93 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint())); 94 m_nonFastScrollableRegionDirty = false; 95 } 96 76 97 void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView) 77 98 { … … 89 110 // just the root node. But right now, this concept only applies to the root. 90 111 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint())); 112 m_nonFastScrollableRegionDirty = false; 91 113 92 114 if (!coordinatesScrollingForFrameView(frameView)) … … 136 158 return; 137 159 138 // FIXME: computeNonFastScrollableRegion lazily. 139 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint())); 160 setNonFastScrollableRegionDirty(); 140 161 } 141 162 … … 501 522 String AsyncScrollingCoordinator::scrollingStateTreeAsText() const 502 523 { 503 if (m_scrollingStateTree->rootStateNode()) 524 if (m_scrollingStateTree->rootStateNode()) { 525 if (m_nonFastScrollableRegionDirty) 526 m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint())); 504 527 return m_scrollingStateTree->rootStateNode()->scrollingStateTreeAsText(); 528 } 505 529 506 530 return String(); -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r182242 r182346 69 69 70 70 WEBCORE_EXPORT virtual String scrollingStateTreeAsText() const override; 71 WEBCORE_EXPORT virtual void willCommitTree() override; 72 73 bool nonFastScrollableRegionDirty() const { return m_nonFastScrollableRegionDirty; } 71 74 72 75 private: … … 105 108 106 109 void updateScrollPositionAfterAsyncScrollTimerFired(); 110 void setNonFastScrollableRegionDirty(); 111 void updateNonFastScrollableRegion(); 107 112 108 113 FrameView* frameViewForScrollingNode(ScrollingNodeID) const; … … 141 146 std::unique_ptr<ScrollingStateTree> m_scrollingStateTree; 142 147 RefPtr<ScrollingTree> m_scrollingTree; 148 149 bool m_nonFastScrollableRegionDirty { false }; 143 150 }; 144 151 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r182345 r182346 68 68 ScrollingCoordinator::ScrollingCoordinator(Page* page) 69 69 : m_page(page) 70 , m_forceSynchronousScrollLayerPositionUpdates(false)71 70 { 72 71 } … … 126 125 if (!frameView) 127 126 return nonFastScrollableRegion; 127 128 // FIXME: should ASSERT(!frameView->needsLayout()) here, but need to fix DebugPageOverlays 129 // to not ask for regions at bad times. 128 130 129 131 IntPoint offset = frameLocation; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r182242 r182346 215 215 GraphicsLayer* footerLayerForFrameView(FrameView&); 216 216 217 virtual void willCommitTree() { } 218 217 219 Page* m_page; // FIXME: ideally this would be a reference but it gets nulled on async teardown. 218 220 … … 223 225 void updateSynchronousScrollingReasons(FrameView&); 224 226 225 bool m_forceSynchronousScrollLayerPositionUpdates ;227 bool m_forceSynchronousScrollLayerPositionUpdates { false }; 226 228 }; 227 229 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r182242 r182346 80 80 void ScrollingCoordinatorMac::commitTreeStateIfNeeded() 81 81 { 82 if (!scrollingStateTree()->hasChangedProperties())83 return;84 85 82 commitTreeState(); 86 83 m_scrollingStateTreeCommitterTimer.stop(); … … 104 101 void ScrollingCoordinatorMac::scheduleTreeStateCommit() 105 102 { 106 ASSERT(scrollingStateTree()->hasChangedProperties() );103 ASSERT(scrollingStateTree()->hasChangedProperties() || nonFastScrollableRegionDirty()); 107 104 108 105 if (m_scrollingStateTreeCommitterTimer.isActive()) … … 119 116 void ScrollingCoordinatorMac::commitTreeState() 120 117 { 121 ASSERT(scrollingStateTree()->hasChangedProperties()); 118 willCommitTree(); 119 if (!scrollingStateTree()->hasChangedProperties()) 120 return; 122 121 123 122 RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree()); -
trunk/Source/WebKit2/ChangeLog
r182341 r182346 1 2015-04-04 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r182215): Feedly crashes when closing article 4 https://bugs.webkit.org/show_bug.cgi?id=143405 5 rdar://problem/20382734, rdar://problem/20395497 6 7 Reviewed by Tim Horton. 8 9 Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go 10 is bad, because it can cause FrameView::layout() to get called in the middle of 11 RenderObject destruction, which leaves the render tree in a bad state. 12 13 Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit. 14 15 AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets 16 a flag to say that the non-fast region needs to be recomputed, and that schedules 17 a scrolling tree commit. When the commit happens, we recompute the region. If the 18 region didn't change, and no other changes are pending, there's no need to commit. 19 20 * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: 21 (WebKit::RemoteScrollingCoordinator::buildTransaction): 22 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 23 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs. 24 1 25 2015-04-03 Beth Dakin <bdakin@apple.com> 2 26 -
trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
r182132 r182346 87 87 void RemoteScrollingCoordinator::buildTransaction(RemoteScrollingCoordinatorTransaction& transaction) 88 88 { 89 willCommitTree(); 89 90 transaction.setStateTreeToEncode(scrollingStateTree()->commit(LayerRepresentation::PlatformLayerIDRepresentation)); 90 91 } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r179409 r182346 319 319 320 320 bool returnValue = m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes(); 321 #if ENABLE(ASYNC_SCROLLING)321 #if ENABLE(ASYNC_SCROLLING) 322 322 if (ScrollingCoordinator* scrollingCoordinator = m_webPage.corePage()->scrollingCoordinator()) 323 323 scrollingCoordinator->commitTreeStateIfNeeded(); 324 #endif324 #endif 325 325 326 326 // If we have an active transient zoom, we want the zoom to win over any changes
Note:
See TracChangeset
for help on using the changeset viewer.