-
Notifications
You must be signed in to change notification settings - Fork 2
DOM Nodes
Trevor Rowbotham edited this page Jun 10, 2021
·
3 revisions
- Node
- NonElementParentNode
- ParentNode
- NonDocumentTypeChildNode
- ChildNode
- Slottable
- Document
- DOMImplementation
- DocumentType
- DocumentFragment
- ShadowRoot
- Element
- Attr
- CharacterData
- Text
- CDATASection
- ProcessingInstruction
- Comment
- AbstractRange
- StaticRange
- Range
- NodeIterator
- TreeWalker
- NodeFilter
- DOMTokenList
✔ = Implemented ❌ = Not Implemented
Feature | Status | Notes |
---|---|---|
nodeType | ✔ | |
nodeName | ✔ | |
baseURI | ✔ | |
isConnected | ✔ | |
ownerDocument | ✔ | |
getRootNode() | ✔ | |
parentNode | ✔ | |
parentElement | ✔ | |
hasChildNodes() | ✔ | |
firstChild | ✔ | |
lastChild | ✔ | |
previousSibling | ✔ | |
nextSibling | ✔ | |
nodeValue | ✔ | |
textContent | ✔ | |
normalize() | ✔ | |
cloneNode() | ✔ | |
isEqualNode() | ✔ | |
isSameNode() | ✔ | |
compareDocumentPosition() | ✔ | |
contains() | ✔ | |
lookupPrefix() | ✔ | |
lookupNamespaceURI() | ✔ | |
isDefaultNamespace() | ✔ | |
insertBefore() | ✔ | |
appendChild() | ✔ | |
replaceChild() | ✔ | |
removeChild() | ✔ |
Feature | Status | Notes |
---|---|---|
getElementById() | ✔ |
Feature | Status | Notes |
---|---|---|
children | ✔ | |
firstElementChild | ✔ | |
lastElementChild | ✔ | |
childElementCount | ✔ | |
prepend() | ✔ | |
append() | ✔ | |
replaceChildren() | ✔ | |
querySelector() | ❌ | |
querySelectorAll() | ❌ |
Feature | Status | Notes |
---|---|---|
previousElementSibling | ✔ | |
nextElementSibling | ✔ |
Feature | Status | Notes |
---|---|---|
before() | ✔ | |
after() | ✔ | |
replaceWith() | ✔ | |
remove() | ✔ |
Feature | Status | Notes |
---|---|---|
assignedSlot | ❌ |
extends Node
includes NonElementParentNode
includes ParentNode
Feature | Status | Notes |
---|---|---|
implementation | ✔ | |
URL | ✔ | |
documentURI | ✔ | |
compatMode | ✔ | |
characterSet | ✔ | |
charset | ✔ | |
inputEncoding | ✔ | |
contentType | ✔ | |
doctype | ✔ | |
documentElement | ✔ | |
getElementsByTagName() | ✔ | |
getElementsByTagNameNS() | ✔ | |
getElementsByClassName() | ✔ | |
createElement() | ✔ | Does not accept ElementCreationOptions |
createElementNS() | ✔ | Does not accept ElementCreationOptions |
createDocumentFragment() | ✔ | |
createTextNode() | ✔ | |
createCDATASection() | ✔ | |
createComment() | ✔ | |
createProcessingInstruction() | ✔ | |
importNode() | ✔ | |
adoptNode() | ✔ | |
createAttribute() | ✔ | |
createAttributeNS() | ✔ | |
createEvent() | ❌ | |
createRange() | ✔ | |
createNodeIterator() | ✔ | |
createTreeWalker() | ✔ |
Feature | Status | Notes |
---|---|---|
createDocumentType() | ✔ | |
createDocument() | ✔ | |
createHTMLDocument() | ✔ | |
hasFeature() | ❌ |
extends Node
includes ChildNode
Feature | Status | Notes |
---|---|---|
node | ✔ | |
publicId | ✔ | |
systemId | ✔ |
extends Node
includes NonElementParentNode
includes ParentNode
Feature | Status | Notes |
---|---|---|
constructor() | ❌ | Use Document.createDocumentFragment() instead |
extends DocumentFragment
Feature | Status | Notes |
---|---|---|
mode | ❌ | |
delegatesFocus | ❌ | |
slotAssignment | ❌ | |
host | ❌ | |
innerHTML | ❌ |
extends Node
includes Slottable
includes ParentNode
includes NonDocumentTypeChildNode
includes ChildNode
Feature | Status | Notes |
---|---|---|
namespaceURI | ✔ | |
prefix | ✔ | |
localName | ✔ | |
tagName | ✔ | |
id | ✔ | |
className | ✔ | |
classList | ✔ | |
slot | ❌ | |
attributes | ✔ | |
getAttributeNames() | ✔ | |
getAttribute() | ✔ | |
getAttributeNS() | ✔ | |
setAttribute() | ✔ | |
setAttributeNS() | ✔ | |
removeAttribute() | ✔ | |
removeAttributeNS() | ✔ | |
toggleAttribute() | ✔ | |
hasAttribute() | ✔ | |
hasAttributeNS() | ✔ | |
getAttributeNode() | ✔ | |
getAttributeNodeNS() | ✔ | |
setAttributeNode() | ✔ | |
setAttributeNodeNS() | ✔ | |
remoteAttributeNode() | ✔ | |
attachShadowRoot() | ❌ | |
shadowRoot | ❌ | |
closest() | ❌ | |
matches() | ❌ | |
getElementsByTagName() | ✔ | |
getElementsByTagNameNS() | ✔ | |
getElementsByClassName() | ✔ | |
insertAdjacentElement() | ✔ | |
insertAdjacentText() | ✔ | |
insertAdjacentHTML() | ✔ | |
innerHTML | ✔ | Setter does nothing on XML documents |
outerHTML | ✔ | Setter does nothing on XML documents |
extends Node
Feature | Status | Notes |
---|---|---|
namespaceURI | ✔ | |
prefix | ✔ | |
localName | ✔ | |
name | ✔ | |
value | ✔ | |
ownerElement | ✔ | |
specified | ❌ |
Note: All text is UTF-8, which means that any offsets should be specified in UTF-8 code points, rather than UTF-16 code units.
extends Node
includes NonDocumentTypeChildNode
includes ChildNode
Feature | Status | Notes |
---|---|---|
data | ✔ | |
length | ✔ | |
substringData() | ✔ | |
appendData() | ✔ | |
insertData() | ✔ | |
deleteData() | ✔ | |
replaceData() | ✔ |
extends CharacterData
includes Slottable
Feature | Status | Notes |
---|---|---|
constructor() | ❌ | Use Docuement.createTextNode() instead |
splitText() | ✔ | |
wholeText | ✔ |
extends Text
extends CharacterData
Feature | Status | Notes |
---|---|---|
target | ✔ |
extends CharacterData
Feature | Status | Notes |
---|---|---|
constructor() | ❌ | Use Document.createComment() instead |
Feature | Status | Notes |
---|---|---|
startContainer | ✔ | |
startOffset | ✔ | |
endContainer | ✔ | |
endOffset | ✔ | |
collapsed | ✔ |
extends AbstractRange
Feature | Status | Notes |
---|---|---|
constructor() | ❌ |
Also known as a live range.
extends AbstractRange
Feature | Status | Notes |
---|---|---|
constructor() | ❌ | Use Document.createRange() instead. |
commonAncestorContainer | ✔ | |
setStart() | ✔ | |
setEnd() | ✔ | |
setStartBefore() | ✔ | |
setStartAfter() | ✔ | |
setEndBefore() | ✔ | |
setEndAfter() | ✔ | |
collapse() | ✔ | |
selectNode() | ✔ | |
selectNodeContents() | ✔ | |
compareBoundaryPoints() | ✔ | |
deleteContents() | ✔ | |
extractContents() | ✔ | |
cloneContents() | ✔ | |
insertNode() | ✔ | |
surroundContents() | ✔ | |
cloneRange() | ✔ | |
detatch() | ✔ | |
isPointInRange() | ✔ | |
comparePoint() | ✔ | |
intersectsNode() | ✔ | |
stringifier | ✔ | |
createContextualFragment() | ✔ |
Feature | Status | Notes |
---|---|---|
root | ✔ | |
referenceNode | ✔ | |
pointerBeforeReferenceNode | ✔ | |
whatToShow | ✔ | |
filter | ✔ | |
nextNode() | ✔ | |
previousNode() | ✔ | |
detach() | ✔ |
Feature | Status | Notes |
---|---|---|
root | ✔ | |
whatToShow | ✔ | |
filter | ✔ | |
currentNode | ✔ | |
parentNode() | ✔ | |
firstChild() | ✔ | |
lastChild() | ✔ | |
previousSibling() | ✔ | |
nextSibling() | ✔ | |
previousNode() | ✔ | |
nextNode() | ✔ |
Feature | Status | Notes |
---|---|---|
acceptNode() | ✔ |
Feature | Status | Notes |
---|---|---|
length | ✔ | |
item() | ✔ | |
contains() | ✔ | |
add() | ✔ | |
remove() | ✔ | |
toggle() | ✔ | |
replace() | ✔ | |
supports() | ❌ | |
value | ✔ |