Changeset 286096 in webkit
- Timestamp:
- Nov 20, 2021, 6:43:28 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
layout/formattingContexts/inline/InlineFormattingContext.cpp (modified) (1 diff)
-
layout/formattingContexts/inline/InlineFormattingContext.h (modified) (1 diff)
-
layout/integration/LayoutIntegrationLineLayout.cpp (modified) (1 diff)
-
rendering/RenderBlockFlow.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286094 r286096 1 2021-11-20 Alan Bujtas <zalan@apple.com> 2 3 [IFC][Integration] Initialize layout box geometries for preferred width computation 4 https://bugs.webkit.org/show_bug.cgi?id=233386 5 6 Reviewed by Antti Koivisto. 7 8 Initializing certain geometries (e.g. inline box margin/border/padding) is required for the integration 9 codepath the same way we do it for the actual line layout. 10 11 * layout/formattingContexts/inline/InlineFormattingContext.cpp: Add a dedicated integration codepath for preferred width 12 computation using the preset geometry values. 13 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraintsForIntegration): 14 * layout/formattingContexts/inline/InlineFormattingContext.h: 15 * rendering/RenderBlockFlow.cpp: 16 (WebCore::RenderBlockFlow::tryComputePreferredWidthsUsingModernPath): 17 1 18 2021-11-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
r285956 r286096 158 158 } 159 159 160 IntrinsicWidthConstraints InlineFormattingContext::computedIntrinsicWidthConstraintsForIntegration() 161 { 162 if (formattingState().intrinsicWidthConstraints()) 163 return *formattingState().intrinsicWidthConstraints(); 164 165 collectContentIfNeeded(); 166 167 auto constraints = formattingGeometry().constrainByMinMaxWidth(root(), 168 { ceiledLayoutUnit(computedIntrinsicWidthForConstraint(IntrinsicWidthMode::Minimum)) 169 , ceiledLayoutUnit(computedIntrinsicWidthForConstraint(IntrinsicWidthMode::Maximum)) }); 170 formattingState().setIntrinsicWidthConstraints(constraints); 171 return constraints; 172 } 173 160 174 LayoutUnit InlineFormattingContext::usedContentHeight() const 161 175 { -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h
r285956 r286096 55 55 56 56 void lineLayoutForIntergration(const ConstraintsForInFlowContent&); 57 IntrinsicWidthConstraints computedIntrinsicWidthConstraintsForIntegration(); 57 58 58 59 const InlineFormattingGeometry& formattingGeometry() const final { return m_inlineFormattingGeometry; } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r285782 r286096 221 221 { 222 222 auto inlineFormattingContext = Layout::InlineFormattingContext { rootLayoutBox(), m_inlineFormattingState, nullptr }; 223 auto constraints = inlineFormattingContext.computedIntrinsicWidthConstraints ();223 auto constraints = inlineFormattingContext.computedIntrinsicWidthConstraintsForIntegration(); 224 224 225 225 return { constraints.minimum, constraints.maximum }; -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r286024 r286096 4581 4581 m_lineLayout = makeUnique<LayoutIntegration::LineLayout>(*this); 4582 4582 4583 #if ENABLE_MODERN_PREFERRED_WIDTH_COMPUTATION_FOR_INLINE_BOXES 4584 auto& layoutFormattingContextLineLayout = *this->modernLineLayout(); 4585 for (auto walker = InlineWalker(*this); !walker.atEnd(); walker.advance()) { 4586 auto& renderer = *walker.current(); 4587 if (renderer.isText() || is<RenderLineBreak>(renderer)) 4588 continue; 4589 if (is<RenderInline>(renderer)) { 4590 layoutFormattingContextLineLayout.updateInlineBoxDimensions(downcast<RenderInline>(renderer)); 4591 continue; 4592 } 4593 // FIXME: Add other, inline level box cases. 4594 ASSERT_NOT_IMPLEMENTED_YET(); 4595 } 4596 #endif 4597 4583 4598 std::tie(minLogicalWidth, maxLogicalWidth) = modernLineLayout()->computeIntrinsicWidthConstraints(); 4584 4599 for (auto walker = InlineWalker(*this); !walker.atEnd(); walker.advance())
Note:
See TracChangeset
for help on using the changeset viewer.