W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2018

Re: [csswg-drafts] [CSS2] Used value of margin properties

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Sat, 17 Feb 2018 01:41:34 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-366405161-1518831693-sysbot+gh@w3.org>
> am I holding the specs wrong?

No, I agree with the way you're reading this.

> For percentage resolution and auto margin resolution, this seems to be what browsers do. 

A quick bit of testing seems to show that all browsers do convert percentages to pixels, but that there isn't interop on auto. Chrome/Safari/Edge gives out the expected number of px, but Firefox resolves auto to `0px` regardless of the actual size.

> However, nobody behaves according to spec in over-constrained situations

That does match my testing.


* Since we don't have full interop on the resolved value of `auto`, we probably have some degree of choice. There is partial interop, since nobody actually returns `auto` as a keyword and everybody returns pixels, so we probably have to keep that. There does seem to be a majority (in UA numbers and market share) in favor the true used value, so I'd favor keeping the spec as is treating the Firefox behavior as a bug.

* For the rest, there does seem to be agreement that what getComputedStyle returns is the computed value converted to pixels, not the used value. Given that we have interop, the spec is probably what should be fixed. But that's not consistent with the previous point, so I'd prefer if we could go the other way around, and make everybody match the spec.

* Have you looked into other properties, to see if they actually return the used value, or merely the computed value with percentages converted to lengths?

GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2328#issuecomment-366405161 using your GitHub account
Received on Saturday, 17 February 2018 01:41:40 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:24 UTC