Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a6cbe56297ee35fd11065bc60bbb05421e3ff3d6
https://github.com/WebKit/WebKit/commit/a6cbe56297ee35fd11065bc60bbb05421e3ff3d6
Author: Alan Baradlay <[email protected]>
Date: 2026-08-10 (Mon, 10 Aug 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-after-block-level-box-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-after-block-level-box-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-after-block-level-box.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/block-plaintext-paragraph-after-block-level-box-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/block-plaintext-paragraph-after-block-level-box-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/block-plaintext-paragraph-after-block-level-box.html
M
Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.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/InlineLineBuilder.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h
M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp
Log Message:
-----------
[block-in-inline] A block level box on a line does not start a new paragraph
for unicode-bidi: plaintext or text-indent: each-line
https://bugs.webkit.org/show_bug.cgi?id=321398
Reviewed by Antti Koivisto.
Two properties ask whether the previous line ended a paragraph, and
PreviousLine answered with nothing but
endsWithLineBreak.
unicode-bidi: plaintext gives each unicode paragraph the base direction of its
own first strong character.
buildBidiParagraph already counts a block level box as a paragraph separator,
alongside a hard line break,
so the runs come back from ICU in the right order. The line's own base
direction is decided separately in
inlineBaseDirectionForLineContent, where a line carrying a block level box does
not count, so the line after
it takes the direction of the paragraph before the box rather than computing
its own.
text-indent with the each-line modifier indents the first line of the block and
every line after a paragraph
end. computedTextIndent takes the same flag, so the line after a block level
box is not indented either.
An anonymous block hid both. One block per chunk meant each chunk was its own
formatting context, resolving
its own direction from its own content and indenting its own first line.
Firefox indents the line after a
block level box in both shapes, with and without an inline box around the box,
which is what this matches.
Fold the two questions into one: PreviousLine::endsParagraph, true for a forced
line break and for a block
level box on a line, both of which are paragraph separators.
computedTextIndent's parameter is named for
what it now takes.
The text-wrap: balance path keeps its own per line record of forced breaks and
is left alone here.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-after-block-level-box.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-after-block-level-box-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-after-block-level-box-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/block-plaintext-paragraph-after-block-level-box.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/block-plaintext-paragraph-after-block-level-box-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-writing-modes/block-plaintext-paragraph-after-block-level-box-expected.html:
Added.
* Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.cpp:
(WebCore::Layout::buildPreviousLine):
(WebCore::Layout::InlineContentConstrainer::computeParagraphLevelConstraints):
(WebCore::Layout::InlineContentConstrainer::computedTextIndent const):
* Source/WebCore/layout/formattingContexts/inline/InlineContentConstrainer.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::lineLayout):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp:
(WebCore::Layout::InlineFormattingUtils::computedTextIndent const):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::inlineBaseDirectionForLineContent):
(WebCore::Layout::LineBuilder::initialize):
* Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h:
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp:
(WebCore::Layout::IntrinsicWidthHandler::simplifiedTextOnlyMaximumWidth):
Canonical link: https://commits.webkit.org/318886@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications