[webkit-changes] [WebKit/WebKit] 9381da: [IFC][Ruby] Ruby with trailing trimmable whitespac...
Alan Baradlay
noreply at github.com
Sun Oct 13 12:50:06 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9381da472359f4820d59853d60ec393bf0243717
https://github.com/WebKit/WebKit/commit/9381da472359f4820d59853d60ec393bf0243717
Author: Alan Baradlay <zalan at apple.com>
Date: 2024-10-13 (Sun, 13 Oct 2024)
Changed paths:
A LayoutTests/fast/ruby/incorrect-wrapping-with-trailing-whitespace-expected.html
A LayoutTests/fast/ruby/incorrect-wrapping-with-trailing-whitespace.html
M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
Log Message:
-----------
[IFC][Ruby] Ruby with trailing trimmable whitespace may produce redundant line
https://bugs.webkit.org/show_bug.cgi?id=281382
Reviewed by Antti Koivisto.
Do not set completely collapsed annotation box content (0 sized or negative margin box width) as minimum required size
on the candidate content (input to line breaking).
1. With trimmable trailing whitespace on the line the remaining available space may be negative (this is while we build the line)
2. However we should still be able to keep adding content on the line as long as they are also totally collapsible/trimmable or otherwise empty
e.g.
<div style="width: max-content">content followed by empty inline box <span></span></div>
the trailing inline box is supposed to end up on the first line even when we see negative remaining available space _after_
placed all the text content on the line including the trailing whitespace after 'empty inline box'.
However "minimum required space" assumes the content is not collapsible, meaning any (currently) trailing content on the line is not
trimmable anymore. This is not the case when the ruby base, including the associated annotation box is totally empty.
(such empty ruby bases get constructed implicitly when parsing trailing whitespace inside <ruby>)
* LayoutTests/fast/ruby/incorrect-wrapping-with-trailing-whitespace-expected.html: Added.
* LayoutTests/fast/ruby/incorrect-wrapping-with-trailing-whitespace.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::candidateContentForLine):
Canonical link: https://commits.webkit.org/285099@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list