-
Notifications
You must be signed in to change notification settings - Fork 284
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
Editorial: explain the possible primary interfaces for nodes #1279
Conversation
dom.bs
Outdated
@@ -2252,6 +2252,10 @@ can be used to explore this matter in more detail. | |||
{{ProcessingInstruction}}, or {{Comment}}. | |||
|
|||
<p>Objects that implement {{Text}} sometimes implement {{CDATASection}}. | |||
|
|||
<p>Thus, every [=node=]'s [=primary interface=] is one of: {{Attr}}, {{CDATASection}}, {{Comment}}, | |||
{{Document}}, {{DocumentFragment}}, {{DocumentType}}, {{Element}} or an inherited interface of it, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{Document}}, {{DocumentFragment}}, {{DocumentType}}, {{Element}} or an inherited interface of it, | |
{{Document}}, {{DocumentFragment}}, {{DocumentType}}, or {{Element}}; or an inherited interface of it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I'm not sure how this is correct. Why is ProcessingInstruction an inherited interface and Comment is not?
Also, why would ShadowRoot not be a primary interface? Isn't that the most derived? And I think both Text and CDATASection are primary interfaces as they are the most derived on the objects they occur on. Just when CDATASection is the primary interface, it's also an inherited interface of Text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change seems incorrect, and then your further comment seems to be based on confusion about what the spec text would say after that incorrect change.
I'll rephrase the original in another way. Every node's primary interface is one of:
- Attr
- CDATASection
- Comment
- Document
- DocumentFragment
- DocumentType
- Element
- HTMLElement
- HTMLHtmlElement
- ...
- ProcessingInstruction
- ShadowRoot
- Text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that makes sense. Can we put them in the same order as the document outline does? I think I generally try to be consistent about that node order throughout the document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
I was trying to check whether a switch statement was exhaustive and had to do a bit of mental juggling to get there. I thought I'd write out the results for future reference.
Preview | Diff