[wpt-sync] Sync PR 58385 - [line-clamp] Allow associating line-clamp ellipsis with forced breaks
Categories
(Core :: Layout: Scrolling and Overflow, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 58385 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/58385
Details from upstream follow.
Andreu Botella <abotella@igalia.com> wrote:
[line-clamp] Allow associating line-clamp ellipsis with forced breaks
In https://crrev.com/c/6802120, line-clamp ellipses added as part of
line-breaking (with theCSSLineClampLineBreakingEllipsisruntime
flag enabled) were associated with a layout object, corresponding to
the closest inline item before the ellipsis, if any. This was
important so the ellipsis would correctly repaint.However, not all inline items worked to associate an ellipsis with
(e.g. out-of-flow or ruby items). That CL added a
CanUseItemForNeedsPaintfunction to check this. And importantly,
this function returns false for items that don't have
TextItemType::kNormal. Ideally this should have resulted in the same
layout object as an ellipsis produced byLineTruncator.As it turns out, when the line to ellipsize ends in a forced line
break (an inline item which hasTextItemType::kForcedLineBreak),
this does not matchLineTruncator, which will use the layout object
corresponding to the forced break.In most cases, this difference doesn't matter. However, when the
start tag for aposition: relativeinline is immediately before the
forced break, it does. This is because the inline creates a new layer,
and detecting visual overflow on it (through
LayoutBoxModelObject::RecalcVisualOverflow) finds all inline items
which are associated with that layout object, including the ellipsis.
Since such inline items should correspond to inline boxes, this breaks
some of the assumptions of such code and triggers assertion failures.This CL fixes this by removing the
TextItemTypecheck.Bug: 40336192, 489494018
Change-Id: Iaabe25e9e65f8c1dddbe2b40a6b811e45602e3b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7649894
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Commit-Queue: Andreu Botella \<abotella@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1596921}
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
| Assignee | ||
Comment 2•2 months ago
|
||
Description
•