Changeset 223696 in webkit
- Timestamp:
- Oct 19, 2017 11:39:39 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223692 r223696 1 2017-10-19 Zalan Bujtas <zalan@apple.com> 2 3 [FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks 4 https://bugs.webkit.org/show_bug.cgi?id=178518 5 <rdar://problem/35075409> 6 7 Reviewed by Antti Koivisto. 8 9 This patch tightens existing reentrancy policy on performPostLayoutTasks. 10 11 Covered by existing test cases. 12 13 * page/FrameView.cpp: 14 (WebCore::FrameView::FrameView): 15 (WebCore::FrameView::reset): 16 (WebCore::FrameView::layout): 17 (WebCore::FrameView::performPostLayoutTasks): 18 * page/FrameView.h: 19 1 20 2017-10-19 Chris Dumez <cdumez@apple.com> 2 21 -
trunk/Source/WebCore/page/FrameView.cpp
r223689 r223696 243 243 , m_layoutTimer(*this, &FrameView::layoutTimerFired) 244 244 , m_layoutPhase(OutsideLayout) 245 , m_inSynchronousPostLayout(false)246 245 , m_postLayoutTasksTimer(*this, &FrameView::performPostLayoutTasks) 247 246 , m_updateEmbeddedObjectsTimer(*this, &FrameView::updateEmbeddedObjectsTimerFired) … … 342 341 m_layoutSchedulingEnabled = true; 343 342 m_layoutPhase = OutsideLayout; 344 m_inSynchronousPostLayout = false;345 343 m_layoutCount = 0; 346 344 m_postLayoutTasksTimer.stop(); … … 1396 1394 { 1397 1395 SetForScope<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 1398 1399 if (!isLayoutNested() && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !isInChildFrameWithFrameFlattening()) { 1400 // This is a new top-level layout. If there are any remaining tasks from the previous 1401 // layout, finish them now. 1402 SetForScope<bool> inSynchronousPostLayoutChange(m_inSynchronousPostLayout, true); 1396 // If this is a new top-level layout and there are any remaining tasks from the previous layout, finish them now. 1397 if (!isLayoutNested() && m_postLayoutTasksTimer.isActive() && !isInChildFrameWithFrameFlattening()) 1403 1398 performPostLayoutTasks(); 1404 }1405 1399 1406 1400 // Viewport-dependent media queries may cause us to need completely different style information. … … 1554 1548 1555 1549 if (!m_postLayoutTasksTimer.isActive()) { 1556 if (!m_in SynchronousPostLayout) {1550 if (!m_inPerformPostLayoutTasks) { 1557 1551 if (isInChildFrameWithFrameFlattening()) 1558 1552 updateWidgetPositions(); 1559 else { 1560 SetForScope<bool> inSynchronousPostLayoutChange(m_inSynchronousPostLayout, true); 1553 else 1561 1554 performPostLayoutTasks(); // Calls resumeScheduledEvents(). 1562 }1563 1555 } 1564 1556 1565 if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_in SynchronousPostLayout|| isInChildFrameWithFrameFlattening())) {1557 if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_inPerformPostLayoutTasks || isInChildFrameWithFrameFlattening())) { 1566 1558 // If we need layout or are already in a synchronous call to postLayoutTasks(), 1567 1559 // defer widget updates and event dispatch until after we return. postLayoutTasks() … … 3502 3494 void FrameView::performPostLayoutTasks() 3503 3495 { 3496 if (m_inPerformPostLayoutTasks) 3497 return; 3498 3499 SetForScope<bool> inPerformPostLayoutTasks(m_inPerformPostLayoutTasks, true); 3504 3500 // FIXME: We should not run any JavaScript code in this function. 3505 3501 LOG(Layout, "FrameView %p performPostLayoutTasks", this); -
trunk/Source/WebCore/page/FrameView.h
r223689 r223696 806 806 LayoutPhase m_layoutPhase; 807 807 bool m_layoutSchedulingEnabled; 808 bool m_in SynchronousPostLayout;808 bool m_inPerformPostLayoutTasks { false }; 809 809 int m_layoutCount; 810 810 enum class LayoutNestedState { NotInLayout, NotNested, Nested };
Note: See TracChangeset
for help on using the changeset viewer.