[wpt-sync] Sync PR 48282 - [line-clamp] Refactor `line-clamp: auto`
Categories
(Core :: Layout: Scrolling and Overflow, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox132 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
(Blocks 2 open bugs, )
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 48282 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/48282
Details from upstream follow.
Andreu Botella <abotella@igalia.com> wrote:
[line-clamp] Refactor
line-clamp: auto
The current way
line-clamp: auto
works is by checking at every line
and after every (line) box whether the box has reached the clamp
point's BFC offset, and place an ellipsis or hide the box depending on
it. For line boxes, this comparison requires computing the BFC offset
at which the line will finish, before it is computed naturally as part
of the inline layout algorithm. And if no box ends right at the clamp
offset, which is almost every time, the layout has to be redone.An alternative way of doing this work would be by always doing a
relayout: the first pass computes which line number to clamp at, and
the second pass can behave the same asline-clamp: 3
.A complication is that with
line-clamp: auto
, unlike with
line-clamp: 3
, it is possible to break between two lineless boxes.
To account for this, we store both a number of lines until clamp, as
well as a number of remaining boxes between the last line and the
clamp point. We pack the lines and the remaining boxes into a
LineClampData::UntilClamp
struct.Since the previous implementation ellipsized lines based on whether
they end at the clamp point, it means that a line could have an
ellipsis even when it was followed by a zero-height block. It also
meant that if a line inside a block with a setheight
might not have
an ellipsis even if it was the last line before clamp, because it did
not end at the clamp point. This patch fixes those bugs, and adds (or
in the case ofline-clamp-auto-032.tentative.html
, fixes) tests for
them.In cases where the last line before clamp is followed by an abspos,
however, it seems like it would be unexpected for the line to not have
the ellipsis. This remains to be discussed with the CSS Working Group
(see https://github.com/w3c/csswg-drafts/issues/10868), but since
there are previously written tests that rely on this behavior, we have
chosen to special case abspos so such a line is ellipsized.Bug: 40336192, 367892771
Change-Id: I45881ce76b7b23de731ae69ef5c947957cc7cf93
Reviewed-on: https://chromium-review.googlesource.com/5868971
WPT-Export-Revision: 78c49698c48ee40384158e2af59183caf30fe7bc
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 1•1 month ago
|
||
Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 4 tests
Status Summary
Firefox
FAIL
: 4
Chrome
PASS
: 1
FAIL
: 3
Safari
FAIL
: 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /css/css-overflow/line-clamp/line-clamp-auto-032.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-035.tentative.html [wpt.fyi]:
FAIL
(Chrome:PASS
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-036.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-037.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 3•1 month ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 4 tests
Status Summary
Firefox
FAIL
: 4
Chrome
PASS
: 1
FAIL
: 3
Safari
FAIL
: 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /css/css-overflow/line-clamp/line-clamp-auto-032.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-035.tentative.html [wpt.fyi]:
FAIL
(Chrome:PASS
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-036.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-037.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
Comment 5•1 month ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1a1e7abe3b39
https://hg.mozilla.org/mozilla-central/rev/b4aab2084de7
Description
•