Closed Bug 1291187 Opened 7 years ago Closed 4 years ago
Computed Style() of "flex-basis" should return "10%" if the style sets to "calc(0px + 10%)"
I attach the test html. For now, that returns "calc(0px + 10%)".
Just a few notes, the spec doesn't actually say this but this is what Chrome does and it seems sensible to spec. At the moment we seem to do: calc(300px + 0%) -> 300px BUT calc(0px + 10%) -> calc(0px + 10%) I'm not sure what the reasoning for this is (I looked up the changeset and bug and there was no explanation) but it seems like we should either always simplify or never.
(In reply to Brian Birtles (:birtles) from comment #1) > Just a few notes, the spec doesn't actually say this but this is what Chrome > does and it seems sensible to spec. > > At the moment we seem to do: > > calc(300px + 0%) -> 300px > BUT > calc(0px + 10%) -> calc(0px + 10%) There is actually some spec text for this although it as marked as being "under discussion". As it currently stands it would suggest we preserve zero values so that, `the calc() doesn’t suddenly "change shape" in the middle of a transition when one of the values happens to have a zero value temporarily.' I don't really understand the concern there but in any case, Gecko's behavior doesn't match that either so something will need to change here.  https://drafts.csswg.org/css-values/#calc-serialize
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/a5d8c96d2eb7 Add tests for testing the computed values of flex-basis. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/18129 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.