[webcomponents] Large custom element spec rewrite to implement some F2F decisions (#405)

So, I accidentally rewrote a lot of the spec. All I wanted to do was land @rniwa's algorithm from #403 in, but it turns out everything is connected to everything else, and some sections were just so tempting, and... well, a lot of changes happened ^_^.

View the end result at https://rawgit.com/w3c/webcomponents/construction/spec/custom/index.html

Not sure how much editorial review we want to do. This is a big improvement in terms of aligning with the F2F's results and moving toward clean patches onto DOM and HTML that we can move into those specs. It might be better to land it soon instead of making sure all the editorial stuff is perfect.

It would be good to get the concepts reviewed of course. @rniwa, @annevk, @travisleithead?

----

Notable changes:

- Implemented HTMLElement constructor using @rniwa's algorithm from #403.
- Rewrote element upgrading to use @rniwa's algorithm from #403, and incorporated it into the rest of the upgrading considerations.
- Got rid of the ability to extend SVGElement, thus allowing us to remove most mentions of namespaces from the spec.
- Removed createdCallback.
- Rewrote "registering elements":
  - Uses defineElement instead of registerElement
  - Preserves the constructor instead of grabbing the .prototype property and synthesizing a new constructor
  - No longer spread out over four separate algorithms plus registerElement; everything is now inline under defineElement
  - More precise about exactly how to get the custom element prototype and callbacks
- Rewrote createElement and createElementNS to be replacements instead of patches, and to call the author-supplied constructor.
- Removed the "All Algorithms in One Diagram" section since so many algorithms changed or were inlined into their callers.
- Removed the "Custom Elements and ECMAScript 6" section since it is very obsolete and does not reflect our current thinking.
- New and rewritten algorithms do not use the unorthodox INPUTS/OUTPUTS blocks, or capitalized variable names. This is kind of a nice marker of new vs. old content.

Notable things *not* substantially changed:

- Parser changes are not specced still, besides to say that they should construct the element using its constructor.
- Lifecycle callbacks were not changed, except for removing createdCallback.
- Type extensions were not removed (yet?); it seems better to have a modernized version of them that we atomically remove.
- Registries were not made available everywhere.

Closes #403. Closes #365. Closes #283. Closes #185. Closes #170. Closes #169. Closes #167. Closes #163. Closes #162. Closes #161. Closes #158. Closes #137 (modulo the fact that #165 is still open). Closes #134. Closes #133.
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/webcomponents/pull/405

-- Commit Summary --

  * Large custom element spec rewrite to implement some F2F decisions

-- File Changes --

    M spec/custom/W3CTRMANIFEST (1)
    D spec/custom/custom-elements-whole-world.svg (246)
    M spec/custom/index.html (642)

-- Patch Links --

https://github.com/w3c/webcomponents/pull/405.patch
https://github.com/w3c/webcomponents/pull/405.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/pull/405

Received on Tuesday, 1 March 2016 20:56:09 UTC