Closed Bug 1788582 Opened 3 years ago Closed 3 years ago

Move color to the beginning rather than the end of the last layer in background shorthand serialization

Categories

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

task

Tracking

()

RESOLVED INVALID

People

(Reporter: emilio, Unassigned)

References

Details

This would effectively undo bug 743392. We didn't do this in bug 1134171, but WebKit / Blink do it, and after checking the spec more carefully, <final-bg-layer> has the <background-color> before rather than after (https://drafts.csswg.org/css-backgrounds/#typedef-final-bg-layer), so I think WebKit and Blink follow the spec and we're wrong.

Connor, would you be interested in taking it? Otherwise I can, we should probably fix it in the same release as bug 1134171 to avoid changing behavior too many times.

Thanks!

Flags: needinfo?(connor.pearson)

Hey Emilio, I could pick this one up. Could you help me understand the issue though? My understanding is that Firefox already serializes <background-color> in the beginning, while Blink puts it at the end.

For example given the following snippet, Chrome prints url("/favicon.ico") white and Firefox (nightly) prints white url("/favicon.ico").

const el = document.createElement('div');
el.style = 'background: url(/favicon.ico) white;'; 
console.log(el.style.background);

Is there a case where <background-color> is not serialized first that we need to fix? Or should we move it to the end to match Chrome?

Thanks!

Flags: needinfo?(connor.pearson)

Err, d'oh, I think I just messed up our order vs. the other browsers', I needed a coffee :)

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.