Changeset 224273 in webkit
- Timestamp:
- Nov 1, 2017 12:57:02 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r224271 r224273 1 2017-11-01 Antti Koivisto <antti@apple.com> 2 3 Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers 4 https://bugs.webkit.org/show_bug.cgi?id=179014 5 6 Reviewed by Geoff Garen. 7 8 * fast/ruby/float-overhang-from-ruby-text-expected.txt: 9 * platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt: 10 1 11 2017-10-31 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt
r94991 r224273 18 18 RenderRuby (inline) {RUBY} at (0,0) size 100x50 19 19 RenderRubyRun (anonymous) at (0,0) size 100x50 20 RenderRubyBase (anonymous) at (0,0) size 100x50 21 RenderText {#text} at (0,0) size 100x50 22 text run at (0,0) width 100: "aa" 20 RenderText {#text} at (0,0) size 100x50 21 text run at (0,0) width 100: "aa" 23 22 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt
r177774 r224273 25 25 text run at (30,0) width 47: "HTML" 26 26 RenderRubyRun (anonymous) at (259,10) size 9x18 27 RenderRubyBase (anonymous) at (0,0) size 8x18 28 RenderText {#text} at (0,0) size 8x18 29 text run at (0,0) width 8: "5" 27 RenderText {#text} at (0,0) size 8x18 28 text run at (0,0) width 8: "5" 30 29 RenderText {#text} at (267,10) size 38x18 31 30 text run at (267,10) width 38: " spec." -
trunk/Source/WebCore/ChangeLog
r224269 r224273 1 2017-11-01 Antti Koivisto <antti@apple.com> 2 3 Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers 4 https://bugs.webkit.org/show_bug.cgi?id=179014 5 6 Reviewed by Geoff Garen. 7 8 Treat continuation similarly to other anonymous wrappers. This makes things more understandable 9 and allows removal of some questionable code in RenderBlock::takeChild. 10 11 The patch also makes continuation chain a double linked so we can efficiently remove single 12 continuations from the chain. It also gets rid of algorithms that recurse in continuation chain. 13 14 * accessibility/AccessibilityRenderObject.cpp: 15 (WebCore::firstChildInContinuation): 16 * rendering/RenderBlock.cpp: 17 (WebCore::RenderBlock::styleDidChange): 18 19 Don't add and remove continuations from the chain when updating style. Prevent recursion by walking 20 the chain only in the (non-continuation) head renderer. 21 22 (WebCore::RenderBlock::dropAnonymousBoxChild): 23 24 Make a member function. 25 26 (WebCore::RenderBlock::takeChild): 27 28 Remove code that destroyed empty continuations and caused the parent to destroy itself. 29 Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers. 30 31 * rendering/RenderBlock.h: 32 * rendering/RenderBoxModelObject.cpp: 33 (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode): 34 (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode): 35 (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter): 36 37 Track continuations with double linked lists. 38 39 (WebCore::continuationChainNodeMap): 40 (WebCore::RenderBoxModelObject::willBeDestroyed): 41 42 Don't recurse to destroy continuation chain. 43 Destroy all continuations iteratively if this is the head of the chain. 44 When destroying a continuation renderer simply remove it from the chain. 45 46 (WebCore::RenderBoxModelObject::continuation const): 47 (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter): 48 (WebCore::RenderBoxModelObject::removeFromContinuationChain): 49 (WebCore::RenderBoxModelObject::ensureContinuationChainNode): 50 (WebCore::continuationMap): Deleted. 51 (WebCore::RenderBoxModelObject::setContinuation): Deleted. 52 * rendering/RenderBoxModelObject.h: 53 * rendering/RenderElement.cpp: 54 (WebCore::RenderElement::RenderElement): 55 (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary): 56 57 Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and 58 then using it. 59 Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain). 60 61 (WebCore::RenderElement::styleDidChange): 62 63 removeAnonymousWrappersForInlinesIfNecessary is no function of the parent. 64 65 (WebCore::RenderElement::updateOutlineAutoAncestor): 66 * rendering/RenderElement.h: 67 (WebCore::RenderElement::hasContinuationChainNode const): 68 (WebCore::RenderElement::setHasContinuationChainNode): 69 (WebCore::RenderElement::hasContinuation const): Deleted. 70 (WebCore::RenderElement::setHasContinuation): Deleted. 71 * rendering/RenderInline.cpp: 72 (WebCore::RenderInline::styleDidChange): 73 74 Don't add and remove continuations from the chain when updating style. Prevent recursion by walking 75 the chain only in the (non-continuation) head renderer. 76 77 (WebCore::RenderInline::addChildIgnoringContinuation): 78 79 Remove the old continuation from the chain. splitFlow() will add it back into the right place. 80 81 (WebCore::RenderInline::splitInlines): 82 (WebCore::RenderInline::addChildToContinuation): 83 (WebCore::RenderInline::childBecameNonInline): 84 85 Remove the old continuation from the chain. splitFlow() will add it back into the right place. 86 87 * rendering/RenderInline.h: 88 * rendering/RenderObject.cpp: 89 (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const): 90 (WebCore::RenderObject::outputRenderObject const): 91 (WebCore::findDestroyRootIncludingAnonymous): 92 93 Allow anonymous continuations as destroy roots. 94 95 (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): 96 97 Removing a continuation may leave behind unnecessary anonymous sibling wrappers. 98 Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them. 99 1 100 2017-10-31 Said Abou-Hallawa <sabouhallawa@apple.com> 2 101 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r224260 r224273 164 164 static inline RenderObject* firstChildInContinuation(RenderInline& renderer) 165 165 { 166 auto continuation = renderer.continuation();166 auto* continuation = renderer.continuation(); 167 167 168 168 while (continuation) { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r224150 r224273 436 436 437 437 auto& newStyle = style(); 438 if (!isAnonymousBlock() ) {438 if (!isAnonymousBlock() && !isContinuation()) { 439 439 // Ensure that all of our continuation blocks pick up the new style. 440 for (RenderBlock* currCont = blockElementContinuation(); currCont; currCont = currCont->blockElementContinuation()) { 441 RenderBoxModelObject* nextCont = currCont->continuation(); 442 currCont->setContinuation(0); 440 for (RenderBlock* currCont = blockElementContinuation(); currCont; currCont = currCont->blockElementContinuation()) 443 441 currCont->setStyle(RenderStyle::clone(newStyle)); 444 currCont->setContinuation(nextCont);445 }446 442 } 447 443 … … 819 815 } 820 816 821 void RenderBlock::dropAnonymousBoxChild(RenderBlock& parent, RenderBlock&child)822 { 823 parent.setNeedsLayoutAndPrefWidthsRecalc();824 parent.setChildrenInline(child.childrenInline());817 void RenderBlock::dropAnonymousBoxChild(RenderBlock& child) 818 { 819 setNeedsLayoutAndPrefWidthsRecalc(); 820 setChildrenInline(child.childrenInline()); 825 821 RenderObject* nextSibling = child.nextSibling(); 826 822 827 auto toBeDeleted = parent.takeChildInternal(child, child.hasLayer() ? NotifyChildren : DontNotifyChildren);828 child.moveAllChildrenTo( &parent, nextSibling, child.hasLayer());823 auto toBeDeleted = takeChildInternal(child, child.hasLayer() ? NotifyChildren : DontNotifyChildren); 824 child.moveAllChildrenTo(this, nextSibling, child.hasLayer()); 829 825 // Delete the now-empty block's lines and nuke it. 830 826 child.deleteLines(); … … 894 890 // The removal has knocked us down to containing only a single anonymous 895 891 // box. We can pull the content right back up into our box. 896 dropAnonymousBoxChild( *this,downcast<RenderBlock>(*child));892 dropAnonymousBoxChild(downcast<RenderBlock>(*child)); 897 893 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && canDropAnonymousBlockChild()) { 898 894 // It's possible that the removal has knocked us down to a single anonymous … … 910 906 } 911 907 if (dropAnonymousBlock) 912 dropAnonymousBoxChild( *this,anonBlock);908 dropAnonymousBoxChild(anonBlock); 913 909 } 914 910 } … … 918 914 if (childrenInline()) 919 915 deleteLines(); 920 921 // If we are an empty anonymous block in the continuation chain,922 // we need to remove ourself and fix the continuation chain.923 if (!beingDestroyed() && isAnonymousBlockContinuation() && !oldChild.isListMarker()) {924 auto containingBlockIgnoringAnonymous = containingBlock();925 while (containingBlockIgnoringAnonymous && containingBlockIgnoringAnonymous->isAnonymousBlock())926 containingBlockIgnoringAnonymous = containingBlockIgnoringAnonymous->containingBlock();927 for (RenderObject* current = this; current; current = current->previousInPreOrder(containingBlockIgnoringAnonymous)) {928 if (!is<RenderBoxModelObject>(current) || downcast<RenderBoxModelObject>(*current).continuation() != this)929 continue;930 // Found our previous continuation. We just need to point it to931 // |this|'s next continuation.932 auto* nextContinuation = continuation();933 if (is<RenderInline>(*current))934 downcast<RenderInline>(*current).setContinuation(nextContinuation);935 else if (is<RenderBlock>(*current))936 downcast<RenderBlock>(*current).setContinuation(nextContinuation);937 else938 ASSERT_NOT_REACHED();939 break;940 }941 setContinuation(nullptr);942 // FIXME: This is dangerous.943 removeFromParentAndDestroy();944 }945 916 } 946 917 return takenChild; -
trunk/Source/WebCore/rendering/RenderBlock.h
r223072 r224273 193 193 RenderBlock* blockElementContinuation() const; 194 194 195 using RenderBoxModelObject::continuation;196 using RenderBoxModelObject::setContinuation;197 198 195 static RenderPtr<RenderBlock> createAnonymousWithParentRendererAndDisplay(const RenderBox& parent, EDisplay = BLOCK); 199 196 RenderPtr<RenderBlock> createAnonymousBlock(EDisplay = BLOCK) const; 200 static void dropAnonymousBoxChild(RenderBlock& parent,RenderBlock& child);197 void dropAnonymousBoxChild(RenderBlock& child); 201 198 202 199 RenderPtr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox&) const override; -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r223194 r224273 78 78 // <b><i><p>Hello</p></i></b>. In this example the <i> will have a block as 79 79 // its continuation but the <b> will just have an inline as its continuation. 80 typedef HashMap<const RenderBoxModelObject*, WeakPtr<RenderBoxModelObject>> ContinuationMap; 81 static ContinuationMap& continuationMap() 82 { 83 static NeverDestroyed<ContinuationMap> map; 80 81 struct RenderBoxModelObject::ContinuationChainNode { 82 WeakPtr<RenderBoxModelObject> renderer; 83 ContinuationChainNode* previous { nullptr }; 84 ContinuationChainNode* next { nullptr }; 85 86 ContinuationChainNode(RenderBoxModelObject&); 87 ~ContinuationChainNode(); 88 89 void insertAfter(ContinuationChainNode&); 90 91 WTF_MAKE_FAST_ALLOCATED; 92 }; 93 94 RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode(RenderBoxModelObject& renderer) 95 : renderer(makeWeakPtr(renderer)) 96 { 97 } 98 99 RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode() 100 { 101 if (next) { 102 ASSERT(previous); 103 ASSERT(next->previous == this); 104 next->previous = previous; 105 } 106 if (previous) { 107 ASSERT(previous->next == this); 108 previous->next = next; 109 } 110 } 111 112 void RenderBoxModelObject::ContinuationChainNode::insertAfter(ContinuationChainNode& after) 113 { 114 ASSERT(!previous); 115 ASSERT(!next); 116 if ((next = after.next)) { 117 ASSERT(next->previous = &after); 118 next->previous = this; 119 } 120 previous = &after; 121 after.next = this; 122 } 123 124 typedef HashMap<const RenderBoxModelObject*, std::unique_ptr<RenderBoxModelObject::ContinuationChainNode>> ContinuationChainNodeMap; 125 static ContinuationChainNodeMap& continuationChainNodeMap() 126 { 127 static NeverDestroyed<ContinuationChainNodeMap> map; 84 128 return map; 85 129 } … … 188 232 void RenderBoxModelObject::willBeDestroyed() 189 233 { 190 if (hasContinuation()) { 191 continuation()->removeFromParentAndDestroy(); 192 setContinuation(nullptr); 193 } 234 if (continuation() && !isContinuation()) { 235 removeAndDestroyAllContinuations(); 236 ASSERT(!continuation()); 237 } 238 if (hasContinuationChainNode()) 239 removeFromContinuationChain(); 194 240 195 241 // If this is a first-letter object with a remaining text fragment then the … … 2448 2494 RenderBoxModelObject* RenderBoxModelObject::continuation() const 2449 2495 { 2450 if (!hasContinuation ())2496 if (!hasContinuationChainNode()) 2451 2497 return nullptr; 2452 return continuationMap().get(this).get(); 2453 } 2454 2455 void RenderBoxModelObject::setContinuation(RenderBoxModelObject* continuation) 2456 { 2457 ASSERT(!continuation || continuation->isContinuation()); 2458 if (continuation) 2459 continuationMap().set(this, makeWeakPtr(continuation)); 2460 else if (hasContinuation()) 2461 continuationMap().remove(this); 2462 setHasContinuation(!!continuation); 2498 2499 auto& continuationChainNode = *continuationChainNodeMap().get(this); 2500 if (!continuationChainNode.next) 2501 return nullptr; 2502 return continuationChainNode.next->renderer.get(); 2503 } 2504 2505 void RenderBoxModelObject::insertIntoContinuationChainAfter(RenderBoxModelObject& afterRenderer) 2506 { 2507 ASSERT(isContinuation()); 2508 ASSERT(!continuationChainNodeMap().contains(this)); 2509 2510 auto& after = afterRenderer.ensureContinuationChainNode(); 2511 ensureContinuationChainNode().insertAfter(after); 2512 } 2513 2514 void RenderBoxModelObject::removeFromContinuationChain() 2515 { 2516 ASSERT(hasContinuationChainNode()); 2517 ASSERT(continuationChainNodeMap().contains(this)); 2518 setHasContinuationChainNode(false); 2519 continuationChainNodeMap().remove(this); 2520 } 2521 2522 auto RenderBoxModelObject::ensureContinuationChainNode() -> ContinuationChainNode& 2523 { 2524 setHasContinuationChainNode(true); 2525 return *continuationChainNodeMap().ensure(this, [&] { 2526 return std::make_unique<ContinuationChainNode>(*this); 2527 }).iterator->value; 2528 } 2529 2530 void RenderBoxModelObject::removeAndDestroyAllContinuations() 2531 { 2532 ASSERT(!isContinuation()); 2533 ASSERT(hasContinuationChainNode()); 2534 ASSERT(continuationChainNodeMap().contains(this)); 2535 auto& continuationChainNode = *continuationChainNodeMap().get(this); 2536 while (continuationChainNode.next) 2537 continuationChainNode.next->renderer->removeFromParentAndDestroy(); 2538 removeFromContinuationChain(); 2463 2539 } 2464 2540 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r222556 r224273 236 236 237 237 RenderBoxModelObject* continuation() const; 238 239 void insertIntoContinuationChainAfter(RenderBoxModelObject&); 240 void removeFromContinuationChain(); 238 241 239 242 virtual LayoutRect paintRectToClipOutFromBorder(const LayoutRect&) { return LayoutRect(); }; … … 257 260 InterpolationQuality chooseInterpolationQuality(GraphicsContext&, Image&, const void*, const LayoutSize&); 258 261 259 void setContinuation(RenderBoxModelObject*);260 261 262 LayoutRect localCaretRectForEmptyElement(LayoutUnit width, LayoutUnit textIndentOffset); 262 263 … … 302 303 RenderBlock* containingBlockForAutoHeightDetection(Length logicalHeight) const; 303 304 305 struct ContinuationChainNode; 306 304 307 private: 308 ContinuationChainNode& ensureContinuationChainNode(); 309 void removeAndDestroyAllContinuations(); 310 305 311 LayoutUnit computedCSSPadding(const Length&) const; 306 312 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r224150 r224273 102 102 , m_hasPausedImageAnimations(false) 103 103 , m_hasCounterNodeMap(false) 104 , m_hasContinuation (false)104 , m_hasContinuationChainNode(false) 105 105 , m_isContinuation(false) 106 106 , m_hasValidCachedFirstLineStyle(false) … … 962 962 void RenderElement::removeAnonymousWrappersForInlinesIfNecessary() 963 963 { 964 RenderBlock& parentBlock = downcast<RenderBlock>(*parent()); 965 if (!parentBlock.canDropAnonymousBlockChild()) 964 // FIXME: Move to RenderBlock. 965 if (!is<RenderBlock>(*this)) 966 return; 967 RenderBlock& thisBlock = downcast<RenderBlock>(*this); 968 if (!thisBlock.canDropAnonymousBlockChild()) 966 969 return; 967 970 … … 971 974 // FIXME: We should also handle split inlines here - we exclude them at the moment by returning 972 975 // if we find a continuation. 973 RenderObject* current = parent()->firstChild();974 while (current && ((current->isAnonymousBlock() && !downcast<RenderBlock>(*current).is AnonymousBlockContinuation()) || current->style().isFloating() || current->style().hasOutOfFlowPosition()))976 RenderObject* current = firstChild(); 977 while (current && ((current->isAnonymousBlock() && !downcast<RenderBlock>(*current).isContinuation()) || current->style().isFloating() || current->style().hasOutOfFlowPosition())) 975 978 current = current->nextSibling(); 976 979 … … 979 982 980 983 RenderObject* next; 981 for (current = parent()->firstChild(); current; current = next) {984 for (current = firstChild(); current; current = next) { 982 985 next = current->nextSibling(); 983 986 if (current->isAnonymousBlock()) 984 parentBlock.dropAnonymousBoxChild(parentBlock,downcast<RenderBlock>(*current));987 thisBlock.dropAnonymousBoxChild(downcast<RenderBlock>(*current)); 985 988 } 986 989 } … … 1011 1014 1012 1015 if (s_noLongerAffectsParentBlock) 1013 removeAnonymousWrappersForInlinesIfNecessary();1016 parent()->removeAnonymousWrappersForInlinesIfNecessary(); 1014 1017 1015 1018 SVGRenderSupport::styleChanged(*this, oldStyle); … … 2153 2156 downcast<RenderElement>(child).updateOutlineAutoAncestor(hasOutlineAuto); 2154 2157 } 2155 if (hasContinuation()) 2156 downcast<RenderBoxModelObject>(*this).continuation()->updateOutlineAutoAncestor(hasOutlineAuto); 2158 if (is<RenderBoxModelObject>(*this)) { 2159 if (auto* continuation = downcast<RenderBoxModelObject>(*this).continuation()) 2160 continuation->updateOutlineAutoAncestor(hasOutlineAuto); 2161 } 2157 2162 } 2158 2163 -
trunk/Source/WebCore/rendering/RenderElement.h
r223569 r224273 222 222 virtual void updateAnonymousChildStyle(const RenderObject&, RenderStyle&) const { }; 223 223 224 bool hasContinuation() const { return m_hasContinuation; } 224 void removeAnonymousWrappersForInlinesIfNecessary(); 225 226 bool hasContinuationChainNode() const { return m_hasContinuationChainNode; } 225 227 bool isContinuation() const { return m_isContinuation; } 226 228 void setIsContinuation() { m_isContinuation = true; } … … 265 267 bool renderInlineAlwaysCreatesLineBoxes() const { return m_renderInlineAlwaysCreatesLineBoxes; } 266 268 267 void setHasContinuation (bool b) { m_hasContinuation= b; }269 void setHasContinuationChainNode(bool b) { m_hasContinuationChainNode = b; } 268 270 269 271 void setRenderBlockHasMarginBeforeQuirk(bool b) { m_renderBlockHasMarginBeforeQuirk = b; } … … 304 306 // normal flow object. 305 307 void handleDynamicFloatPositionChange(); 306 void removeAnonymousWrappersForInlinesIfNecessary();307 308 308 309 bool shouldRepaintForStyleDifference(StyleDifference) const; … … 337 338 unsigned m_hasPausedImageAnimations : 1; 338 339 unsigned m_hasCounterNodeMap : 1; 339 unsigned m_hasContinuation : 1;340 unsigned m_hasContinuationChainNode : 1; 340 341 unsigned m_isContinuation : 1; 341 342 mutable unsigned m_hasValidCachedFirstLineStyle : 1; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r223127 r224273 190 190 auto& newStyle = style(); 191 191 RenderInline* continuation = inlineElementContinuation(); 192 if (continuation) { 193 for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) { 194 RenderBoxModelObject* nextCont = currCont->continuation(); 195 currCont->setContinuation(nullptr); 192 if (continuation && !isContinuation()) { 193 for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) 196 194 currCont->setStyle(RenderStyle::clone(newStyle)); 197 currCont->setContinuation(nextCont);198 }199 195 // If an inline's in-flow positioning has changed and it is part of an active continuation as a descendant of an anonymous containing block, 200 196 // then any descendant blocks will need to change their in-flow positioning accordingly. … … 345 341 newBox->setIsContinuation(); 346 342 RenderBoxModelObject* oldContinuation = continuation(); 347 setContinuation(newBox.get()); 343 if (oldContinuation) 344 oldContinuation->removeFromContinuationChain(); 345 newBox->insertIntoContinuationChainAfter(*this); 348 346 349 347 splitFlow(beforeChild, WTFMove(newBox), WTFMove(newChild), oldContinuation); … … 418 416 rendererToMove = nextSibling; 419 417 } 420 cloneInline->setContinuation(oldCont);421 418 // Hook |clone| up as the continuation of the middle block. 422 middleBlock->setContinuation(cloneInline.get()); 419 cloneInline->insertIntoContinuationChainAfter(*middleBlock); 420 if (oldCont) 421 oldCont->insertIntoContinuationChainAfter(*cloneInline); 423 422 424 423 // We have been reparented and are now under the fromBlock. We need … … 444 443 445 444 // Hook the clone up as a continuation of |curr|. 446 RenderInline& currentInline = downcast<RenderInline>(*current); 447 oldCont = currentInline.continuation(); 448 currentInline.setContinuation(cloneInline.get()); 449 cloneInline->setContinuation(oldCont); 445 cloneInline->insertIntoContinuationChainAfter(*current); 450 446 451 447 // Now we need to take all of the children starting from the first child 452 448 // *after* currentChild and append them all to the clone. 453 for (auto* current = currentChild->nextSibling(); current;) {454 auto* next = current->nextSibling();455 auto childToMove = current Inline.takeChildInternal(*current, NotifyChildren);449 for (auto* sibling = currentChild->nextSibling(); sibling;) { 450 auto* next = sibling->nextSibling(); 451 auto childToMove = current->takeChildInternal(*sibling, NotifyChildren); 456 452 cloneInline->addChildIgnoringContinuation(WTFMove(childToMove)); 457 current->setNeedsLayoutAndPrefWidthsRecalc();458 current= next;453 sibling->setNeedsLayoutAndPrefWidthsRecalc(); 454 sibling = next; 459 455 } 460 456 } … … 577 573 while (parent && parent->parent() && parent->parent()->isAnonymous()) { 578 574 // The ancestor candidate needs to be inside the continuation. 579 if (parent-> hasContinuation())575 if (parent->isContinuation()) 580 576 break; 581 577 parent = parent->parent(); … … 1380 1376 newBox->setIsContinuation(); 1381 1377 RenderBoxModelObject* oldContinuation = continuation(); 1382 setContinuation(newBox.get()); 1378 if (oldContinuation) 1379 oldContinuation->removeFromContinuationChain(); 1380 newBox->insertIntoContinuationChainAfter(*this); 1383 1381 RenderObject* beforeChild = child.nextSibling(); 1384 1382 auto removedChild = takeChildInternal(child, NotifyChildren); -
trunk/Source/WebCore/rendering/RenderInline.h
r223127 r224273 87 87 void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) final; 88 88 void paintOutline(PaintInfo&, const LayoutPoint&); 89 90 using RenderBoxModelObject::continuation;91 using RenderBoxModelObject::setContinuation;92 89 93 90 bool alwaysCreateLineBoxes() const { return renderInlineAlwaysCreatesLineBoxes(); } -
trunk/Source/WebCore/rendering/RenderObject.cpp
r224177 r224273 825 825 ASSERT(rendererHasOutlineAutoAncestor 826 826 || renderer->outlineStyleForRepaint().outlineStyleIsAuto() 827 || (is<Render Element>(*renderer) && downcast<RenderElement>(*renderer).hasContinuation()));827 || (is<RenderBoxModelObject>(*renderer) && downcast<RenderBoxModelObject>(*renderer).isContinuation())); 828 828 if (renderer == &repaintContainer && rendererHasOutlineAutoAncestor) 829 829 repaintRectNeedsConverting = true; … … 1176 1176 if (is<RenderBoxModelObject>(*this)) { 1177 1177 auto& renderer = downcast<RenderBoxModelObject>(*this); 1178 if (renderer. hasContinuation())1178 if (renderer.continuation()) 1179 1179 stream << " continuation->(" << renderer.continuation() << ")"; 1180 1180 } … … 1467 1467 if (destroyRootParent->isRenderFragmentedFlow()) 1468 1468 break; 1469 // FIXME: Destroy continuations here too.1470 if (destroyRootParent->isContinuation())1471 break;1472 1469 bool destroyingOnlyChild = destroyRootParent->firstChild() == destroyRoot && destroyRootParent->lastChild() == destroyRoot; 1473 1470 if (!destroyingOnlyChild) … … 1491 1488 downcast<RenderTableRow>(destroyRoot).collapseAndDestroyAnonymousSiblingRows(); 1492 1489 1493 destroyRoot.removeFromParentAndDestroy(); 1490 auto& destroyRootParent = *destroyRoot.parent(); 1491 destroyRootParent.removeAndDestroyChild(destroyRoot); 1492 destroyRootParent.removeAnonymousWrappersForInlinesIfNecessary(); 1494 1493 // WARNING: |this| is deleted here. 1495 1494 }
Note: See TracChangeset
for help on using the changeset viewer.