Re: [csswg-drafts] [css-scoping] Handling global name-defining constructs in shadow trees (#1995)

Some other side effects of omitting some kind of an explicit (`scoped`) notation are:

It will be impossible to write an inline style declaration that refers to a variable that exists in an outer scope but is overridden in the scope of the element's shadow tree. I expect this to be extremely rare, and there exists an easy workaround of re-defining the outer variable with another name.

If the inline style declaration is always scoped to the shadow tree scope of the element, it will be impossible to write an inline style declaration on a slotted element that refers to a variable defined inside the shadow tree it is slotted into. This leads to a weird situation where if a slotted element is assigned a style from within the shadow tree (with some `::slotted()` CSS selector), and that style is copied verbatim to the element's inline style (say through the browser inspector), it will change in behaviour. Again, I expect this to be extremely rare.

---------------------

I agree with @rniwa that we should optimise for common usecases and scenarios first. The proposed model seems consistent from a developer's perspective, and most of the issues mentioned only arise when existing objects are modified imperatively by an external force. In those cases there is always an alternative more heavy-handed solution to solve the same problem, and I don't think we can get to a perfect level of consistency that includes all these edge scenarios without sacrificing ease of use (by introducing additional syntax).

-- 
GitHub Notification of comment by ruphin
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1995#issuecomment-484467704 using your GitHub account

Received on Thursday, 18 April 2019 11:38:29 UTC