Consider rewriting ::cue to use the same machinery as CSS shadow parts.
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: emilio, Unassigned, NeedInfo)
References
Details
Attachments
(2 files)
Right now, ::cue
is the only JS-implemented psuedo-element. But that's a weird set-up and causes us to have custom property hacks like the ones causing trouble in bug 1871540, and in general is a bit of rather weird code.
It seems like what the video controls code wants is effectively just ::part(cue)
or so. It should be possible to reuse all the part machinery and remove the special JS pseudo-element stuff.
The idea would be something like:
- Make the selector parser output
Part { is_pseudo: bool, parts: Box<[...]> }
- Change the "js implemented" flag to be "this pseudo is a part" flag
- So ::cue would effectively output Part { true, [cue] }
- Then check
is_pseudo == element.is_in_ua_shadow_tree()
in the selector-matching code to make::cue
match but::part(cue)
not and vice versa. - Maybe we need to tweak
GeckoElement::inheritance_parent
too.
But then effectively all the weird stuff goes away and videocontrols.js
just needs to add part=cue
to the relevant element.
Reporter | ||
Comment 1•11 months ago
|
||
Reporter | ||
Comment 2•11 months ago
|
||
Things to do here:
-
::part() doesn't work on UA sheets, so default styles don't quite work as
intended. -
We need to keep the pseudo association for property restrictions, but we
could do that better probably.
Depends on D197478
Description
•