Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4b5123221d3b52683ca5d44e1728f614d2d946b5
https://github.com/WebKit/WebKit/commit/4b5123221d3b52683ca5d44e1728f614d2d946b5
Author: Alan Baradlay <[email protected]>
Date: 2026-08-06 (Thu, 06 Aug 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-break/box-decoration-break-clone-block-in-inline-001-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-break/box-decoration-break-clone-block-in-inline-001.html
M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
M
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp
Log Message:
-----------
[block-in-inline] Inline box with cloned decoration generates an extra line
between two block level boxes
https://bugs.webkit.org/show_bug.cgi?id=321143
Reviewed by Antti Koivisto.
<span style="-webkit-box-decoration-break: clone; border: 20px solid magenta">
a
<div>block</div>
<span></span>
<div>block</div>
c
</span>
The two block level boxes should be right next to each other, the way they are
in
Blink. Instead a 20px tall line with a 40px wide magenta border box showed up
between them, for the empty inline box.
The test case is adapted from Oriol Brufau's reduction in
https://github.com/w3c/csswg-drafts/issues/14104
Line::initialize hands a line spanning inline box run the width of its cloned
decoration, so isContentfulOrHasDecoration answered "contentful" on its very
first
check (run.logicalWidth()) and the line got a full strut. The fragment's
display box
was then built from the border box, so all four cloned edges painted.
Cloned decoration wraps the content of a box fragment, so it can't make a line
contentful by itself. A line spanning inline box start no longer does, and on a
line
with no inline content its display box uses the content box -the rule block
lines
already followed. This matches Blink.
* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::Run::isContentfulOrHasDecoration):
*
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processNonBidiContent):
*
LayoutTests/imported/w3c/web-platform-tests/css/css-break/box-decoration-break-clone-block-in-inline-001.html:
Added.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Canonical link: https://commits.webkit.org/318718@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications