Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstyle: Make numbers keep track of whether they were specified as calc(). #16144
Conversation
highfive
commented
Mar 26, 2017
|
Heads up! This PR modifies the following files:
|
|
r? @upsuper or @Manishearth or @heycam This is like a kinda big refactor, and prone to bitrot, so I'd appreciate fast review. |
|
@bors-servo try |
style: Make numbers keep track of whether they were specified as calc(). Fixes #15960 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16144) <!-- Reviewable:end -->
|
Note that Gecko fails the second test (it preserves the full expression), and Blink fails both (it has the same behavior as Servo without this patch). I believe we want to adopt this behavior, but if we want to keep Gecko's behavior I'd prefer to do it as a followup, given how big is this patch already. |
|
Servo's behavior is the correct one per https://drafts.csswg.org/css-values/#calc-serialize |
|
@bors-servo try |
style: Make numbers keep track of whether they were specified as calc(). Fixes #15960 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16144) <!-- Reviewable:end -->
|
See https://bugzilla.mozilla.org/show_bug.cgi?id=1350739 for more fun. |
|
|
|
@bors-servo try |
style: Make numbers keep track of whether they were specified as calc(). Fixes #15960 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16144) <!-- Reviewable:end -->
|
@MatsPalmgren mentioned in the bug linked above that he was aligning Firefox with Blink here for Also, note that this PR still doesn't fix Those would need also similar PRs, thought those would likely to be less intrusive because there are less properties abusing angles and time specified values. |
|
|
|
|
|
@bors-servo r=heycam |
|
|
|
@bors-servo p=1
|
style: Make numbers keep track of whether they were specified as calc(). Fixes #15960 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16144) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
style: Make numbers keep track of whether they were specified as calc(). Fixes #15960 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16144) <!-- Reviewable:end -->
|
I am not sure about this approach. according to https://drafts.csswg.org/css-values/#calc-type-checking:
So... if calc(1 + 20%) is a valid number, how can this pull request can handle it properly? |
|
|
|
Concretely:
So something like I'm not sure that answers your question, @stshine, but happy to think a bit more through it if you provide a concrete example :) |
I accidentally removed it while converting "order" to a predefined type in servo#16144.
|
Whoops, looks like you are right, I searched through css properties and yet to find a property that allows something like calc(1 + 10%) as a Sorry for the trouble :) |
I accidentally removed it while converting "order" to a predefined type in servo#16144.
emilio commentedMar 26, 2017
•
edited by larsbergstrom
Fixes #15960
This change is