Re: [w3c/webcomponents] Generic programs can't reliably use/manipulate documents via the DOM (#640)

> @rniwa how many examples do you want before you admit that your a priori opinion is possibly not correct?
>

The number of example doesn't matter as much as the content of examples.

> What is a valid argument in your opinion?

There must be a use case that can't be addressed in the presence of any closed shadow trees, which outweighs all the benefits closed shadow trees provide. But the existence of such a use case seems very unlikely at this point because:

 1. We don't have to use shadow trees when faced with those use cases
 2. We've had 3-4 years of continuous discussion on this matter and nobody has come up with such an example.

But I welcome anyone to prove me wrong.

> Is the Vimium example not obviously a valid example of an application? What about that application makes you think it does not require access to the shadow DOM?

No, because it's a browser extension. Each UA can expose whatever API to make closed shadow trees accessible to browser extensions. In fact, I've added a special API internal to Safari that enables such a feature should Safari team decide to add such a capability to its extension API. In general, browser extensions exist outside the realm of DOM and HTML standards; we don't encourage or discourage the existence of any feature or lack thereof in that space.

> Here is another example, albeit forward-looking: the Web standardization process has accepted polyfilling future functionality as a way to prove out the validity/value and appropriateness of a new extension. It is impossible to polyfill anything that would need access to all shadow DOMs if they are closed. This cannot be circumvented with user agent permissions.
>
> Example of a polyfill which will not be possible:
>
> Implementing a CSS4 :has() polyfill will not work in all the situations, in particular in combination with the >>> combinator.

Why would a web component needs to be able to use the polyfill included outside the shadow tree? Again, if this is the first party or collaborating component, then such a component can use either a convention to expose its shadow tree (e.g. `getShadowRoot()` method) or call some function in the polyfill to enable it in the shadow tree.

If the component was written by a third party or is otherwise non-collaborating, then such a component is unlikely to be expecting the existence of such a polyfill. In fact, the presence of such a polyfill may break or have unintended consequences on the component depending on what the polyfill is doing. So I'd argue that the fact a polyfill doesn't spill into each component's shadow tree is a feature, not a bug, of shadow DOM.

-- 
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/640#issuecomment-300604145

Received on Wednesday, 10 May 2017 20:34:15 UTC