diff --git a/Source/WebCore/layout/integration/inline/LayoutIntegrationBoxGeometryUpdater.cpp b/Source/WebCore/layout/integration/inline/LayoutIntegrationBoxGeometryUpdater.cpp index 22206e5def91..07d2ee874b03 100644 --- a/Source/WebCore/layout/integration/inline/LayoutIntegrationBoxGeometryUpdater.cpp +++ b/Source/WebCore/layout/integration/inline/LayoutIntegrationBoxGeometryUpdater.cpp @@ -165,10 +165,10 @@ enum class IsPartOfFormattingContext : bool { No, Yes }; static inline Layout::BoxGeometry::Edges logicalBorder(const RenderBoxModelObject& renderer, bool isLeftToRightInlineDirection, BlockFlowDirection blockFlowDirection, UseComputedValues useComputedValues = UseComputedValues::No, IsPartOfFormattingContext isPartOfFormattingContext = IsPartOfFormattingContext::No, bool retainBorderStart = true, bool retainBorderEnd = true) { auto& style = renderer.style(); - auto borderLeft = useComputedValues == UseComputedValues::No ? renderer.borderLeft() : LayoutUnit(style.borderLeft().width()); - auto borderRight = useComputedValues == UseComputedValues::No ? renderer.borderRight() : LayoutUnit(style.borderRight().width()); - auto borderTop = useComputedValues == UseComputedValues::No ? renderer.borderTop() : LayoutUnit(style.borderTop().width()); - auto borderBottom = useComputedValues == UseComputedValues::No ? renderer.borderBottom() : LayoutUnit(style.borderBottom().width()); + auto borderLeft = useComputedValues == UseComputedValues::No ? renderer.borderLeft() : LayoutUnit(style.borderLeftWidth()); + auto borderRight = useComputedValues == UseComputedValues::No ? renderer.borderRight() : LayoutUnit(style.borderRightWidth()); + auto borderTop = useComputedValues == UseComputedValues::No ? renderer.borderTop() : LayoutUnit(style.borderTopWidth()); + auto borderBottom = useComputedValues == UseComputedValues::No ? renderer.borderBottom() : LayoutUnit(style.borderBottomWidth()); if (blockFlowDirection == BlockFlowDirection::TopToBottom || blockFlowDirection == BlockFlowDirection::BottomToTop) { if (isLeftToRightInlineDirection) @@ -334,6 +334,9 @@ void BoxGeometryUpdater::setGeometriesForLayout() for (auto walker = InlineWalker(downcast(boxTree().rootRenderer())); !walker.atEnd(); walker.advance()) { auto& renderer = *walker.current(); + if (is(renderer)) + continue; + if (is(renderer) || is(renderer) || is(renderer) || is(renderer) || is(renderer)) { updateLayoutBoxDimensions(downcast(renderer)); continue; @@ -358,6 +361,9 @@ void BoxGeometryUpdater::setGeometriesForIntrinsicWidth(Layout::IntrinsicWidthMo for (auto walker = InlineWalker(downcast(boxTree().rootRenderer())); !walker.atEnd(); walker.advance()) { auto& renderer = *walker.current(); + if (is(renderer)) + continue; + if (auto* renderLineBreak = dynamicDowncast(renderer)) { updateLineBreakBoxDimensions(*renderLineBreak); continue; @@ -366,7 +372,6 @@ void BoxGeometryUpdater::setGeometriesForIntrinsicWidth(Layout::IntrinsicWidthMo updateInlineBoxDimensions(*renderInline, intrinsicWidthMode); continue; } - ASSERT(is(renderer)); } } diff --git a/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp b/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp index ca01198d37d4..916a1923c58c 100644 --- a/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp +++ b/Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp @@ -250,6 +250,8 @@ std::pair LineLayout::computeIntrinsicWidthConstraints() if (m_lineDamage) m_inlineContentCache.resetMinimumMaximumContentSizes(); // FIXME: This is where we need to switch between minimum and maximum box geometries. + // Currently we only support content where min == max. + m_boxGeometryUpdater.setGeometriesForIntrinsicWidth(Layout::IntrinsicWidthMode::Minimum); auto [minimumContentSize, maximumContentSize] = inlineFormattingContext.minimumMaximumContentSize(m_lineDamage.get()); return { minimumContentSize, maximumContentSize }; } diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp index ed6b569846ce..3151103d975c 100644 --- a/Source/WebCore/rendering/RenderBlockFlow.cpp +++ b/Source/WebCore/rendering/RenderBlockFlow.cpp @@ -4965,8 +4965,6 @@ bool RenderBlockFlow::tryComputePreferredWidthsUsingModernPath(LayoutUnit& minLo if (!modernLineLayout()) m_lineLayout = makeUnique(*this); - modernLineLayout()->updateInlineContentDimensions(); - std::tie(minLogicalWidth, maxLogicalWidth) = modernLineLayout()->computeIntrinsicWidthConstraints(); for (auto walker = InlineWalker(*this); !walker.atEnd(); walker.advance()) { auto* renderer = walker.current();