Changeset 228665 in webkit
- Timestamp:
- Feb 19, 2018 5:17:03 AM (6 years ago)
- Location:
- releases/WebKitGTK/webkit-2.20/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog
r228663 r228665 1 2018-02-08 Zalan Bujtas <zalan@apple.com> 2 3 [RenderTreeBuilder] Move RenderElement::removeAnonymousWrappersForInlinesIfNecessary to RenderTreeBuilder 4 https://bugs.webkit.org/show_bug.cgi?id=182582 5 <rdar://problem/37327890> 6 7 Reviewed by Antti Koivisto. 8 9 Tree mutation -> RenderTreeBuilder. 10 11 No change in functionality 12 13 * rendering/RenderElement.cpp: 14 (WebCore::RenderElement::styleDidChange): 15 (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary): Deleted. 16 * rendering/RenderElement.h: 17 * rendering/updating/RenderTreeBuilder.cpp: 18 (WebCore::removeAnonymousWrappersForInlinesIfNecessary): 19 (WebCore::RenderTreeBuilder::childFlowStateChangesAndNoLongerAffectsParentBlock): 20 (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers): 21 * rendering/updating/RenderTreeBuilder.h: 22 1 23 2018-02-08 Philippe Normand <pnormand@igalia.com> 2 24 -
releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderElement.cpp
r228655 r228665 916 916 } 917 917 918 void RenderElement::removeAnonymousWrappersForInlinesIfNecessary()919 {920 // FIXME: Move to RenderBlock.921 if (!is<RenderBlock>(*this))922 return;923 RenderBlock& thisBlock = downcast<RenderBlock>(*this);924 if (!thisBlock.canDropAnonymousBlockChild())925 return;926 927 // We have changed to floated or out-of-flow positioning so maybe all our parent's928 // children can be inline now. Bail if there are any block children left on the line,929 // otherwise we can proceed to stripping solitary anonymous wrappers from the inlines.930 // FIXME: We should also handle split inlines here - we exclude them at the moment by returning931 // if we find a continuation.932 RenderObject* current = firstChild();933 while (current && ((current->isAnonymousBlock() && !downcast<RenderBlock>(*current).isContinuation()) || current->style().isFloating() || current->style().hasOutOfFlowPosition()))934 current = current->nextSibling();935 936 if (current)937 return;938 939 RenderObject* next;940 for (current = firstChild(); current; current = next) {941 next = current->nextSibling();942 if (current->isAnonymousBlock())943 thisBlock.dropAnonymousBoxChild(downcast<RenderBlock>(*current));944 }945 }946 947 918 #if !PLATFORM(IOS) 948 919 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderStyle* b) … … 976 947 977 948 if (s_noLongerAffectsParentBlock) 978 parent()->removeAnonymousWrappersForInlinesIfNecessary();949 RenderTreeBuilder::current()->childFlowStateChangesAndNoLongerAffectsParentBlock(*this); 979 950 980 951 SVGRenderSupport::styleChanged(*this, oldStyle); -
releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/RenderElement.h
r228655 r228665 221 221 virtual void updateAnonymousChildStyle(RenderStyle&) const { }; 222 222 223 void removeAnonymousWrappersForInlinesIfNecessary();224 225 223 bool hasContinuationChainNode() const { return m_hasContinuationChainNode; } 226 224 bool isContinuation() const { return m_isContinuation; } -
releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
r227977 r228665 319 319 } 320 320 321 void RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded(RenderElement& parent) 322 { 323 if (!is<RenderBlock>(parent)) 324 return; 325 auto& blockParent = downcast<RenderBlock>(parent); 326 if (!blockParent.canDropAnonymousBlockChild()) 327 return; 328 329 // We have changed to floated or out-of-flow positioning so maybe all our parent's 330 // children can be inline now. Bail if there are any block children left on the line, 331 // otherwise we can proceed to stripping solitary anonymous wrappers from the inlines. 332 // FIXME: We should also handle split inlines here - we exclude them at the moment by returning 333 // if we find a continuation. 334 auto* current = blockParent.firstChild(); 335 while (current && ((current->isAnonymousBlock() && !downcast<RenderBlock>(*current).isContinuation()) || current->style().isFloating() || current->style().hasOutOfFlowPosition())) 336 current = current->nextSibling(); 337 338 if (current) 339 return; 340 341 RenderObject* next; 342 for (current = blockParent.firstChild(); current; current = next) { 343 next = current->nextSibling(); 344 if (current->isAnonymousBlock()) 345 blockParent.dropAnonymousBoxChild(downcast<RenderBlock>(*current)); 346 } 347 } 348 349 void RenderTreeBuilder::childFlowStateChangesAndNoLongerAffectsParentBlock(RenderElement& child) 350 { 351 ASSERT(child.parent()); 352 removeAnonymousWrappersForInlineChildrenIfNeeded(*child.parent()); 353 } 354 321 355 static bool isAnonymousAndSafeToDelete(RenderElement& element) 322 356 { … … 360 394 auto& destroyRootParent = *destroyRoot.parent(); 361 395 destroyRootParent.removeAndDestroyChild(*this, destroyRoot); 362 destroyRootParent.removeAnonymousWrappersForInlinesIfNecessary();396 removeAnonymousWrappersForInlineChildrenIfNeeded(destroyRootParent); 363 397 364 398 // Anonymous parent might have become empty, try to delete it too. -
releases/WebKitGTK/webkit-2.20/Source/WebCore/rendering/updating/RenderTreeBuilder.h
r227928 r228665 77 77 void moveRubyChildren(RenderRubyBase& from, RenderRubyBase& to); 78 78 void childFlowStateChangesAndAffectsParentBlock(RenderElement& child); 79 void childFlowStateChangesAndNoLongerAffectsParentBlock(RenderElement& child); 79 80 RenderObject* resolveMovedChildForMultiColumnFlow(RenderFragmentedFlow& enclosingFragmentedFlow, RenderObject* beforeChild); 80 81 void removeFromParentAndDestroyCleaningUpAnonymousWrappers(RenderObject& child); … … 92 93 class SVG; 93 94 class MathML; 95 96 void removeAnonymousWrappersForInlineChildrenIfNeeded(RenderElement& parent); 94 97 95 98 FirstLetter& firstLetterBuilder() { return *m_firstLetterBuilder; }
Note: See TracChangeset
for help on using the changeset viewer.