-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
style: Make numbers keep track of whether they were specified as calc(). #16144
Conversation
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. |
💔 Test failed - linux-rel-wpt |
@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. |
💔 Test failed - android |
☔ The latest upstream changes (presumably #16142) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors-servo r=heycam |
📌 Commit b88c0fd has been approved by |
@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 -->
💔 Test failed - linux-rel-wpt |
@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? |
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev |
|
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.
style: Re-introduce the -webkit- prefix for the order property. I accidentally removed it while converting "order" to a predefined type in #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.
Fixes #15960
This change is