[css-text] Consider breaking opportunities of inline siblings #19651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, bear in mind that this change affects only to
intrinsic size computation in legacy layout.
During the intrinsic size computation of blocks with inline children,
we are determining the breaking opportunities for each child. When the
word-break: break-word is used, each of this breaking opportunities
should account for the min-content size.
We only consider breakable locations for start and end if they are
br elements or spaces, under auto-wrap, to compute the intrinsic size
of a box. This is fine, since we are already using a break iterator
to determine the min-size of each word. However, we were incorrectly
summing the first_line_min_width for each inline sibling, even when
they were part of the same text line.
This change tries to avoid that problem by assuming that there is
always a breaking opportunity after every character, since the
spec now states that break-word should behave as normal and
overflow-wrap: anywhere.
Bug: 1013644
Change-Id: I04261b323cd029a624724363a566fccc826863af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856959
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/master@{#710359}