Closed Bug 2092847 Opened 18 days ago Closed 14 days ago

[wpt-sync] Sync PR 64573 - [css-backgrounds] Initial value handling in the background shorthand

Categories

(Core :: Web Painting, 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 64573 into mozilla-central (this bug is closed when the sync is complete).

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

Javier Fernández García-Boente <jfernandez@igalia.com> wrote:

[css-backgrounds] Initial value handling in the background shorthand

The 'background' shorthand has two bugs, and they have to be fixed
together.

First, it stores the CSS-wide keyword 'initial' for every longhand the
author left out, so reading one back reports the keyword:

 el.style.background = 'none';
 el.style.backgroundAttachment;  // "initial", should be "scroll"

css-cascade-5 section 3 says a missing sub-property is assigned its
initial value, not the keyword that stands for it. css-backgrounds-3
section 2.10 says the same for this shorthand: it "first sets the
corresponding value of each of background-image ... to that property's
initial value". Every other engine reports "scroll".

Second, the serializer omits only the literal keyword, not values that
are equal to the initial value:

 el.style.background = 'repeat';
 el.style.background;  // "repeat", should be "none"

CSSOM says a component that can be omitted without changing the meaning
of the value must be omitted. See also crbug.com/40423296.

Fixing only the first bug would make "background: none" serialize as
"none 0% 0% / auto repeat scroll padding-box border-box transparent", so
this CL does both.

Bug: 40894424, 552675460, 40423296, 552689413,
Change-Id: Iae1e6b01252f3a6f2d9aa89e2236abe1c7f1404a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8301652
Commit-Queue: Javier Fernandez \<jfernandez@igalia.com>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1733797}

Component: web-platform-tests → Web Painting
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 4 subtests

Status Summary

Firefox

OK : 1
PASS: 4

Chrome

OK : 1
PASS: 3
FAIL: 1

Safari

OK : 1
PASS: 4

Links

GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b46a4d4d0372 https://hg.mozilla.org/integration/autoland/rev/c7e35c8024d6 [wpt PR 64573] - [css-backgrounds] Initial value handling in the background shorthand, a=testonly
Status: NEW → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.