Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should :defined match <x-foo> in browsing-context-less documents? #540

Closed
domenic opened this issue Aug 10, 2016 · 3 comments
Closed

Should :defined match <x-foo> in browsing-context-less documents? #540

domenic opened this issue Aug 10, 2016 · 3 comments
Assignees

Comments

@domenic
Copy link
Collaborator

domenic commented Aug 10, 2016

Originally https://bugs.chromium.org/p/chromium/issues/detail?id=635402

In documents without a browsing context, the whole custom elements machinery is offline. So <x-foo> is equivalent to <asdf>: both are never going to become customized. They are just simple unknown elements.

Currently step 7.3 of "create an element" recognizes this and does not mark <x-foo> as "undefined". So in such documents, :defined will match <x-foo>, even though in the main document with a browsing context, :defined will not match <x-foo>.

Probably nobody will encounter this in practice.

I think the spec makes sense as-is. But the consequences are a bit unintuitive. So if anyone has opinions on this let me know and we can certainly change the spec.

If nobody has opinions on this over the next couple of weeks I will close and leave things with the status quo.

@annevk
Copy link
Collaborator

annevk commented Aug 11, 2016

If we are ever going to offer custom elements in those contexts, I think we want to change this. Otherwise there's more potential for breakage when that time comes (because the default behavior flips).

@domenic
Copy link
Collaborator Author

domenic commented Aug 11, 2016

Hmm. I can't really see how we ever would, but that's a reasonable thing to be careful about, so we might as well fix this.

@domenic domenic self-assigned this Aug 11, 2016
@rniwa
Copy link
Collaborator

rniwa commented Aug 11, 2016

We can easily add an optional document argument to custom element constructor to support that.

domenic added a commit to whatwg/dom that referenced this issue Aug 12, 2016
This means in particular that they will not match :defined. Fixes WICG/webcomponents#540.
annevk pushed a commit to whatwg/dom that referenced this issue Aug 15, 2016
This means in particular that they will not match :defined. Fixes WICG/webcomponents#540.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants