Changeset 187493 in webkit
- Timestamp:
- Jul 28, 2015, 11:22:53 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
page/FrameView.cpp (modified) (7 diffs)
-
rendering/RenderObject.cpp (modified) (3 diffs)
-
rendering/RenderObject.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r187492 r187493 1 2015-07-28 Simon Fraser <simon.fraser@apple.com> 2 3 Change markContainingBlocksForLayout() to take an enum, rather than a bool 4 https://bugs.webkit.org/show_bug.cgi?id=147345 5 6 Reviewed by Daniel Bates. 7 8 Change markContainingBlocksForLayout to take an enum class for the scheduleRelayout 9 argument, for better code readability. 10 11 * page/FrameView.cpp: 12 (WebCore::FrameView::layout): 13 (WebCore::FrameView::scheduleRelayout): 14 (WebCore::FrameView::scheduleRelayoutOfSubtree): 15 * rendering/RenderObject.cpp: 16 (WebCore::RenderObject::markContainingBlocksForLayout): 17 * rendering/RenderObject.h: 18 1 19 2015-07-27 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebCore/page/FrameView.cpp
r187134 r187493 1214 1214 1215 1215 if (!allowSubtree && m_layoutRoot) { 1216 m_layoutRoot->markContainingBlocksForLayout( false);1216 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 1217 1217 m_layoutRoot = nullptr; 1218 1218 } … … 2551 2551 2552 2552 if (m_layoutRoot) { 2553 m_layoutRoot->markContainingBlocksForLayout( false);2553 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 2554 2554 m_layoutRoot = nullptr; 2555 2555 } … … 2601 2601 2602 2602 if (renderView.needsLayout()) { 2603 newRelayoutRoot.markContainingBlocksForLayout( false);2603 newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No); 2604 2604 return; 2605 2605 } … … 2620 2620 if (!m_layoutRoot) { 2621 2621 // Just relayout the subtree. 2622 newRelayoutRoot.markContainingBlocksForLayout( false);2622 newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No); 2623 2623 InspectorInstrumentation::didInvalidateLayout(frame()); 2624 2624 return; … … 2627 2627 if (isObjectAncestorContainerOf(m_layoutRoot, &newRelayoutRoot)) { 2628 2628 // Keep the current root. 2629 newRelayoutRoot.markContainingBlocksForLayout( false, m_layoutRoot);2629 newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No, m_layoutRoot); 2630 2630 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); 2631 2631 return; … … 2634 2634 if (isObjectAncestorContainerOf(&newRelayoutRoot, m_layoutRoot)) { 2635 2635 // Re-root at newRelayoutRoot. 2636 m_layoutRoot->markContainingBlocksForLayout( false, &newRelayoutRoot);2636 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No, &newRelayoutRoot); 2637 2637 m_layoutRoot = &newRelayoutRoot; 2638 2638 ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); … … 2642 2642 2643 2643 // Just do a full relayout. 2644 m_layoutRoot->markContainingBlocksForLayout( false);2644 m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No); 2645 2645 m_layoutRoot = nullptr; 2646 newRelayoutRoot.markContainingBlocksForLayout( false);2646 newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No); 2647 2647 InspectorInstrumentation::didInvalidateLayout(frame()); 2648 2648 } -
trunk/Source/WebCore/rendering/RenderObject.cpp
r186474 r187493 581 581 } 582 582 583 void RenderObject::markContainingBlocksForLayout( boolscheduleRelayout, RenderElement* newRoot)584 { 585 ASSERT( !scheduleRelayout|| !newRoot);583 void RenderObject::markContainingBlocksForLayout(ScheduleRelayout scheduleRelayout, RenderElement* newRoot) 584 { 585 ASSERT(scheduleRelayout == ScheduleRelayout::No || !newRoot); 586 586 ASSERT(!isSetNeedsLayoutForbidden()); 587 587 … … 627 627 return; 628 628 629 if (scheduleRelayout && objectIsRelayoutBoundary(ancestor))629 if (scheduleRelayout == ScheduleRelayout::Yes && objectIsRelayoutBoundary(ancestor)) 630 630 break; 631 631 … … 634 634 } 635 635 636 if (scheduleRelayout && ancestor)636 if (scheduleRelayout == ScheduleRelayout::Yes && ancestor) 637 637 scheduleRelayoutForSubtree(*ancestor); 638 638 } -
trunk/Source/WebCore/rendering/RenderObject.h
r184395 r187493 106 106 }; 107 107 108 enum class ScheduleRelayout { No, Yes }; 109 108 110 enum MapCoordinatesMode { 109 111 IsFixed = 1 << 0, … … 591 593 RenderBoxModelObject* offsetParent() const; 592 594 593 void markContainingBlocksForLayout( bool scheduleRelayout = true, RenderElement* newRoot = nullptr);595 void markContainingBlocksForLayout(ScheduleRelayout = ScheduleRelayout::Yes, RenderElement* newRoot = nullptr); 594 596 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain); 595 597 void clearNeedsLayout();
Note:
See TracChangeset
for help on using the changeset viewer.