Closed
Labels
A-content/cssInteracting with CSS from web content (parsing, serializing, introspection)B-interesting-projectRepresents work that is expected to be interesting in some fashionC-assignedThere is someone working on resolving the issue
Description
Metadata
Metadata
Assignees
Labels
A-content/cssInteracting with CSS from web content (parsing, serializing, introspection)B-interesting-projectRepresents work that is expected to be interesting in some fashionC-assignedThere is someone working on resolving the issue
Activity
cuzbog commentedon Aug 11, 2015
I am interested in this, but I've never done anything CSS related, how does that work in servo? Could anyone elaborate?
jdm commentedon Aug 11, 2015
The code that interprets the output of the CSS parser lives in http://mxr.mozilla.org/servo/source/components/style/ . Given
It can be used wherever <length>, <frequency>, <angle>, <time>, <number>, or <integer> values are allowedfrom the spec, that will likely mean modifying lots of methods for parsing particular value types (like Angle::parse, for example). There will also need to be new code that parses acalcfunction when a Function token is encountered in these places (https://github.com/servo/rust-cssparser/blob/master/src/tokenizer.rs#L120). @SimonSapin probably has further ideas.cuzbog commentedon Aug 11, 2015
OMG this is too horrifying
SimonSapin commentedon Aug 11, 2015
IRC chat with @dzbarsky today:
dzbarsky commentedon Aug 12, 2015
https://github.com/dzbarsky/servo/tree/calc
dzbarsky commentedon Aug 12, 2015
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
paulrouget commentedon Aug 12, 2015
That was fast :)
A typical use of calc in browser.html:
calc(100vw - 10px).Apparently, supporting
vwandvhwon't be part of the first implementation. We can work around that though.dzbarsky commentedon Aug 12, 2015
I added support for viewport relative and font relative units, and also rewrote the parser so your typical use should now work :)
paulrouget commentedon Aug 18, 2015
@dzbarsky your branch doesn't compile:
dzbarsky commentedon Aug 18, 2015
@paulrouget Sorry, made a list minute change and didn't bother compiling. It builds now, but you'll probably need to force pull.
paulrouget commentedon Aug 19, 2015
@dzbarsky It looks to work pretty well. What would it take to land that?
SimonSapin commentedon Aug 19, 2015
#7185 is in my review queue
Auto merge of #7185 - dzbarsky:calc, r=SimonSapin