Changeset 180063 in webkit
- Timestamp:
- Feb 13, 2015, 11:04:12 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r180062 r180063 1 2015-02-13 Simon Fraser <simon.fraser@apple.com> 2 3 Crashes under RenderLayer::hitTestLayer under determinePrimarySnapshottedPlugIn() 4 https://bugs.webkit.org/show_bug.cgi?id=141551 5 6 Reviewed by Zalan Bujtas. 7 8 It's possible for a layout to dirty the parent frame's state, via the calls to 9 ownerElement()->scheduleSetNeedsStyleRecalc() that RenderLayerCompositor does when 10 iframes toggle their compositing mode. 11 12 That could cause FrameView::updateLayoutAndStyleIfNeededRecursive() to fail to 13 leave all the frames in a clean state. Later on, we could enter hit testing, 14 which calls document().updateLayout() on each frame's document. Document::updateLayout() 15 does layout on all ancestor documents, so in the middle of hit testing, we could 16 layout a subframe (dirtying an ancestor frame), then layout another frame, which 17 would forcing that ancestor to be laid out while we're hit testing it, thus 18 corrupting the RenderLayer tree while it's being iterated over. 19 20 Fix by having FrameView::updateLayoutAndStyleIfNeededRecursive() do a second 21 layout after laying out subframes, which most of the time will be a no-op. 22 23 Also add a stronger assertion, that this frame and all subframes are clean 24 at the end of FrameView::updateLayoutAndStyleIfNeededRecursive() for the 25 main frame. 26 27 Various existing frames tests hit the new assertion if the code change is removed, 28 so this is covered by existing tests. 29 30 * page/FrameView.cpp: 31 (WebCore::FrameView::needsStyleRecalcOrLayout): 32 (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): 33 * page/FrameView.h: 34 * rendering/RenderWidget.cpp: 35 (WebCore::RenderWidget::willBeDestroyed): 36 1 37 2015-02-12 Simon Fraser <simon.fraser@apple.com> 2 38 -
TabularUnified trunk/Source/WebCore/page/FrameView.cpp ¶
r180062 r180063 2562 2562 } 2563 2563 2564 bool FrameView::needsStyleRecalcOrLayout(bool includeSubframes) const 2565 { 2566 if (frame().document() && frame().document()->childNeedsStyleRecalc()) 2567 return true; 2568 2569 if (needsLayout()) 2570 return true; 2571 2572 if (!includeSubframes) 2573 return false; 2574 2575 // Find child frames via the Widget tree, as updateLayoutAndStyleIfNeededRecursive() does. 2576 Vector<Ref<FrameView>, 16> childViews; 2577 childViews.reserveInitialCapacity(children().size()); 2578 for (auto& widget : children()) { 2579 if (is<FrameView>(*widget)) 2580 childViews.uncheckedAppend(downcast<FrameView>(*widget)); 2581 } 2582 2583 for (unsigned i = 0; i < childViews.size(); ++i) { 2584 if (childViews[i]->needsStyleRecalcOrLayout()) 2585 return true; 2586 } 2587 2588 return false; 2589 } 2590 2564 2591 bool FrameView::needsLayout() const 2565 2592 { … … 3981 4008 childViews[i]->updateLayoutAndStyleIfNeededRecursive(); 3982 4009 3983 // When frame flattening is on, child frame can mark parent frame dirty. In such case, child frame 3984 // needs to call layout on parent frame recursively. 3985 // This assert ensures that parent frames are clean, when child frames finished updating layout and style. 3986 ASSERT(!needsLayout()); 4010 // A child frame may have dirtied us during its layout. 4011 frame().document()->updateStyleIfNeeded(); 4012 if (needsLayout()) 4013 layout(); 4014 4015 ASSERT(!frame().isMainFrame() || !needsStyleRecalcOrLayout()); 3987 4016 } 3988 4017 -
TabularUnified trunk/Source/WebCore/page/FrameView.h ¶
r179886 r180063 123 123 void setViewportConstrainedObjectsNeedLayout(); 124 124 125 bool needsStyleRecalcOrLayout(bool includeSubframes = true) const; 126 125 127 bool needsFullRepaint() const { return m_needsFullRepaint; } 126 128 -
TabularUnified trunk/Source/WebCore/rendering/RenderWidget.cpp ¶
r177412 r180063 100 100 } 101 101 102 setWidget( 0);102 setWidget(nullptr); 103 103 104 104 RenderReplaced::willBeDestroyed();
Note:
See TracChangeset
for help on using the changeset viewer.