-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cssom] Define serialization for background shorthand #418
Comments
cc @SimonSapin |
Agenda+ to ask which level of css-backgrounds this goes into so that I can triage appropriately. |
The Working Group just discussed
The full IRC log of that discussion<dael> Topic: Define serialization for background shorthand<dael> github: https://github.com//issues/418 <dael> fantasai: Defining serialization when splitting BG into multi long hands. Q is do we tackle in L3 or is L4 okay? <dael> fantasai: Is it really important to converge now or are people happy to defer? <dael> Rossen_: I'll piggyback on tantek point for use cases as well as ask if there are any impl that are currently seeing interop issues b/c of this and in any urgency to change their serialization. <dael> Rossen_: I'm hearing silence which I am taking as no interest or use cases. <dael> Rossen_: Obj to postponing this until there's further evidence of use cases and move this to L4 if there is evidence? <tantek> +1 to at least postpone to L4, and note explicitly no use-cases <florian> tantek: I agree, and even more so once we add the multiple borders we've resolved on, you even do explicit inset/outset at subpixel level on retina screens. <dael> RESOLVED: postpone this until there's further evidence of use cases and move this to L4 if there is evidence |
So, the css-backgrounds spec currently does not include the truncation/elongation of value lists as part of the process of computing values. So the computed value--the value that is used for inheritance--definitely is the length specified per spec. As for the output of the CSSOM APIs, if we normalize the list lengths, then roundtripping a value gives different behavior than its initial declaration.
I don't know enough about CSSOM to answer this question. So we have several options here:
I don't know what's the best option. @dbaron ? |
More observations of browser behavior: 'background' syntax is specified as
However, browsers do not respect the above serialization order - test page Edge serializes inline style using
Firefox serializes inline style using
Blink and WebKit serialize inline style using
Edge and Firefox serialize computed style as empty string. Blink serializes computed style using
WebKit serializes computed style by interleaving information from the different layers. |
Serialization of the CSS property 'background' varies across browsers. There is an open spec issue: w3c/csswg-drafts#418 Until the issue is resolved, we accept a variety of serializations.
This returns
""
on Firefox and"url("a") no-repeat, url("b") no-repeat, no-repeat"
on Chrome.This returns
""
on Firefox and"url("a") no-repeat, url("b") repeat, url("c")"
on Chrome.In case the number of values set is the same, Firefox does return a value:
(
"url("a") no-repeat scroll 0% 0%, url("b") repeat scroll 0% 0%, transparent url("c") no-repeat scroll 0% 0%"
on Firefox,"url("a") no-repeat, url("b") repeat, url("c") no-repeat"
on Chrome)Firefox seems to only serialize when all set longhands are of the same length (and when it does, it serializes to all default values). Chrome always serializes, and just prints out whatever was set.
This should probably be specced. Important questions to answer:
background-image
longhand?background-image
?The text was updated successfully, but these errors were encountered: