Define <slot>
There's two parts to this: definition of the element and parsing of the element.
Definition of the element can go in section 4.12 Scripting, since the slot element requires scripting to work, at least at this point. Maybe later with declarative shadow trees it can move to a shadow tree section or some such.
Parsing of the element: https://github.com/w3c/webcomponents/issues/59 proposes it is parsed like the template element.
@rniwa suggests there that slot elements should probably not work in the head element. https://dom.spec.whatwg.org/#dom-element-attachshadow is restricted to elements that can only appear in the body element, but perhaps it's okay for the parser to be more generic? I don't have a strong feeling here.
template elements also reset the form pointer. I'm not sure if that's applicable here. slot elements obviously do not share the bit with template elements where the children get inserted into a different tree.
Also, what is a little problematic is that there's not many people familiar with the HTML parser. @hsivonen @Hixie @abarth, thoughts?
I will try to write a PR of sorts.
Also paging @hayatoito @dglazkov @smaug---- for general Shadow DOM feedback.
Definition of the element can go in section 4.12 Scripting, since the slot element requires scripting to work, at least at this point. Maybe later with declarative shadow trees it can move to a shadow tree section or some such.
Minor point: We can have <slot> without attachShadow. <slot> can live in a node tree which is not a shadow tree. Though it does not make much sense in practical, it can happen.
Well, I have never heard of a slot element in HTML5, and a quick look at the pages in W3 show that's not there:https://www.w3.org/TR/html-markup/slot.html i.e.: 404What is the purpose of this unknown element?
The Shadow DOM spec defines the slot elements.
- http://w3c.github.io/webcomponents/spec/shadow/#slots
- http://w3c.github.io/webcomponents/spec/shadow/#the-slot-element
We are upstreaming Shadow DOM into DOM/HTML Standard.
WIP: https://github.com/whatwg/html/commit/b7d325198e5f81d41f185f0ba50b23976abdc579
TODO:
- Content model stuff is largely a sketch, I'm not sure how it should work yet
- Rendering needs to be defined: https://github.com/w3c/webcomponents/issues/452
- Parsing needs to be defined: https://github.com/w3c/webcomponents/issues/59#issuecomment-199778881
- API needs to be defined, awaiting renaming suggestions: https://github.com/w3c/webcomponents/issues/451