This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22535 - Add the <shadow> element from Shadow DOM
Summary: Add the <shadow> element from Shadow DOM
Status: RESOLVED LATER
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://dvcs.w3.org/hg/webcomponents/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-02 08:22 UTC by Michael[tm] Smith
Modified: 2013-07-03 21:55 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2013-07-02 08:22:35 UTC
The <shadow> element is part of the Shadow DOM feature/spec. The current spec for it seems fairly stable, and it's implemented in blink, though not yet in gecko.

https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-element

I don't know if it's practical/useful to actually try to define the <shadow> and <content> elements in the HTML spec without also defining the entire Shadow DOM feature in the HTML spec too. But if it is practical, maybe just the essentials of the elements could be defined in HTML spec, and then the HTML spec could normatively reference the Shadow DOM spec for the requirements on the behavior on the elements.

So here's an attempt at listing out just the essentials of the <shadow> element that could be defined in the HTML spec (with normative references to terms in the Shadow DOM spec in quotation marks):

-----

High-level description:
The <shadow> element indicates an Shadow DOM "shadow insertion point" in a "shadow tree" into which a previously-applied shadow tree is inserted. (A "shadow tree" is DOM tree that's rendered in place of the child contents of a "shadow host" whose child contents are not rendered directly.)

https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#dfn-shadow-insertion-point
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html#multiple-shadow-subtrees

Contexts in which this element can be used: Where flow content is expected.
Content model: Transparent.

Content attributes:

 - boolean "resetstyleinheritance" attribute that indicates the state of the "reset-style-inheritance" flag for the Shadow DOM "shadow insertion point" that this <shadow> element defines

DOM Interface:
see https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#content-element)

HTMLShadowElement interface, with a "resetStyleInheritance" IDL attributes that reflects the content attribute, and an "olderShadowRoot" attribute that returns the "shadow tree" to render in place of the "shadow insertion point" that this <shadow> element defines.

-----

The above is the minimum that I think the HTML spec could define for <shadow>, normatively referring to the Shadow DOM spec for the behavioral requirements.
Comment 1 Ian 'Hixie' Hickson 2013-07-03 21:55:41 UTC
So I spoke with Dimitri about this and he said that for now, it makes sense to just leave it in the Web Components spec. In particular, this element only makes sense in a shadow tree definition, and those are never in straight HTML docs — the Web component spec can therefore just extend the content model explicitly for those docs that have shadow tree definitions.

This differs from <template> in that <template> is allowed anywhere in HTML docs, much like <script>.


I'm marking this LATER for now.