Changeset 156904 in webkit
- Timestamp:
- Oct 4, 2013 12:22:38 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r156903 r156904 1 2013-10-04 Antti Koivisto <antti@apple.com> 2 3 Tighten markContainingBlocksForLayout 4 https://bugs.webkit.org/show_bug.cgi?id=122326 5 6 Reviewed by Anders Carlsson. 7 1 8 2013-10-04 Andreas Kling <akling@apple.com> 2 9 -
trunk/Source/WebCore/page/FrameView.cpp
r156876 r156904 2403 2403 } 2404 2404 2405 void FrameView::scheduleRelayoutOfSubtree(Render Object& newRelayoutRoot)2405 void FrameView::scheduleRelayoutOfSubtree(RenderElement& newRelayoutRoot) 2406 2406 { 2407 2407 ASSERT(renderView()); … … 3386 3386 parentView->layout(allowSubtree); 3387 3387 3388 Render Object* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView();3388 RenderElement* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView(); 3389 3389 ASSERT_UNUSED(root, !root->needsLayout()); 3390 3390 -
trunk/Source/WebCore/page/FrameView.h
r156871 r156904 107 107 void layoutTimerFired(Timer<FrameView>*); 108 108 void scheduleRelayout(); 109 void scheduleRelayoutOfSubtree(Render Object&);109 void scheduleRelayoutOfSubtree(RenderElement&); 110 110 void unscheduleRelayout(); 111 111 bool layoutPending() const; … … 568 568 Timer<FrameView> m_layoutTimer; 569 569 bool m_delayedLayout; 570 Render Object* m_layoutRoot;570 RenderElement* m_layoutRoot; 571 571 572 572 bool m_layoutSchedulingEnabled; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r156876 r156904 596 596 } 597 597 598 static inline bool objectIsRelayoutBoundary(const Render Object* object)598 static inline bool objectIsRelayoutBoundary(const RenderElement* object) 599 599 { 600 600 // FIXME: In future it may be possible to broaden these conditions in order to improve performance. 601 if (object->isRenderView()) 602 return true; 603 601 604 if (object->isTextControl()) 602 605 return true; … … 635 638 } 636 639 637 void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderObject* newRoot) 640 static void scheduleRelayoutForSubtree(RenderElement& renderer) 641 { 642 if (!renderer.isRenderView()) { 643 if (!renderer.isRooted()) 644 return; 645 renderer.view().frameView().scheduleRelayoutOfSubtree(renderer); 646 return; 647 } 648 toRenderView(renderer).frameView().scheduleRelayout(); 649 } 650 651 void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderElement* newRoot) 638 652 { 639 653 ASSERT(!scheduleRelayout || !newRoot); 640 654 ASSERT(!isSetNeedsLayoutForbidden()); 641 655 642 RenderElement* object = container(); 643 RenderObject* last = this; 656 RenderElement* ancestor = container(); 644 657 645 658 bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout(); 646 647 while (object) { 659 bool hasOutOfFlowPosition = !isText() && style()->hasOutOfFlowPosition(); 660 661 while (ancestor) { 648 662 #ifndef NDEBUG 649 663 // FIXME: Remove this once we remove the special cases for counters, quotes and mathml 650 664 // calling setNeedsLayout during preferred width computation. 651 SetLayoutNeededForbiddenScope layoutForbiddenScope( object, isSetNeedsLayoutForbidden());665 SetLayoutNeededForbiddenScope layoutForbiddenScope(ancestor, isSetNeedsLayoutForbidden()); 652 666 #endif 653 667 // Don't mark the outermost object of an unrooted subtree. That object will be 654 668 // marked when the subtree is added to the document. 655 RenderElement* container = object->container();656 if (!container && ! object->isRenderView())669 RenderElement* container = ancestor->container(); 670 if (!container && !ancestor->isRenderView()) 657 671 return; 658 if ( !last->isText() && last->style()->hasOutOfFlowPosition()) {659 bool willSkipRelativelyPositionedInlines = ! object->isRenderBlock() || object->isAnonymousBlock();672 if (hasOutOfFlowPosition) { 673 bool willSkipRelativelyPositionedInlines = !ancestor->isRenderBlock() || ancestor->isAnonymousBlock(); 660 674 // Skip relatively positioned inlines and anonymous blocks to get to the enclosing RenderBlock. 661 while ( object && (!object->isRenderBlock() || object->isAnonymousBlock()))662 object = object->container();663 if (! object || object->posChildNeedsLayout())675 while (ancestor && (!ancestor->isRenderBlock() || ancestor->isAnonymousBlock())) 676 ancestor = ancestor->container(); 677 if (!ancestor || ancestor->posChildNeedsLayout()) 664 678 return; 665 679 if (willSkipRelativelyPositionedInlines) 666 container = object->container();667 object->setPosChildNeedsLayoutBit(true);680 container = ancestor->container(); 681 ancestor->setPosChildNeedsLayoutBit(true); 668 682 simplifiedNormalFlowLayout = true; 669 ASSERT(!object->isSetNeedsLayoutForbidden());670 683 } else if (simplifiedNormalFlowLayout) { 671 if ( object->needsSimplifiedNormalFlowLayout())684 if (ancestor->needsSimplifiedNormalFlowLayout()) 672 685 return; 673 object->setNeedsSimplifiedNormalFlowLayoutBit(true); 674 ASSERT(!object->isSetNeedsLayoutForbidden()); 686 ancestor->setNeedsSimplifiedNormalFlowLayoutBit(true); 675 687 } else { 676 if ( object->normalChildNeedsLayout())688 if (ancestor->normalChildNeedsLayout()) 677 689 return; 678 object->setNormalChildNeedsLayoutBit(true);679 ASSERT(!object->isSetNeedsLayoutForbidden());680 }681 682 if ( object== newRoot)690 ancestor->setNormalChildNeedsLayoutBit(true); 691 } 692 ASSERT(!ancestor->isSetNeedsLayoutForbidden()); 693 694 if (ancestor == newRoot) 683 695 return; 684 696 685 last = object; 686 if (scheduleRelayout && objectIsRelayoutBoundary(last)) 697 if (scheduleRelayout && objectIsRelayoutBoundary(ancestor)) 687 698 break; 688 object = container; 689 } 690 691 if (scheduleRelayout) 692 last->scheduleRelayout(); 699 700 hasOutOfFlowPosition = ancestor->style()->hasOutOfFlowPosition(); 701 ancestor = container; 702 } 703 704 if (scheduleRelayout && ancestor) 705 scheduleRelayoutForSubtree(*ancestor); 693 706 } 694 707 … … 2205 2218 } 2206 2219 2207 void RenderObject::scheduleRelayout()2208 {2209 if (isRenderView())2210 toRenderView(*this).frameView().scheduleRelayout();2211 else {2212 if (isRooted())2213 view().frameView().scheduleRelayoutOfSubtree(*this);2214 }2215 }2216 2217 2220 void RenderObject::layout() 2218 2221 { -
trunk/Source/WebCore/rendering/RenderObject.h
r156876 r156904 617 617 RenderBoxModelObject* offsetParent() const; 618 618 619 void markContainingBlocksForLayout(bool scheduleRelayout = true, Render Object* newRoot = 0);619 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderElement* newRoot = 0); 620 620 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain); 621 621 void clearNeedsLayout(); … … 653 653 void setHasTransform(bool b = true) { m_bitfields.setHasTransform(b); } 654 654 void setHasReflection(bool b = true) { m_bitfields.setHasReflection(b); } 655 656 void scheduleRelayout();657 655 658 656 virtual void paint(PaintInfo&, const LayoutPoint&);
Note: See TracChangeset
for help on using the changeset viewer.