Skip to content
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

Allow more valid use of calc expressions #7400

Merged
merged 1 commit into from Nov 2, 2015
Merged

Conversation

@dzbarsky
Copy link
Member

dzbarsky commented Aug 26, 2015

Review on Reviewable

@pcwalton
Copy link
Contributor

pcwalton commented Sep 1, 2015

@dzbarsky Is this ready for review?

@dzbarsky
Copy link
Member Author

dzbarsky commented Sep 1, 2015

Yes, it's good to go.

@jdm jdm mentioned this pull request Sep 1, 2015
@metajack
Copy link
Contributor

metajack commented Sep 1, 2015

@SimonSapin
Copy link
Member

SimonSapin commented Sep 1, 2015

Note that the first 19 commits of this are in #7185, which is good to go except that it needs to add support for the ch unit (which was added while the PR was waiting on my to review).

@SimonSapin
Copy link
Member

SimonSapin commented Sep 1, 2015

See also #7496.

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2015

The latest upstream changes (presumably #7496) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm jdm closed this Sep 2, 2015
@jdm jdm reopened this Sep 2, 2015
@dzbarsky dzbarsky force-pushed the dzbarsky:angle branch from e4cf2c7 to 23532ed Sep 5, 2015
@dzbarsky
Copy link
Member Author

dzbarsky commented Sep 5, 2015

Rebased this to apply cleanly.

@jdm
Copy link
Member

jdm commented Sep 5, 2015

Github disagrees.

@dzbarsky dzbarsky force-pushed the dzbarsky:angle branch from 23532ed to 5b30620 Sep 7, 2015
@dzbarsky
Copy link
Member Author

dzbarsky commented Sep 7, 2015

the var() stuff rotted this PR. Rebased again.

@frewsxcv
Copy link
Member

frewsxcv commented Sep 7, 2015

@dzbarsky In case you missed it, there's a style check failure:

./components/style/values.rs:1353: missing space after ,
@dzbarsky dzbarsky force-pushed the dzbarsky:angle branch from 5b30620 to 62238d9 Sep 7, 2015
@frewsxcv frewsxcv removed the S-needs-rebase label Sep 7, 2015
@SimonSapin
Copy link
Member

SimonSapin commented Sep 10, 2015

Reviewed 1 of 20 files at r1, 8 of 19 files at r2, 1 of 1 files at r3.
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful.


components/style/properties.mako.rs, line 1927 [r3] (raw file):
Please remove the outdated comment. (It used to explain why percentages were replaced with lengths at parse time.)


components/style/values.rs, line 210 [r3] (raw file):
It’s not great that this uses a Calc struct that has a percentage field while this Length type should not allow percentages, but I don’t have a good idea to suggest how to fix this without duplicating a lot of calc() code. What do you think?


components/style/values.rs, line 398 [r3] (raw file):
This accepts fractional numbers in the input and implicitly rounds them to integers, doesn’t it? See <integer> v.s. <number> in https://drafts.csswg.org/css-values/#calc-type-checking . I think this can be solved by adding an Integer variant to CalcUnit.


components/style/values.rs, line 447 [r3] (raw file):
Maybe rename this to CalcLengthOrPercentage?


components/style/values.rs, line 492 [r3] (raw file):
Change this to Ok(Token::Delim('/')) if expected_unit != CalcUnit::Integer => {. (See previous comment.)


Comments from the review on Reviewable.io

@eefriedman
Copy link
Contributor

eefriedman commented Oct 30, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Oct 30, 2015

Previous build results for android, gonk, linux-dev, mac-rel-wpt are reusable. Rebuilding only linux-rel, mac-dev-ref-unit, mac-rel-css...

@bors-servo
Copy link
Contributor

bors-servo commented Oct 30, 2015

💔 Test failed - mac-rel-css

@eefriedman
Copy link
Contributor

eefriedman commented Oct 30, 2015

I'm not sure exactly why, but /css21_dev/html4/font-146.htm is consistently failing.

@dzbarsky
Copy link
Member Author

dzbarsky commented Nov 2, 2015

The problem is the following declaration: div.test { font: 4em/-2em serif; background: red; color: yellow; }
The text in the div should not be visible, because the line-height is negative. Previously, servo didn't know how to parse 4em for the font-size, so the declaration would be ignored. We are now parsing that part, but are not yet handling the line-height, so the text shows up and the test breaks. We should fix font parsing, but this is follow-up fodder.

@eefriedman
Copy link
Contributor

eefriedman commented Nov 2, 2015

Fine; I'll r+ if you update the expected result.

@dzbarsky
Copy link
Member Author

dzbarsky commented Nov 2, 2015

Looks like I was wrong. The actual problem is that we lost the check for negative line heights...

@dzbarsky dzbarsky force-pushed the dzbarsky:angle branch from f57dd41 to dab3b47 Nov 2, 2015
@dzbarsky dzbarsky force-pushed the dzbarsky:angle branch from dab3b47 to 00980ea Nov 2, 2015
@SimonSapin
Copy link
Member

SimonSapin commented Nov 2, 2015

@bors-servo r=mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Nov 2, 2015

📌 Commit 00980ea has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Nov 2, 2015

Testing commit 00980ea with merge e72bd14...

bors-servo added a commit that referenced this pull request Nov 2, 2015
Allow more valid use of calc expressions



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7400)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 2, 2015

💔 Test failed - mac-rel-wpt

@SimonSapin
Copy link
Member

SimonSapin commented Nov 2, 2015

Unexpected Results
==================

/2dcontext/drawing-images-to-the-canvas/drawimage_canvas_12.html
----------------------------------------------------------------
TIMEOUT [Parent]

Sounds maybe unrelated?

@SimonSapin
Copy link
Member

SimonSapin commented Nov 2, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Nov 2, 2015

Previous build results for android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css are reusable. Rebuilding only mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Nov 2, 2015

@bors-servo bors-servo merged commit 00980ea into servo:master Nov 2, 2015
2 of 3 checks passed
2 of 3 checks passed
code-review/reviewable Review in progress: 4 of 9 files reviewed, 3 unresolved discussions
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

10 participants
You can’t perform that action at this time.