Changeset 286866 in webkit
- Timestamp:
- Dec 10, 2021 11:37:38 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286857 r286866 1 2021-12-10 Gabriel Nava Marino <gnavamarino@apple.com> 2 3 nullptr deref in ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded 4 https://bugs.webkit.org/show_bug.cgi?id=234018 5 6 Reviewed by Alan Bujtas. 7 8 * fast/rendering/floating-object-renderer-crash-expected.txt: Added. 9 * fast/rendering/floating-object-renderer-crash.html: Added. 10 1 11 2021-12-10 Commit Queue <commit-queue@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r286864 r286866 1 2021-12-10 Gabriel Nava Marino <gnavamarino@apple.com> 2 3 nullptr deref in ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded 4 https://bugs.webkit.org/show_bug.cgi?id=234018 5 6 Reviewed by Alan Bujtas. 7 8 Test: fast/rendering/floating-object-renderer-crash.html 9 10 When destroying a given renderer, we first remove floats and out-of-flow positioned objects 11 from their containing block before detaching the renderer from the tree. We do this by obtaining 12 the renderer’s outermost block containing a floating object and recursively marking all siblings 13 and descendants for layout. 14 15 The criteria for continuing down the list of children require the current block to contain floats 16 or be able to shrink to avoid floats. However, we can have a scenario where the current child block 17 doesn’t have a float, but one of its descendants does. In this case, although we should continue to 18 that descendant and remove the float, we do not. 19 20 The proposal in this patch will instead check whether the child block contains a float, or any of its descendants do. 21 If so we should continue traversing towards that descendant. 22 23 * rendering/RenderBlockFlow.cpp: 24 (WebCore::RenderBlockFlow::subtreeContainsFloat const): 25 (WebCore::RenderBlockFlow::subtreeContainsFloats const): 26 (WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout): 27 * rendering/RenderBlockFlow.h: 28 1 29 2021-12-10 Said Abou-Hallawa <said@apple.com> 2 30 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r286121 r286866 2110 2110 } 2111 2111 2112 bool RenderBlockFlow::subtreeContainsFloat(RenderBox& renderer) const 2113 { 2114 bool contains = m_floatingObjects && m_floatingObjects->set().contains<FloatingObjectHashTranslator>(renderer); 2115 for (auto& block : childrenOfType<RenderBlock>(*this)) { 2116 if (!is<RenderBlockFlow>(block)) 2117 continue; 2118 auto& blockFlow = downcast<RenderBlockFlow>(block); 2119 contains |= blockFlow.subtreeContainsFloat(renderer); 2120 } 2121 return contains; 2122 } 2123 2124 bool RenderBlockFlow::subtreeContainsFloats() const 2125 { 2126 bool contains = m_floatingObjects && !m_floatingObjects->set().isEmpty(); 2127 for (auto& block : childrenOfType<RenderBlock>(*this)) { 2128 if (!is<RenderBlockFlow>(block)) 2129 continue; 2130 auto& blockFlow = downcast<RenderBlockFlow>(block); 2131 contains |= blockFlow.subtreeContainsFloats(); 2132 } 2133 return contains; 2134 } 2135 2112 2136 void RenderBlockFlow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 2113 2137 { … … 2879 2903 } 2880 2904 auto& blockFlow = downcast<RenderBlockFlow>(block); 2881 if ((floatToRemove ? blockFlow. containsFloat(*floatToRemove) : blockFlow.containsFloats()) || blockFlow.shrinkToAvoidFloats())2905 if ((floatToRemove ? blockFlow.subtreeContainsFloat(*floatToRemove) : blockFlow.subtreeContainsFloats()) || blockFlow.shrinkToAvoidFloats()) 2882 2906 blockFlow.markAllDescendantsWithFloatsForLayout(floatToRemove, inLayout); 2883 2907 } -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r285615 r286866 279 279 bool containsFloats() const override { return m_floatingObjects && !m_floatingObjects->set().isEmpty(); } 280 280 bool containsFloat(RenderBox&) const; 281 bool subtreeContainsFloats() const; 282 bool subtreeContainsFloat(RenderBox&) const; 281 283 282 284 void deleteLines() override;
Note: See TracChangeset
for help on using the changeset viewer.