Closed Bug 1962663 Opened 19 days ago Closed 15 days ago

[wpt-sync] Sync PR 52120 - [line-clamp] Make `text-overflow: ellipsis` work inside `line-clamp`

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 52120 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/52120
Details from upstream follow.

Andreu Botella <abotella@igalia.com> wrote:

[line-clamp] Make text-overflow: ellipsis work inside line-clamp

Since -webkit-line-clamp was first implemented in Webkit, using line
clamping would prevent text-overflow: ellipsis from working inside
the line clamp container. This seems to have been a side effect of the
initial implementation, and it was kept as it was when the
implementation was redone for LayoutNG, even though that is no longer
a side effect.

Recently, in https://github.com/w3c/csswg-drafts/issues/10823 the
CSSWG resolved that text-overflow: ellipsis should apply inside a
line-clamp container. For the last line until clamp, if
text-overflow: ellipsis also applies to it, the line clamp ellipsis
is applied first -- however, since we currently only support ellipsis,
rather than a text string, for both the text-overflow and line-clamp
ellipses, this would be identical to only applying the line clamp
ellipsis.

This change also removes the LineClampData::State::kDontTruncate
state, which was set when there was no possibility of clamping, but
text-overflow: ellipsis should still not apply because we were still
inside the line-clamp container. Since text-overflow: ellipsis now
should apply in those cases, we remove that state, and use kDisabled
instead. We also add an ignore_line_clamp flag to
BlockLineClampData to know to ignore the line-clamp properties when
performing a relayout without clamping.

Additionally, this change updates some WPT tests that were rendered
incorrect with this resolution.

Bug: 40336192, 407971271
Change-Id: I06e43011a12ba27507b6f661c7b0484d6587cf19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6470150
Reviewed-by: Ian Kilpatrick \<ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Commit-Queue: Andreu Botella \<abotella@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1451710}

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 4 tests

Status Summary

Firefox

PASS: 1
FAIL: 3

Chrome

FAIL: 4

Safari

PASS: 1
FAIL: 3

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab51b6e73ebf [wpt PR 52120] - [line-clamp] Make `text-overflow: ellipsis` work inside `line-clamp`, a=testonly https://hg.mozilla.org/integration/autoland/rev/2c86ab448658 [wpt PR 52120] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 15 days ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
You need to log in before you can comment on or make changes to this bug.