Contact emails
Spec
Summary
Allow developers to create a closed shadow tree, whose previous name is an User-Agent shadow tree.
Motivation
Blink has two kinds of shadow trees as follows:
1. Author shadow tree: A shadow tree which developers can create via element.createShadowRoot().
2. User-Agent shadow tree: A shadow tree which is internally used in blink to implement some of built-in elements, such as <video>, <details>/<summary>, <input> and so on.
In short, the difference between two shadow trees is:
- Developers can't access User-Agent shadow trees by any means. In contrast, developers can access Author shadow tree if they have an explicit intention to access.
I have an intent to implement and expose the API to developers so that they can create User-Agent shadow trees. One of the benefits is that developers can create a custom element which has completely (or nearly) equivalent behavior to built-in elements, if developers prefer such a behavior.
We've discussed pros and cons about "public vs private", "open vs closed" shadow trees many times in
public-...@w3c.org.
The conclusion of Web Apps f2f Meeting is: We agreed to add the closed mode to the spec. See
the meeting minutes (and search by "encapsulation").
To avoid confusion, an {Author/UserAgent} shadow tree was already renamed to an {Open/Closed} shadow tree
here.
Compatibility Risk
No, as long as we won't change the default. The default is open as of now.
Ongoing technical constraints
No
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
OWP launch tracking bug
Requesting approval to ship?
No.