diff --git a/dom.bs b/dom.bs index 634f1d585..dd66adb0a 100644 --- a/dom.bs +++ b/dom.bs @@ -744,10 +744,19 @@ steps:
  • For each tuple in context object's path: +

      +
    1. +

      If currentTarget is a {{Window}} object, then: -

      1. If currentTarget is a node and tuple's item is not - closed-shadow-hidden from currentTarget, or currentTarget is not a - node, then append tuple's item to composedPath.

      +
      1. If tuple's item is not a node, or tuple's + item is not closed-shadow-hidden from tuple's item's + shadow-including root, then append tuple's item to + composedPath.

      + +
    2. Otherwise if currentTarget is a node and tuple's item + is not closed-shadow-hidden from currentTarget, or currentTarget is + not a node, then append tuple's item to composedPath. +

  • Return composedPath. diff --git a/dom.html b/dom.html index 85318c3db..254b509f5 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@

    DOM

    -

    Living Standard — Last Updated

    +

    Living Standard — Last Updated

    @@ -419,11 +419,11 @@

    3. 3.1. Introduction to "DOM Events"

    Throughout the web platform events are dispatched to objects to signal an occurrence, such as network activity or user interaction. These objects implement the EventTarget interface and can therefore add event listeners to observe events by calling addEventListener():

    -
    obj.addEventListener("load", imgFetched)
    +
    obj.addEventListener("load", imgFetched)
     
    -function imgFetched(ev) {
    -  // great success
    -  
    +function imgFetched(ev) {
    +  // great success
    +}
     

    Event listeners can be removed @@ -434,12 +434,12 @@

    event was dispatched (obj above).

    Now while typically events are dispatched by the user agent as the result of user interaction or the completion of some task, applications can dispatch events themselves, commonly known as synthetic events:

    -
    // add an appropriate event listener
    -obj.addEventListener("cat", function(e) { process(e.detail) })
    +
    // add an appropriate event listener
    +obj.addEventListener("cat", function(e) { process(e.detail) })
     
    -// create and dispatch the event
    -var event = new CustomEvent("cat", {"detail":{"hazcheeseburger":true}})
    -obj.dispatchEvent(event)
    +// create and dispatch the event
    +var event = new CustomEvent("cat", {"detail":{"hazcheeseburger":true}})
    +obj.dispatchEvent(event)
     

    Apart from signaling, events are sometimes also used to let an application control what happens next in an @@ -448,9 +448,9 @@

    events dispatched by the application (synthetic events) can make use of the return value of the dispatchEvent() method:

    -
    if(obj.dispatchEvent(event)) {
    -  // event was not canceled, time for some magic
    -  
    +
    if(obj.dispatchEvent(event)) {
    +  // event was not canceled, time for some magic
    +}
     

    When an event is dispatched to an object that participates in a tree (e.g. an element), it can reach event listeners on that object’s ancestors too. First all object’s ancestor event listeners whose capture variable is set to true are invoked, in tree order. Second, object’s own event listeners are invoked. And @@ -459,23 +459,23 @@

    tree order.

    Lets look at an example of how events work in a tree:

    <!doctype html>
    -<html>
    - <head>
    -  <title>Boring example</title>
    - </head>
    - <body>
    -  <p>Hello <span id=x>world</span>!</p>
    -  <script>
    -   function test(e) {
    -     debug(e.target, e.currentTarget, e.eventPhase)
    +<html>
    + <head>
    +  <title>Boring example</title>
    + </head>
    + <body>
    +  <p>Hello <span id=x>world</span>!</p>
    +  <script>
    +   function test(e) {
    +     debug(e.target, e.currentTarget, e.eventPhase)
        }
    -   document.addEventListener("hey", test, {capture: true})
    -   document.body.addEventListener("hey", test)
    -   var ev = new Event("hey", {bubbles:true})
    -   document.getElementById("x").dispatchEvent(ev)
    -  </script>
    - </body>
    -</html>
    +   document.addEventListener("hey", test, {capture: true})
    +   document.body.addEventListener("hey", test)
    +   var ev = new Event("hey", {bubbles:true})
    +   document.getElementById("x").dispatchEvent(ev)
    +  </script>
    + </body>
    +</html>
     

    The debug function will be invoked twice. Each time the event’s target attribute value will be the span element. The first time currentTarget attribute’s @@ -486,7 +486,7 @@

    AT_TARGET.

    3.2. Interface Event

    [Constructor(DOMString type, optional EventInit eventInitDict),
    - Exposed=(Window,Worker)]
    + Exposed=(Window,Worker)]
     interface Event {
       readonly attribute DOMString type;
       readonly attribute EventTarget? target;
    @@ -508,7 +508,7 @@ 

    readonly attribute boolean defaultPrevented; readonly attribute boolean composed; - [Unforgeable] readonly attribute boolean isTrusted; + [Unforgeable] readonly attribute boolean isTrusted; readonly attribute DOMTimeStamp timeStamp; void initEvent(DOMString type, boolean bubbles, boolean cancelable); // historical @@ -592,7 +592,14 @@

    context object’s path:

    1. -

      If currentTarget is a node and tuple’s item is not closed-shadow-hidden from currentTarget, or currentTarget is not a node, then append tuple’s item to composedPath.

      +

      If currentTarget is a Window object, then:

      +
        +
      1. +

        If tuple’s item is not a node, or tuple’s item is not closed-shadow-hidden from tuple’s item’s shadow-including root, then append tuple’s item to composedPath.

        +
      +
    2. +

      Otherwise if currentTarget is a node and tuple’s item is not closed-shadow-hidden from currentTarget, or currentTarget is + not a node, then append tuple’s item to composedPath.

  • Return composedPath.

    @@ -674,7 +681,7 @@

    composed. It has to be supported for legacy content.

    3.3. Interface CustomEvent

    [Constructor(DOMString type, optional CustomEventInit eventInitDict),
    - Exposed=(Window,Worker)]
    + Exposed=(Window,Worker)]
     interface CustomEvent : Event {
       readonly attribute any detail;
     
    @@ -729,7 +736,7 @@ 

    Event interface that have such a method only have it for historical reasons.

    3.6. Interface EventTarget

    -
    [Exposed=(Window,Worker)]
    +
    [Exposed=(Window,Worker)]
     interface EventTarget {
       void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options);
       void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
    @@ -816,7 +823,7 @@ 

    The addEventListener(type, callback, options) method, when invoked, must run these steps:

    1. -

      If context object’s relevant global object is a ServiceWorkerGlobalScope object and its associated service worker’s script resource’s has ever been evaluated flag is set, then throw a TypeError. [SERVICE-WORKERS]

      +

      If context object’s relevant global object is a ServiceWorkerGlobalScope object and its associated service worker’s script resource’s has ever been evaluated flag is set, then throw a TypeError. [SERVICE-WORKERS]

      To optimize storing the event types allowed for the service worker and to avoid non-deterministic changes to the event listeners, invocation of the method is allowed only during the very first evaluation of the service worker script.

      @@ -831,7 +838,7 @@

      The removeEventListener(type, callback, options) method, when invoked, must, run these steps

      1. -

        If context object’s relevant global object is a ServiceWorkerGlobalScope object and its associated service worker’s script resource’s has ever been evaluated flag is set, then throw a TypeError. [SERVICE-WORKERS]

        +

        If context object’s relevant global object is a ServiceWorkerGlobalScope object and its associated service worker’s script resource’s has ever been evaluated flag is set, then throw a TypeError. [SERVICE-WORKERS]

      2. Let capture be the result of flattening options.

      3. @@ -1008,7 +1015,7 @@

        If listener’s passive is true, set event’s in passive listener flag.

      4. -

        Call a user object’s operation with listener’s callback, +

        Call a user object’s operation with listener’s callback, "handleEvent", a list of arguments consisting of event, and event’s currentTarget attribute value as the callback this value. If this throws an exception, report the exception.

      5. @@ -1047,10 +1054,10 @@

        Each such document is represented as a node tree. Some of the nodes in a tree can have children, while others are always leaves.

        To illustrate, consider this HTML document:

        <!DOCTYPE html>
        -<html class=e>
        - <head><title>Aliens?</title></head>
        - <body>Why yes.</body>
        -</html>
        +<html class=e>
        + <head><title>Aliens?</title></head>
        + <body>Why yes.</body>
        +</html>
         

        It is represented as follows:

      -
      [NoInterfaceObject,
      - Exposed=Window]
      +
      [NoInterfaceObject,
      + Exposed=Window]
       interface ParentNode {
      -  [SameObject] readonly attribute HTMLCollection children;
      +  [SameObject] readonly attribute HTMLCollection children;
         readonly attribute Element? firstElementChild;
         readonly attribute Element? lastElementChild;
         readonly attribute unsigned long childElementCount;
       
      -  [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes);
      -  [CEReactions, Unscopable] void append((Node or DOMString)... nodes);
      +  [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes);
      +  [CEReactions, Unscopable] void append((Node or DOMString)... nodes);
       
         Element? querySelector(DOMString selectors);
      -  [NewObject] NodeList querySelectorAll(DOMString selectors);
      +  [NewObject] NodeList querySelectorAll(DOMString selectors);
       };
       Document implements ParentNode;
       DocumentFragment implements ParentNode;
      @@ -1612,8 +1619,8 @@ 

      The querySelectorAll(selectors) method, when invoked, must return the static result of running scope-match a selectors string selectors against context object.

      4.2.7. Mixin NonDocumentTypeChildNode

      Web compatibility prevents the previousElementSibling and nextElementSibling attributes from being exposed on doctypes (and therefore on ChildNode).

      -
      [NoInterfaceObject,
      - Exposed=Window]
      +
      [NoInterfaceObject,
      + Exposed=Window]
       interface NonDocumentTypeChildNode {
         readonly attribute Element? previousElementSibling;
         readonly attribute Element? nextElementSibling;
      @@ -1634,13 +1641,13 @@ 

      4.2.8. Mixin ChildNode

      -
      [NoInterfaceObject,
      - Exposed=Window]
      +
      [NoInterfaceObject,
      + Exposed=Window]
       interface ChildNode {
      -  [CEReactions, Unscopable] void before((Node or DOMString)... nodes);
      -  [CEReactions, Unscopable] void after((Node or DOMString)... nodes);
      -  [CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes);
      -  [CEReactions, Unscopable] void remove();
      +  [CEReactions, Unscopable] void before((Node or DOMString)... nodes);
      +  [CEReactions, Unscopable] void after((Node or DOMString)... nodes);
      +  [CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes);
      +  [CEReactions, Unscopable] void remove();
       };
       DocumentType implements ChildNode;
       Element implements ChildNode;
      @@ -1721,8 +1728,8 @@ 

      Remove the context object from context object’s parent.

    4.2.9. Mixin: Slotable

    -
    [NoInterfaceObject,
    - Exposed=Window]
    +
    [NoInterfaceObject,
    + Exposed=Window]
     interface Slotable {
       readonly attribute HTMLSlotElement? assignedSlot;
     };
    @@ -1745,7 +1752,7 @@ 

    collection must be sorted in tree order.

    4.2.10.1. Interface NodeList

    A NodeList object is a collection of nodes.

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface NodeList {
       getter Node? item(unsigned long index);
       readonly attribute unsigned long length;
    @@ -1769,7 +1776,7 @@ 

  • 4.2.10.2. Interface HTMLCollection
    -
    [Exposed=Window, LegacyUnenumerableNamedProperties]
    +
    [Exposed=Window, LegacyUnenumerableNamedProperties]
     interface HTMLCollection {
       readonly attribute unsigned long length;
       getter Element? item(unsigned long index);
    @@ -2014,12 +2021,12 @@ 

    <
  • Queue a mutation observer compound microtask.

    4.3.3. Interface MutationRecord

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface MutationRecord {
       readonly attribute DOMString type;
    -  [SameObject] readonly attribute Node target;
    -  [SameObject] readonly attribute NodeList addedNodes;
    -  [SameObject] readonly attribute NodeList removedNodes;
    +  [SameObject] readonly attribute Node target;
    +  [SameObject] readonly attribute NodeList addedNodes;
    +  [SameObject] readonly attribute NodeList removedNodes;
       readonly attribute Node? previousSibling;
       readonly attribute Node? nextSibling;
       readonly attribute DOMString? attributeName;
    @@ -2072,7 +2079,7 @@ 

    Registered observers in a node’s list of registered observers have a weak reference to the node.

    4.4. Interface Node

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface Node : EventTarget {
       const unsigned short ELEMENT_NODE = 1;
       const unsigned short ATTRIBUTE_NODE = 2;
    @@ -2097,7 +2104,7 @@ 

    readonly attribute Node? parentNode; readonly attribute Element? parentElement; boolean hasChildNodes(); - [SameObject] readonly attribute NodeList childNodes; + [SameObject] readonly attribute NodeList childNodes; readonly attribute Node? firstChild; readonly attribute Node? lastChild; readonly attribute Node? previousSibling; @@ -2107,7 +2114,7 @@

    CEReactions] attribute DOMString? textContent; [CEReactions] void normalize(); - [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); + [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); boolean isEqualNode(Node? otherNode); boolean isSameNode(Node? otherNode); // historical alias of === @@ -2552,7 +2559,7 @@

    DOCUMENT_POSITION_PRECEDING or DOCUMENT_POSITION_FOLLOWING, with the constraint that this is to be consistent, together.

    Whether to return DOCUMENT_POSITION_PRECEDING or DOCUMENT_POSITION_FOLLOWING is typically implemented via pointer comparison. In - JavaScript implementations a cached Math.random() value can + JavaScript implementations a cached Math.random() value can be used.

  • If node1 is an ancestor of node2 and attr1 is null, @@ -2726,9 +2733,9 @@

    HTMLCollection object may be returned as returned by an earlier call.

    4.5. Interface Document

    [Constructor,
    - Exposed=Window]
    + Exposed=Window]
     interface Document : Node {
    -  [SameObject] readonly attribute DOMImplementation implementation;
    +  [SameObject] readonly attribute DOMImplementation implementation;
       readonly attribute USVString URL;
       readonly attribute USVString documentURI;
       readonly attribute USVString origin;
    @@ -2744,30 +2751,30 @@ 

    HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - [NewObject] Element createElement(DOMString localName, optional ElementCreationOptions options); - [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional ElementCreationOptions options); - [NewObject] DocumentFragment createDocumentFragment(); - [NewObject] Text createTextNode(DOMString data); - [NewObject] CDATASection createCDATASection(DOMString data); - [NewObject] Comment createComment(DOMString data); - [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); + [NewObject] Element createElement(DOMString localName, optional ElementCreationOptions options); + [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional ElementCreationOptions options); + [NewObject] DocumentFragment createDocumentFragment(); + [NewObject] Text createTextNode(DOMString data); + [NewObject] CDATASection createCDATASection(DOMString data); + [NewObject] Comment createComment(DOMString data); + [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); + [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); [CEReactions] Node adoptNode(Node node); - [NewObject] Attr createAttribute(DOMString localName); - [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); + [NewObject] Attr createAttribute(DOMString localName); + [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); - [NewObject] Event createEvent(DOMString interface); + [NewObject] Event createEvent(DOMString interface); - [NewObject] Range createRange(); + [NewObject] Range createRange(); // NodeFilter.SHOW_ALL = 0xFFFFFFFF - [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); - [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); + [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); + [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); }; -[Exposed=Window] +[Exposed=Window] interface XMLDocument : Document {}; dictionary ElementCreationOptions { @@ -2815,7 +2822,7 @@

    Unlike createDocument(), this constructor does not return an XMLDocument object, but a document (Document object).

    The implementation attribute’s getter must return the DOMImplementation object that is associated with the document.

    The URL attribute’s getter and documentURI attribute’s getter must return the URL, serialized.

    -

    The origin attribute’s getter must return the Unicode serialization of context object’s origin.

    +

    The origin attribute’s getter must return the Unicode serialization of context object’s origin.

    The compatMode attribute’s getter must return "BackCompat" if context object’s mode is "quirks", and "CSS1Compat" otherwise.

    @@ -2852,7 +2859,7 @@

    The documentElement attribute’s getter must return the document element.

    The getElementsByTagName(qualifiedName) method, when invoked, must return the list of elements with qualified name qualifiedName for the context object.

    -

    Thus, in an HTML document, document.getElementsByTagName("FOO") will match <FOO> elements that are not in the HTML namespace, and <foo> elements that are in +

    Thus, in an HTML document, document.getElementsByTagName("FOO") will match <FOO> elements that are not in the HTML namespace, and <foo> elements that are in the HTML namespace, but not <FOO> elements that are in the HTML namespace.

    The getElementsByTagNameNS(namespace, localName) method, when invoked, must return the list of elements with namespace namespace and local name localName for @@ -2860,15 +2867,15 @@

    The getElementsByClassName(classNames) method, when invoked, must return the list of elements with class names classNames for the context object.

    Given the following XHTML fragment: -
    <div id="example">
    -  <p id="p1" class="aaa bbb"/>
    -  <p id="p2" class="aaa ccc"/>
    -  <p id="p3" class="bbb ccc"/>
    -</div>
    +
    <div id="example">
    +  <p id="p1" class="aaa bbb"/>
    +  <p id="p2" class="aaa ccc"/>
    +  <p id="p3" class="bbb ccc"/>
    +</div>
     
    -

    A call to document.getElementById("example").getElementsByClassName("aaa") would return a HTMLCollection with the two paragraphs p1 and p2 in it.

    -

    A call to getElementsByClassName("ccc bbb") would only return one node, however, namely p3. A call to document.getElementById("example").getElementsByClassName("bbb  ccc ") would return the same thing.

    -

    A call to getElementsByClassName("aaa,bbb") would return no nodes; none of the elements above are in the aaa,bbb class.

    +

    A call to document.getElementById("example").getElementsByClassName("aaa") would return a HTMLCollection with the two paragraphs p1 and p2 in it.

    +

    A call to getElementsByClassName("ccc bbb") would only return one node, however, namely p3. A call to document.getElementById("example").getElementsByClassName("bbb  ccc ") would return the same thing.

    +

    A call to getElementsByClassName("aaa,bbb") would return no nodes; none of the elements above are in the aaa,bbb class.


    @@ -3233,11 +3240,11 @@

    User agents must create a DOMImplementation object whenever a document is created and associate it with that document.

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface DOMImplementation {
    -  [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
    -  [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
    -  [NewObject] Document createHTMLDocument(optional DOMString title);
    +  [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
    +  [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
    +  [NewObject] Document createHTMLDocument(optional DOMString title);
     
       boolean hasFeature(); // useless; always returns true
     };
    @@ -3335,7 +3342,7 @@ 

    returns true) so that old pages don’t stop working.

    4.6. Interface DocumentType

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface DocumentType : Node {
       readonly attribute DOMString name;
       readonly attribute DOMString publicId;
    @@ -3354,7 +3361,7 @@ 

    context object’s system ID.

    4.7. Interface DocumentFragment

    [Constructor,
    - Exposed=Window]
    + Exposed=Window]
     interface DocumentFragment : Node {
     };
     
    @@ -3369,7 +3376,7 @@

    The DocumentFragment() constructor, when invoked, must return a new DocumentFragment node whose node document is current global object’s associated Document.

    4.8. Interface ShadowRoot

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface ShadowRoot : DocumentFragment {
       readonly attribute ShadowRootMode mode;
       readonly attribute Element host;
    @@ -3413,7 +3420,7 @@ 

    For now you can find more information about this object in Shadow DOM. The DOM Standard will be updated over time to cover more details.

    4.9. Interface Element

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface Element : Node {
       readonly attribute DOMString? namespaceURI;
       readonly attribute DOMString? prefix;
    @@ -3422,11 +3429,11 @@ 

    CEReactions] attribute DOMString id; [CEReactions] attribute DOMString className; - [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList classList; + [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList classList; [CEReactions] attribute DOMString slot; boolean hasAttributes(); - [SameObject] readonly attribute NamedNodeMap attributes; + [SameObject] readonly attribute NamedNodeMap attributes; sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString qualifiedName); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); @@ -3476,31 +3483,31 @@

    The following code illustrates elements in each of these four states:

    <!DOCTYPE html>
    -<script>
    -  window.customElements.define("sw-rey", class extends HTMLElement {})
    -  window.customElements.define("sw-finn", class extends HTMLElement {}, { extends: "p" })
    -  window.customElements.define("sw-kylo", class extends HTMLElement {
    -    constructor() {
    -      // super() intentionally omitted for this example
    -    }
    -  })
    -</script>
    -
    -<!-- "undefined" (not defined, not custom) -->
    -<sw-han></sw-han>
    -<p is="sw-luke"></p>
    -<p is="asdf"></p>
    -
    -<!-- "failed" (not defined, not custom) -->
    -<sw-kylo></sw-kylo>
    -
    -<!-- "uncustomized" (defined, not custom) -->
    -<p></p>
    -<asdf></asdf>
    -
    -<!-- "custom" (defined, custom) -->
    -<sw-rey></sw-rey>
    -<p is="sw-finn"></p>
    +<script>
    +  window.customElements.define("sw-rey", class extends HTMLElement {})
    +  window.customElements.define("sw-finn", class extends HTMLElement {}, { extends: "p" })
    +  window.customElements.define("sw-kylo", class extends HTMLElement {
    +    constructor() {
    +      // super() intentionally omitted for this example
    +    }
    +  })
    +</script>
    +
    +<!-- "undefined" (not defined, not custom) -->
    +<sw-han></sw-han>
    +<p is="sw-luke"></p>
    +<p is="asdf"></p>
    +
    +<!-- "failed" (not defined, not custom) -->
    +<sw-kylo></sw-kylo>
    +
    +<!-- "uncustomized" (defined, not custom) -->
    +<p></p>
    +<asdf></asdf>
    +
    +<!-- "custom" (defined, custom) -->
    +<sw-rey></sw-rey>
    +<p is="sw-finn"></p>
     

    Elements also have an associated shadow root (null or a shadow root). It is null unless otherwise stated. An element is a shadow host if its shadow root is non-null.

    @@ -3984,7 +3991,7 @@

    This method returns nothing because it existed before we had a chance to design it.

    4.9.1. Interface NamedNodeMap

    -
    [Exposed=Window, LegacyUnenumerableNamedProperties]
    +
    [Exposed=Window, LegacyUnenumerableNamedProperties]
     interface NamedNodeMap {
       readonly attribute unsigned long length;
       getter Attr? item(unsigned long index);
    @@ -4051,7 +4058,7 @@ 

    Return attr.

    4.9.2. Interface Attr

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface Attr : Node {
       readonly attribute DOMString? namespaceURI;
       readonly attribute DOMString? prefix;
    @@ -4092,9 +4099,9 @@ 

    specified attribute’s getter must return true.

    4.10. Interface CharacterData

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface CharacterData : Node {
    -  [TreatNullAs=EmptyString] attribute DOMString data;
    +  [TreatNullAs=EmptyString] attribute DOMString data;
       readonly attribute unsigned long length;
       DOMString substringData(unsigned long offset, unsigned long count);
       void appendData(DOMString data);
    @@ -4143,9 +4150,9 @@ 

    The replaceData(offset, count, data) method, when invoked, must replace data with node context object, offset offset, count count, and data data.

    4.11. Interface Text

    [Constructor(optional DOMString data = ""),
    - Exposed=Window]
    + Exposed=Window]
     interface Text : CharacterData {
    -  [NewObject] Text splitText(unsigned long offset);
    +  [NewObject] Text splitText(unsigned long offset);
       readonly attribute DOMString wholeText;
     };
    @@ -4198,11 +4205,11 @@

    wholeText attribute, when invoked, must return a concatenation of the data of the contiguous Text nodes of context object, in tree order.

    4.12. Interface CDATASection

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface CDATASection : Text {
     };

    4.13. Interface ProcessingInstruction

    -
    [Exposed=Window]
    +
    [Exposed=Window]
     interface ProcessingInstruction : CharacterData {
       readonly attribute DOMString target;
     };
    @@ -4210,7 +4217,7 @@

    target attribute must return the target.

    4.14. Interface Comment

    [Constructor(optional DOMString data = ""),
    - Exposed=Window]
    + Exposed=Window]
     interface Comment : CharacterData {
     };
     
    @@ -4232,10 +4239,10 @@

    Element: p