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 upImplement CSS calc() #7156
Implement CSS calc() #7156
Comments
|
I am interested in this, but I've never done anything CSS related, how does that work in servo? Could anyone elaborate? |
|
The code that interprets the output of the CSS parser lives in http://mxr.mozilla.org/servo/source/components/style/ . Given |
|
OMG this is too horrifying |
|
IRC chat with @dzbarsky today:
|
|
|
Also implemented for LengthOrPercentageOrAuto, so it should work with most sizing properties except max-width and max-height. @paulrouget let me know if you need anything else for browser.html |
|
That was fast :) A typical use of calc in browser.html: Apparently, supporting |
|
I added support for viewport relative and font relative units, and also rewrote the parser so your typical use should now work :) |
|
@dzbarsky your branch doesn't compile:
|
|
@paulrouget Sorry, made a list minute change and didn't bother compiling. It builds now, but you'll probably need to force pull. |
|
@dzbarsky It looks to work pretty well. What would it take to land that? |
|
#7185 is in my review queue |
Implement CSS3 Calc Doesn't work for font-size and I need to investigate how it should work for units that aren't lengths, but what I have so far should be ok. r? @SimonSapin Fixes #7156. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7185) <!-- Reviewable:end -->
https://drafts.csswg.org/css-values/#calc-notation