Closed Bug 1425757 Opened 6 years ago Closed 6 years ago

Don't support a list of selectors in ::slotted yet


(Core :: CSS Parsing and Computation, enhancement, P1)






(Reporter: emilio, Assigned: emilio)




(1 file)

Other browsers don't, and that allows them to use the rule hash for fast selector-matching.
If others don't... we probably should make the spec match it, and maybe add notes for future extension...
Comment on attachment 8937359 [details]
Bug 1425757: Don't support a list of selectors in ::slotted yet.

::: servo/components/selectors/
(Diff revision 1)
>          assert!(parse("::slotted(div + bar)").is_err());
>          assert!(parse("::slotted(div) + foo").is_err());
>          assert!(parse("div ::slotted(div)").is_ok());
>          assert!(parse("div + slot::slotted(div)").is_ok());
>          assert!(parse("div + slot::slotted(").is_ok());
> -        assert!(parse("div + slot::slotted(.foo, bar, .baz)").is_ok());

Maybe changes to `assert!(parse(...).is_err());` and add a TODO here that if at some point we start supporting it again, we can simply flip the assertion here.

::: servo/components/style/
(Diff revision 1)
>              Bucket::LocalName {
>                  name: &,
>                  lower_name: &selector.lower_name,
>              }
>          }
> +        Component::Slotted(ref selector) => find_bucket(selector.iter()),

I'm a bit uncertain about this. So a rule with `::slotted()` may be put into a bucket which is either for the originating slot element, or the assigned element. Would that cause any trouble in selector matching?

This may be worth a bit more comment, I guess.
Attachment #8937359 - Flags: review+
Depends on: 1426516
Priority: -- → P1
Could you file an issue to relevant spec to propose a spec change given the implementation status of this among browsers as well as the fact that doing it makes it easier to optimize?
Flags: needinfo?(emilio)

(Also, this landed in
Closed: 6 years ago
Flags: needinfo?(emilio)
Resolution: --- → FIXED
Attachment #8937359 - Flags: review?(cam)
You need to log in before you can comment on or make changes to this bug.