Closed
Bug 1291187
Opened 8 years ago
Closed 5 years ago
getComputedStyle() of "flex-basis" should return "10%" if the style sets to "calc(0px + 10%)"
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla70
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: daisuke, Assigned: boris)
References
(Depends on 1 open bug, Blocks 1 open bug, )
Details
Attachments
(2 files)
I attach the test html.
For now, that returns "calc(0px + 10%)".
Comment 1•8 years ago
|
||
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.
Updated•8 years ago
|
Priority: -- → P3
Comment 2•7 years ago
|
||
(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[1] 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.
[1] https://drafts.csswg.org/css-values/#calc-serialize
Assignee | ||
Updated•5 years ago
|
Blocks: calc-issues
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
•
|
||
This bug should have been fixed, per the spec issue. However, it'd be better to add some tests in wpt.
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee: nobody → boris.chiou
Pushed by bchiou@mozilla.com:
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.
Comment 8•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox70:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Upstream PR merged
You need to log in
before you can comment on or make changes to this bug.
Description
•