stylo: Handle namespaces during parsing




CSS Parsing and Computation
3 months ago
2 months ago


(Reporter: manishearth, Unassigned)


(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)




3 months ago
We should parse namespaces into a namespace map and use it when parsing things like `attr()` (introduced in bug 1296477)


3 months ago
Blocks: 1243581, 1296477
Priority: -- → P2
attr() is not supported yet as far as I can tell. Nevertheless I looked into adding a &stylesheet::Namespaces field to style::parser::ParserContext. However I hit two difficulties:

* When parsing a value in CSSOM (for example setPropertyValue), the namespace map of the stylesheet should be used. In the Stylo/Gecko case, this requires passing a reference to it (or to the stylesheet) across the FFI boundary

* The value of declarations that contain var() functions is parsed during cascading, 
once the var() functions have been substituted.
  - I opened about which stylesheet’s namespace map to use
  - properties::UnparsedValue cannot have lifetime parameters, so the namespace map would need to be in an Arc. 
    Which in turn would probably need something like RwLock to synchronize mutation…

I decided not to shave these yaks today.

Comment 2

2 months ago
> attr() is not supported yet as far as I can tell.

Sure we do : . Only for `content:` though.
Never mind that part then, I must have grepped incorrectly.
You need to log in before you can comment on or make changes to this bug.