Changeset 207310 in webkit
- Timestamp:
- Oct 13, 2016 2:41:01 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207305 r207310 1 2016-10-13 Zalan Bujtas <zalan@apple.com> 2 3 [Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails. 4 https://bugs.webkit.org/show_bug.cgi?id=163399 5 6 Reviewed by David Hyatt. 7 8 When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic 9 should dismiss the RenderTable as the parent and find a more appropriate ancestor. 10 RenderTables assumes a certain descendant tree structure which might not be available in the continuation. 11 12 Will be testable with webkit.org/b/162834 13 14 * rendering/RenderInline.cpp: 15 (WebCore::canUseAsParentForContinuation): 16 (WebCore::RenderInline::addChildToContinuation): 17 1 18 2016-10-13 Alex Christensen <achristensen@webkit.org> 2 19 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r206538 r207310 41 41 #include "RenderListMarker.h" 42 42 #include "RenderNamedFlowThread.h" 43 #include "RenderTable.h" 43 44 #include "RenderTheme.h" 44 45 #include "RenderView.h" … … 602 603 } 603 604 605 static bool canUseAsParentForContinuation(const RenderObject* renderer) 606 { 607 if (!renderer) 608 return false; 609 if (!is<RenderBlock>(renderer) && renderer->isAnonymous()) 610 return false; 611 if (is<RenderTable>(renderer)) 612 return false; 613 return true; 614 } 615 604 616 void RenderInline::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild) 605 617 { 606 RenderBoxModelObject* flow = continuationBefore(beforeChild);618 auto* flow = continuationBefore(beforeChild); 607 619 // It may or may not be the direct parent of the beforeChild. 608 620 RenderBoxModelObject* beforeChildAncestor = nullptr; 609 // In case of anonymous wrappers, the parent of the beforeChild is mostly irrelevant. What we need is 610 // the topmost wrapper. 611 if (beforeChild && !is<RenderBlock>(beforeChild->parent()) && beforeChild->parent()->isAnonymous()) { 612 RenderElement* anonymousParent = beforeChild->parent(); 613 while (anonymousParent && anonymousParent->parent() && anonymousParent->parent()->isAnonymous()) 614 anonymousParent = anonymousParent->parent(); 615 ASSERT(anonymousParent && anonymousParent->parent()); 616 beforeChildAncestor = downcast<RenderBoxModelObject>(anonymousParent->parent()); 617 } else { 618 ASSERT(!beforeChild || is<RenderBlock>(*beforeChild->parent()) || is<RenderInline>(*beforeChild->parent())); 619 if (beforeChild) 620 beforeChildAncestor = downcast<RenderBoxModelObject>(beforeChild->parent()); 621 else { 622 if (RenderBoxModelObject* continuation = nextContinuation(flow)) 623 beforeChildAncestor = continuation; 624 else 625 beforeChildAncestor = flow; 626 } 627 } 621 // In case of anonymous wrappers, the parent of the beforeChild is mostly irrelevant. What we need is the topmost wrapper. 622 if (!beforeChild) { 623 auto* continuation = nextContinuation(flow); 624 beforeChildAncestor = continuation ? continuation : flow; 625 } else if (canUseAsParentForContinuation(beforeChild->parent())) 626 beforeChildAncestor = downcast<RenderBoxModelObject>(beforeChild->parent()); 627 else if (beforeChild->parent()) { 628 auto* parent = beforeChild->parent(); 629 while (parent && parent->parent() && parent->parent()->isAnonymous()) 630 parent = parent->parent(); 631 ASSERT(parent && parent->parent()); 632 beforeChildAncestor = downcast<RenderBoxModelObject>(parent->parent()); 633 } else 634 ASSERT_NOT_REACHED(); 628 635 629 636 if (newChild->isFloatingOrOutOfFlowPositioned())
Note: See TracChangeset
for help on using the changeset viewer.