Re: [w3c/webcomponents] Note about "custom" is misleading (#461)

Survey of current spec:

- Defined flag is only used by :defined.
- Custom flag is used by mutation algorithms. It is essentially "are there potential callbacks to call".

How these flags get manipulated:

- Failure to create an element during parsing (e.g. throwing constructor) => defined, un-custom
- Successful upgrade => defined, custom
- Create an element with a (valid) type extension: undefined, un-custom, then sync or async upgrade causes defined, custom
- Create an custom tag element: undefined, un-custom, then successful constructor or upgrade causes defined, custom
- Create a non-custom element: un-custom, un-defined if a valid custom element name, defined otherwise

Can you be custom but not defined? no.

Can you be defined but not custom? Yes:
 - Failed to create an element during parsing (e.g. `<x-foo>` where `XFoo` throws).
 - Not a valid custom element name, no `is=""` (e.g. just `<p>`).

---

I'm going to make two changes:

- consolidate to "custom element state" which is one of "undefined", "uncustomized", or "customized". "Defined elements" are elements in either "uncustomized" or "customized" state. "Custom elements" are elements in the "customized" state.
- Remove the special case that failing to create an element during parsing makes you defined but not custom. I think any `:defined` selectors should probably apply to such cases just fine.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/461#issuecomment-205434957

Received on Monday, 4 April 2016 18:26:13 UTC