You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-om][css-backgrounds] Serialization of background: none #8496
I guess this fits into the umbrella of #8155.
STP serializes as transparent because in WebKit/WebKit#9849@darinadler interpreted that <'background-color'> appears 1st in grammar order. It's not completely clear, but it seems to me that the 1st one is actually <bg-image>.
The reason you and I came to different conclusions, I suppose, is that background-color is the first item in the final item in the comma separated list of values, and bg-image is the first item in the non-final items. If there is only a single value and no comma, how does the grammar work, and make it valid without a comma, but bg-image counts as first? That’s where we didn’t understand it the same way.
The CSS Working Group just discussed [css-om][css-backgrounds] Serialization of `background: none` , and agreed to the following:
RESOLVED: Move color at the end of the final-bg-layer grammar, to make it serialize as `none`
The full IRC log of that discussion
<emilio> TabAtkins: question is how does `background: none` serialize. Using shortest serialization and grammar is unclear
<emilio> ... because if you only specify one layer it matches final-background-layer and image-layer
<emilio> ... and since color is the first in the final-background-layer safari they serialize transparent
<emilio> ... other browsers serialize none
<emilio> ... proposal is to move color to the end of final-bg-layer
<emilio> ... which makes it serialize as none
<emilio> fantasai: I think it's great because it moves color to the end
<emilio> ... which makes sense because it's at the bottom
<emilio> ... but that would be a change to how a color + image serializes, and I'm not sure that's Web-compatible
<emilio> RESOLVED: Move color at the end of the final-bg-layer grammar, to make it serialize as `none`
Not captured in the minutes - we're hoping this is web-compatible, since currently if you specify a color and an image, the color will serialize first.
Not captured in the minutes - we're hoping this is web-compatible, since currently if you specify a color and an image, the color will serialize first.
Not sure that’s quite right: The specification says that, but do any web browsers currently do that?
So this was initially pushed by me back then. Though I agree it makes sense to have the color at the end for the same reason @fantasai and @LeaVerou gave now and in the past.
@tabatkins Don't just edit and close issues on specs that aren't yours. This needs to go into the Changes list, for example, which you didn't remember to do.
Activity
Loirooriol commentedon Feb 24, 2023
I guess this fits into the umbrella of #8155.
STP serializes as
transparentbecause in WebKit/WebKit#9849 @darinadler interpreted that<'background-color'>appears 1st in grammar order. It's not completely clear, but it seems to me that the 1st one is actually<bg-image>.darinadler commentedon Feb 24, 2023
The reason you and I came to different conclusions, I suppose, is that
background-coloris the first item in the final item in the comma separated list of values, andbg-imageis the first item in the non-final items. If there is only a single value and no comma, how does the grammar work, and make it valid without a comma, butbg-imagecounts as first? That’s where we didn’t understand it the same way.Loirooriol commentedon Feb 24, 2023
Mm, looking at it again, I'm less sure about it :)
If
noneis expected I would change the grammar toIf
transparentis expected, I would add a note or something.gsnedders commentedon Feb 27, 2023
see also #418 more generally about
backgroundserialisationREGRESSION (STP 164): new failure in css/css-backgrounds/parsing/back…
css-meeting-bot commentedon Mar 8, 2023
The CSS Working Group just discussed
[css-om][css-backgrounds] Serialization of `background: none`, and agreed to the following:RESOLVED: Move color at the end of the final-bg-layer grammar, to make it serialize as `none`The full IRC log of that discussion
<emilio> TabAtkins: question is how does `background: none` serialize. Using shortest serialization and grammar is unclear<emilio> ... because if you only specify one layer it matches final-background-layer and image-layer
<emilio> ... and since color is the first in the final-background-layer safari they serialize transparent
<emilio> ... other browsers serialize none
<emilio> ... proposal is to move color to the end of final-bg-layer
<emilio> ... which makes it serialize as none
<emilio> fantasai: I think it's great because it moves color to the end
<emilio> ... which makes sense because it's at the bottom
<emilio> ... but that would be a change to how a color + image serializes, and I'm not sure that's Web-compatible <emilio> RESOLVED: Move color at the end of the final-bg-layer grammar, to make it serialize as `none`
tabatkins commentedon Mar 8, 2023
Not captured in the minutes - we're hoping this is web-compatible, since currently if you specify a color and an image, the color will serialize first.
darinadler commentedon Mar 8, 2023
Not sure that’s quite right: The specification says that, but do any web browsers currently do that?
Loirooriol commentedon Mar 8, 2023
About @fantasai's comment:
Gecko:
blue url("")Blink:
url("") blueWebKit:
url("") blue(orblue url("")between WebKit/WebKit@5d2cf87 and WebKit/WebKit@bec59bd)tabatkins commentedon Mar 8, 2023
Okay, Blink (and WK before this recent change) serializing color after makes me very confident it's web-compatible.
[css-backgrounds-3] Move <bg-color> to the end of the <final-bg-layer…
tabatkins commentedon Mar 9, 2023
k, edit in. Color is now last in the final layer, so a
noneserializes consistently in all layers asnone.SebastianZ commentedon Mar 9, 2023
Just to provide a little background why the color was put first in the final layer:
So this was initially pushed by me back then. Though I agree it makes sense to have the color at the end for the same reason @fantasai and @LeaVerou gave now and in the past.
Sebastian
fantasai commentedon Mar 14, 2023
@tabatkins Don't just edit and close issues on specs that aren't yours. This needs to go into the Changes list, for example, which you didn't remember to do.
[css-backgrounds-3] Update Changes #8496