stylo: Handle namespaces during parsing

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
P2
normal
3 months ago
2 months ago

People

(Reporter: manishearth, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

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

Updated

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 https://github.com/w3c/csswg-drafts/issues/1163 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.
(Reporter)

Comment 2

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

Sure we do : https://hg.mozilla.org/mozilla-central/rev/fe16f2642746#l6.48 . 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.