RE: Fallout of non-encapsulated shadow trees

From: Maciej Stachowiak <mjs@apple.com>

> Web Components as currently designed cannot explain the behavior of any built-in elements (except maybe those which can be explained with CSS alone).

Unfortunately this is a hard problem that nobody has even sketched a solution to.

>From what I remember, you were arguing for some kind of soft encapsulation, which could be broken by e.g. overwriting Object.getOwnPropertyDescriptor, window.Number, Node.prototype.getAttribute, or anything else potentially useful that someone would use in implementing their elements. (I think it was called "type X" encapsulation in various discussions; I do not remember what X was.) But soft encapsulation is just as useless for explaining the platform as no encapsulation at all.

True encapsulation, wherein each element gets some kind of isolated world in which to implement itself, is much harder. Blink-in-JS [1] accomplishes something along these lines, but does not leverage custom elements, shadow DOM, or the like, and essentially works by redirecting through a WebIDL binding layer. Perhaps we can draw inspiration from there.

[1]: https://docs.google.com/a/google.com/presentation/d/1XvZdAF29Fgn19GCjDhHhlsECJAfOR49tpUFWrbtQAwU/edit

Received on Tuesday, 1 July 2014 22:27:27 UTC