[wpt-sync] Sync PR 47118 - [line-clamp] Make `line-clamp: auto` account for margins
Categories
(Core :: Layout: Scrolling and Overflow, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox130 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 47118 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/47118
Details from upstream follow.
Andreu Botella <abotella@igalia.com> wrote:
[line-clamp] Make
line-clamp: auto
account for marginsIn order for
line-clamp: auto
to properly clamp lines in nested
block elements, their bottom margin/padding/border must be accounted
for. Our previous patch, https://crrev.com/c/5547983, accounted for
paddings and borders, but margins are more complicated due to margin
collapsing.Fortunately, some of the complications inherent in margin collapsing
don't apply to line-clamp. Since no boxes that start after the clamp
point should affect the layout, and it doesn't make sense to clamp
inside a self-collapsing box (although it does after one), we don't
need to handle self-collapse as part of line-clamp.However, because a box's bottom margin can collapse with its
ancestors' bottom margins, the ancestor's bottom margin strut must be
propagated to its children. Rather than computing an end margin strut
inwards-out, as happens during normal layout, we need to have this
data before a box's layout start; so we pass the expected end margin
strut outwards-in, into a box's descendants, which we do by adding
LineClampEndMarginStrut
to the constraint space.Finally, when computing the clamp BFC offset for a box, we know the
ancestors' contribution to the bottom margin has already been
accounted for, so we only account for this box's margin contribution.
Similarly, when checking after layout whether a line or box is past
the clamp point, we compute its margin contribution. We do this by
computing the difference between the margin strut sum the parent
accounted for, and the one that we would get including the current
box's bottom margin.Bug: 40336192
Change-Id: I1e634a3aeaa071c3355277bdf00c3a44e6eca4a4
Reviewed-on: https://chromium-review.googlesource.com/5690174
WPT-Export-Revision: f7e75bd6a8214b8e7de346f72d1691f5da22a3ee
Assignee | ||
Updated•11 months ago
|
Assignee | ||
Comment 1•11 months ago
|
||
Assignee | ||
Comment 2•11 months ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 6 tests
Status Summary
Firefox
FAIL
: 6
Chrome
CRASH
: 3
FAIL
: 3
Safari
FAIL
: 6
Links
Details
New Tests That Don't Pass
- /css/css-overflow/line-clamp/line-clamp-auto-027.tentative.html [wpt.fyi]:
FAIL
(Chrome:CRASH
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-028.tentative.html [wpt.fyi]:
FAIL
(Chrome:CRASH
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-029.tentative.html [wpt.fyi]:
FAIL
(Chrome:CRASH
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-030.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-031.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
) - /css/css-overflow/line-clamp/line-clamp-auto-032.tentative.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:FAIL
)
Comment 4•11 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/453fd47f3a87
https://hg.mozilla.org/mozilla-central/rev/72037c59c997
Description
•