Re: [w3c/webcomponents] Provide a lightweight mechanism to add styles to a custom element (#468)

> Why is this needed / preferred vs. just matching simple selectors? 

Either idea (:element or *) is fine to Blink.

> I'm fine if the answer is "it's easier to implement because we reuse the :host infrastructure".

Blink doesn't have such a reason. We are ready to accept either idea.

> Does it effectively act as a <style> element in the first position in the list of the shadow host? That's what I understood, but I want to confirm.

Yes, that is the current proposal, from the perspective of determining its cascading order.

> That sounds slightly annoying to implement (with a Gecko hacker hat on), and somewhat confusing to reason about (if I add an !important :host rule in a shadow root it may or may not necessarily override the custom element style, depending on how we define specificity of :element and what not).

Good points. I think we overlooked this points. Yup, this can be a problem from some perspectives.

> Looks to me that it would be much easier to define as a cascade order right before the shadow root instead of reusing something it might conflict with...

I agree. Blink is okay to adding a cascading order because it would be much easier, if all of us can agree on that.

I've thought the current proposal is effectively same to adding a new cascading order (with an implementer hat on). I think Blink can implement this as if there was new cascading order, as long as there is no visible observer behavior difference.

However, as you mentioned, there could be an observable behavior change between them.
Thank you for pointing that out.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/468#issuecomment-407324752

Received on Tuesday, 24 July 2018 08:26:58 UTC