Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eeb94b40e98d4a34c0b095f90211df6aacf1bf05
https://github.com/WebKit/WebKit/commit/eeb94b40e98d4a34c0b095f90211df6aacf1bf05
Author: Alan Baradlay <[email protected]>
Date: 2026-02-25 (Wed, 25 Feb 2026)
Changed paths:
A LayoutTests/fast/inline/empty-inline-box-stretches-container-expected.html
A LayoutTests/fast/inline/empty-inline-box-stretches-container.html
M LayoutTests/platform/glib/fast/inline/outline-continuations-expected.txt
M LayoutTests/platform/ios/fast/inline/outline-continuations-expected.txt
M LayoutTests/platform/mac/fast/inline/outline-continuations-expected.txt
M Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h
M
Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.h
M Source/WebCore/layout/formattingContexts/inline/InlineLine.h
M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp
M Source/WebCore/layout/integration/LayoutIntegrationUtils.cpp
M Source/WebCore/layout/integration/LayoutIntegrationUtils.h
M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
Log Message:
-----------
[block-in-inline] Self collapsed block lines should offset and not stretch
https://bugs.webkit.org/show_bug.cgi?id=308478
Reviewed by Antti Koivisto.
This change enables us to remove the FIXME from lastLineWithInflowContent where
now we can just return the position of the last line with content.
This was problematic for cases where the content ended with a self-collapsing
block
and the associated line was stretched to the bottom of the block. Returning the
bottom
of such stretched lines made the containing block taller that it was supposed
to be - see ascii art below
<div container with no padding or border>
<div 10px tall with 50px margin-bottom></div>
<div self-collapsing block></div>
</div>
__________________________ container
| ____________________ 10px tall box
||
||____________________
|_________^_______________
|
| 50px margin
|
_________v_____________ self collapsing block
|
Here the self collapsing block belongs to a line where the line stretches
all the way to the bottom of the self collapsing block (i.e. it is 50px tall).
In cases like this we couldn't return the (self collapsing block) line bottom
as the bottom of the inline content.
With this change, the line is no longer encloses the block. It is is 0px tall
and is adjacent to the previous line while the block box has an offset and
overflows the line.
The offset is computed at layoutWithFormattingContextForBlockInInline and now
we use it only to offset the block instead of
stretching the line and offsetting the box.
Test: fast/inline/empty-inline-box-stretches-container.html
* LayoutTests/fast/inline/empty-inline-box-stretches-container-expected.html:
Added.
* LayoutTests/fast/inline/empty-inline-box-stretches-container.html: Added.
* LayoutTests/platform/glib/fast/inline/outline-continuations-expected.txt:
* LayoutTests/platform/ios/fast/inline/outline-continuations-expected.txt:
* LayoutTests/platform/mac/fast/inline/outline-continuations-expected.txt:
* Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h:
(WebCore::Layout::BlockLayoutState::MarginState::resetMarginValues):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::updateLayoutStateWithLineLayoutResult):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp:
(WebCore::Layout::InlineFormattingUtils::logicalTopForNextLine const):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
(WebCore::Layout::Line::hasLineSpanningInlineBoxOnly const): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::handleInlineContent):
*
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.cpp:
(WebCore::LayoutIntegration::layoutWithFormattingContextForBlockInInline):
* Source/WebCore/layout/integration/LayoutIntegrationUtils.cpp:
(WebCore::Layout::IntegrationUtils::toMarginState):
* Source/WebCore/layout/integration/LayoutIntegrationUtils.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::lastLineWithInflowContent):
(WebCore::LayoutIntegration::LineLayout::layout):
Canonical link: https://commits.webkit.org/308227@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications