Closed Bug 2092789 Opened 18 days ago Closed 13 days ago

[wpt-sync] Sync PR 64611 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=319831

Categories

(Core :: Layout: Text and Fonts, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Tim Nguyen <ntim@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=319831

WebKit export from bug: [<!---->white-<!---->space-<!---->trim]<!----> Add to white-<!---->space shorthand syntax

<pre>
[white-space-trim] Add to white-space shorthand syntax

(This is based on Tim Nguyen initial PR)

The syntax for the white-space shorthand is:

normal | pre | pre-wrap | pre-line | <'white-space-collapse'> || <'text-wrap-mode'> || <'white-space-trim'>

See: <a href="https://drafts.csswg.org/css-text-4/#white-space-property">https://drafts.csswg.org/css-text-4/#white-space-property</a>

Add 'white-space-trim' as the third longhand of the 'white-space' shorthand. The
legacy single-keyword forms (normal / pre / pre-wrap / pre-line) map to
'white-space-trim: none' per the normative table in the spec, so they never combine
with a discard-* keyword. Serialization -- both of a declaration block
(ShorthandSerializer) and of the computed value (Style::Extractor) -- only collapses
to those legacy keywords when 'white-space-trim' is 'none'; otherwise it appends the
trim value and omits the other two longhands when they hold their initial value.

'white-space-trim' is gated on the CSSWhiteSpaceTrimEnabled setting while
'white-space' is not, so the shorthand parser gates only the consumption of the
discard-* keywords and always sets the 'white-space-trim' longhand. That keeps the
shorthand round-tripping when the setting is off, and matches how 'font' and
'font-variant' handle the settings-gated 'font-variant-emoji' longhand.

Editing copies 'white-space-trim' alongside the other two longhands. All three have
to travel together: a partial longhand set makes the 'white-space' shorthand
unserializable, so editing would start emitting 'white-space-collapse' /
'text-wrap-mode' where it used to emit 'white-space'. It is therefore listed with the
inheritable editing properties even though it is not an inherited property -- if only
the context style carries it, the white-space longhands never compare equal to the
context and editing wraps content in redundant spans. The context comparison in
removeStyleInContextNotOverridenByMatchedRules also compares values rather than
CSSValue identity, since 'white-space-trim' serializes to a list for any value other
than 'none'.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=319831">https://bugs.webkit.org/show_bug.cgi?id=319831</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/318486@main">https://commits.webkit.org/318486@main</a>
</pre>

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 1 tests and 96 subtests

Status Summary

Firefox

OK : 1
PASS: 52
FAIL: 44

Chrome

OK : 1
PASS: 52
FAIL: 44

Safari

OK : 1
PASS: 96

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /css/css-text/parsing/white-space-shorthand.html [wpt.fyi]
    • e.style['white-space'] = "discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-after" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-after': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-inner" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-inner': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "collapse wrap discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'collapse wrap discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "wrap collapse discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'wrap collapse discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-before collapse wrap" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-before collapse wrap': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "preserve discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'preserve discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-before preserve" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-before preserve': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "nowrap discard-after" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'nowrap discard-after': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-after nowrap" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-after nowrap': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "preserve nowrap discard-inner" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'preserve nowrap discard-inner': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-inner nowrap preserve" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-inner nowrap preserve': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-inner preserve nowrap" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-inner preserve nowrap': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-after discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-after discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "collapse wrap discard-after discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'collapse wrap discard-after discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-before discard-after discard-inner" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-before discard-after discard-inner': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-inner discard-after discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-inner discard-after discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-after discard-inner discard-before" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-after discard-inner discard-before': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "collapse wrap discard-before discard-after discard-inner" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'collapse wrap discard-before discard-after discard-inner': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-inner discard-before discard-after collapse wrap" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-inner discard-before discard-after collapse wrap': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "preserve nowrap discard-inner discard-before discard-after" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'preserve nowrap discard-inner discard-before discard-after': FAIL (Chrome: FAIL, Safari: PASS)
    • e.style['white-space'] = "discard-after discard-inner discard-before preserve nowrap" should set the property value: FAIL (Chrome: FAIL, Safari: PASS)
    • Property white-space value 'discard-after discard-inner discard-before preserve nowrap': FAIL (Chrome: FAIL, Safari: PASS)
Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.