Re: [csswg-drafts] [css-shadow-parts] confirm browser support

If Apple wants to *implement a subset for now*, that's fine, incremental building towards the full feature set is fine. But part forwarding is absolutely a necessary aspect of the eventual feature.

Without it, we have only two possible worlds:

1. You just plain can't style sub-components of your components. You're able to use ::part() on a component's parts, but have to continue to use custom properties to style sub-components. (AKA you either don't use sub-components at all, or all components continue to use custom properties as their primary styling mechanism, as maintaining *two* types of styling mechanisms is annoying.)

2. We let you chain ::part(), so you can access *all* of the sub-components of *every* component you're using. This is the same over-exposure of internal details that we're trying to prevent with Shadow DOM in the first place! It means that the outside world knows whether you've implemented some piece of your component yourself or via a sub-component (and thus you can't change this without risking breakage), and the outside world has full access to all of the parts of your sub-components (so your subcomponent can't change without risking breakage).


If we aim for world 2, with the idea that we'll add some way to restrict what sub-parts are exposed, congratulations, you've just reinvented part forwarding with a less convenient syntax (have to use `::part()::part()` now rather than just `::part()`).  If we aim for world 1, that's an obviously bad world that we don't want authors to land in.

-------

We can quibble over the details of part forwarding still; I'd be fine with removing *any* DOM API for it from this level, beyond basic `getAttribute()`/`setAttribute()` usage. But forwarding, itself, is an absolute necessity for a reasonable API for authors. If you disagree, please state which of the two above worlds you'd like for us to land in, or provide a plausible third possibility.

(There *were* plausible worlds without multiple shadow trees; trying to use that as an example doesn't work.)

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

Received on Friday, 28 September 2018 17:48:14 UTC