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 22534 - Add the <content> element from Shadow DOM
Summary: Add the <content> 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 06:44 UTC by Michael[tm] Smith
Modified: 2013-07-03 21:56 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2013-07-02 06:44:44 UTC
The <content> element is part of the Shadow DOM feature/spec. The current spec for it seems fairly stable, and it's implemented in blink, and it has a patch (from wchen) for gecko awaiting review.

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

I don't know if it's practical/useful to actually try to define the element 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 element 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 element.

So here's an attempt at listing out just the essentials of the HTML 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 <content> element indicates an Shadow DOM "insertion point" to which the children of a "shadow host" are inserted into a "shadow tree". A "shadow host" is an element whose child contents are not rendered directly; instead an associated "shadow tree" is rendered in place of the element's child contents, with the <content> element being used to indicate where, in the shadow tree, to insert the original child contents of the shadow-host element.

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

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 insertion point that this <content> element defines

 - "select" attribute whose value is a set of comma-separated tokens, each of which must be a compound selector

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

HTMLContentElement interface, with "resetStyleInheritance" and "select" IDL attributes that reflect the content attributes, and a getDistributedNodes() method that returns a NodeList of the nodes that have been "distributed" into the insertion point that this element defines.

-----

The above is the minimum that I think the HTML spec could define for <content>, normatively referring to the Shadow DOM spec for the behavioral requirements.
Comment 1 Ian 'Hixie' Hickson 2013-07-03 21:56:04 UTC
Same reasoning as bug 22535.