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

> What's exposed to browser extensions is up to each UA vendor. So each browser vendor can totally expose a new API that forces all shadow roots to be open, for example.

@rniwa If only there was a place to standardise such an API, or some action we could take to make the API unnecessary, to help reduce the burden for developers... It's also worth noting that none of the browsers (Chrome, Firefox, Edge) supporting Web Extensions have previously needed to expose *any* supplemental APIs for DOM access; the DOM has been generic, well-specified and powerful enough to read and modify the document in all the necessary ways.

> We need a refutable statement.

I'll give you four:
* With closed shadow roots, the DOM is no longer generic, well-specified and powerful enough to read and modify the document in the ways the page's scripts can as a whole.
* It is a waste of implementers' time and effort to each discover the limited access and develop a non-standard workaround.
* It is a waste of developers' time and effort to each discover the limited access, request a non-standard workaround and/or work out how it should be used.
* The protection that the component developer is given from the document's author are illusory.

> How could closed shadow trees cause problems for PhantomJS? Why are nodes.js and PhantomJS special with regards to closed shadow trees?

Scripts that use PhantomJS to interact with documents use the DOM to do so. Some developers will need to be able to read/manipulate content in shadow DOMs programmatically to make their applications work correctly with pages using them. They cannot do this without PhantomJS and node.js adding their own non-standard workarounds.

> Why would generic library need to access things inside a closed shadow tree?

Suppose a library wanted to provide an easy way to attach keyboard shortcuts to a page, except when the user is entering text into an input (`<input>`, `<textarea>` `<* contenteditable="true">`, etc.). This library will function incorrectly (ie. interpret input-generating keypresses as keyboard shortcuts) for any pages containing an input inside a closed shadow DOM.

(Full disclosure: this is what Vimium does, but browser-wide instead of for a single document.)

-- 
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-301123159

Received on Friday, 12 May 2017 16:27:12 UTC