-
Notifications
You must be signed in to change notification settings - Fork 717
[css-backgrounds] What is the serialization "background-position: top right 10px"? #6586
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
Comments
FWIW those tests were added in web-platform-tests/wpt#16867. I agree that this is underdefined. The calc() serialization in Gecko just comes from this line of code where we remove the keywords when going from specified -> computed value. |
The spec defines the computed value as “list, each item a pair of offsets (horizontal and vertical) from the top left origin each given as a computed The only way to serialize that would be as a pair of length, percentage or calc() values, possibly with the values 0, 0%, 50%, and 100% converted to equivalent keywords (and the question of whether to do so being independent of whether one, two, three, or four components were specified). |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> Topic: css-background-3<fantasai> github: https://github.com//issues/6586 <drott> chris: > @drott I see the PR on your fork repo but not the one on the csswg repo I'll turn it into a PR visible on the CSSWG repo. <fantasai> smfr: Spec allows specifying a corner and an offset from that corner <fantasai> smfr: spec doesn't specify <fantasai> smfr: WebKit serializes as inputted <fantasai> smfr: Gecko serializes calc() <drott> fantasai: we already did discuss this - that's the way the serialized value is the way it is. <drott> fantasai: you could possibly map the values of varying percentages to keywords. <fantasai> s/serialized/computed/ <drott> fantasai: it's said that it's a length/percentag value per axis. there's no way to distinguish if somebody specified calc() of a value <drott> fantasai: we had discussed this before: main concern would be: in the future we would have logical keywords <drott> fantasai: with that, the computed value for background-position would become more complicated <drott> fantasai: i don't have a strong opinion on it because of what we plan for in the future. <fantasai> fantasai: spec is clear, in the "computed value" line <emilio> I agree this falls from the "Computed Value" definition <fantasai> TabAtkins: Since it confused some people, maybe a note to highlight that this information is lost would be helpful <fantasai> smfr: I just wanted to follow link to where it's clear... <fantasai> TabAtkins: as a combination of lengths and percentages, you'd have to use calc() <fantasai> dbaron[m]: other principle is use most backwards-compatible syntax, and at least in Gecko calc() predated the background-position extended syntax <fantasai> astearns: Suggest closing issue by adding a note to css-backgrounds-3 and maybe also values and units <fantasai> smfr: wfm <fantasai> RESOLVED: Add a note <fantasai> astearns: no normative change, but we will explain why |
This was edited in 0742ad6 |
https://www.w3.org/TR/css-backgrounds-3/#background-position doesn't say how the edge-relative background position values serialize (like
background-position: top right 10px
).This is tested by css/css-backgrounds/parsing/background-position-x-computed.html and css/css-backgrounds/parsing/background-position-y-computed.html which in Gecko test that
right -10px
serializes ascalc(100% + 10px)
andbottom -10px
serializes ascalc(100% + 10px)
but the spec does not describe this.The text was updated successfully, but these errors were encountered: