From 10dbae49d215ddc3a6506321a065e26e7d55251e Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 16 Dec 2024 11:36:05 +0100 Subject: [PATCH] Meta: give all document references an explicit for attribute This is needed for #1334. --- dom.bs | 97 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/dom.bs b/dom.bs index 300cdfa6..4c3fe8ed 100644 --- a/dom.bs +++ b/dom.bs @@ -336,7 +336,7 @@ are invoked, now in reverse tree order.

The debug function will be invoked twice. Each time the event's {{Event/target}} attribute value will be the span element. The first time -{{Event/currentTarget}} attribute's value will be the document, the second time the +{{Event/currentTarget}} attribute's value will be the document, the second time the body element. {{Event/eventPhase}} attribute's value switches from {{Event/CAPTURING_PHASE}} to {{Event/BUBBLING_PHASE}}. If an event listener was registered for the span element, {{Event/eventPhase}} attribute's value would have @@ -2340,16 +2340,16 @@ therefore alone in a tree.

Document tree

A document tree is a node tree whose -root is a document. +root is a document. -

The document element of a document is the element whose -parent is that document, if it exists; otherwise null. +

The document element of a document is the element +whose parent is that document, if it exists; otherwise null.

Per the node tree constraints, there can be only one such element.

A node is in a document tree if its root is a -document. +document.

A node is in a document if it is in a document tree. The term in a document is no longer supposed to be used. It indicates that @@ -2370,7 +2370,7 @@ referred to as the light tree.

itself.

A node is connected if its -shadow-including root is a document. +shadow-including root is a document.

Slots
@@ -2628,12 +2628,12 @@ steps: "{{HierarchyRequestError!!exception}}" {{DOMException}}.
  • If either node is a {{Text}} node and parent is a - document, or node is a doctype and parent is not a - document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + document, or node is a doctype and parent is not a + document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.

  • -

    If parent is a document, and any of the statements below, switched on the - interface node implements, are true, then throw a +

    If parent is a document, and any of the statements below, switched on + the interface node implements, are true, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.

    @@ -2898,12 +2898,12 @@ within a parent, run these steps: "{{HierarchyRequestError!!exception}}" {{DOMException}}.
  • If either node is a {{Text}} node and parent is a - document, or node is a doctype and parent is not a - document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + document, or node is a doctype and parent is not a + document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.

  • -

    If parent is a document, and any of the statements below, switched on the - interface node implements, are true, then throw a +

    If parent is a document, and any of the statements below, switched on + the interface node implements, are true, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.

    @@ -4130,7 +4130,7 @@ get a direct instance of it.

    Each node has an associated node document, set upon creation, that is a -document. +document.

    A node's node document can be changed by the adopt algorithm. @@ -4334,10 +4334,11 @@ statement, switching on the interface this implements: if this is connected; otherwise false.

    The ownerDocument getter steps are to return null, -if this is a document; otherwise this's node document. +if this is a document; otherwise this's node document. -

    The node document of a document is that document itself. -All nodes have a node document at all times. +

    The node document of a document is that +document itself. All nodes have a node document at all +times.

    The getRootNode(options) method steps are to return this's shadow-including root if @@ -5152,9 +5153,9 @@ dictionary ElementCreationOptions {

    {{Document}} nodes are simply known as documents. -

    A document's node document is itself. +

    A document's node document is itself. -

    Each document has an associated +

    Each document has an associated encoding (an encoding), content type (a string), URL (a URL), @@ -5166,18 +5167,19 @@ known as documents. [[!URL]] [[!HTML]] -

    Unless stated otherwise, a document's encoding is the utf-8 -encoding, content type is +

    Unless stated otherwise, a document's encoding is the +utf-8 encoding, content type is "application/xml", URL is "about:blank", origin is an opaque origin, type is "xml", mode is "no-quirks", and its allow declarative shadow roots is false. -

    A document is said to be an XML document if its type -is "xml"; otherwise an HTML document. Whether a document is an -HTML document or an XML document affects the behavior of certain APIs. +

    A document is said to be an XML document if its +type is "xml"; otherwise an HTML document. +Whether a document is an HTML document or an XML document affects the +behavior of certain APIs. -

    A document is said to be in +

    A document is said to be in no-quirks mode if its mode is "no-quirks", quirks mode if its mode @@ -5196,16 +5198,16 @@ is "quirks", and are nonsensical.) -

    A document's get the parent algorithm, given an event, returns +

    A document's get the parent algorithm, given an event, returns null if event's {{Event/type}} attribute value is "load" or -document does not have a browsing context; otherwise the -document's relevant global object. +document does not have a browsing context; otherwise the +document's relevant global object.


    document = new {{Document()}} -
    Returns a new document. +
    Returns a new document.
    document . {{Document/implementation}}
    Returns document's {{DOMImplementation}} object. @@ -5233,7 +5235,7 @@ steps are to set this's origin to the current global object's associated Document. [[!HTML]]

    Unlike {{DOMImplementation/createDocument()}}, this constructor does not -return an {{XMLDocument}} object, but a document ({{Document}} object). +return an {{XMLDocument}} object, but a document ({{Document}} object).

    The implementation getter steps are to return the @@ -5297,7 +5299,7 @@ otherwise "CSS1Compat".

    collection = document . {{Document/getElementsByClassName(classNames)}}
    collection = element . {{Element/getElementsByClassName(classNames)}}

    Returns an {{HTMLCollection}} of the elements in the object on which the method - was invoked (a document or an element) that have all the classes given by + was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.

    @@ -5557,16 +5559,16 @@ method steps are:

    Returns a copy of node. If deep is true, the copy also includes the node's descendants. -

    If node is a document or a shadow root, throws a +

    If node is a document or a shadow root, throws a "{{NotSupportedError!!exception}}" {{DOMException}}.

    node = document . {{adoptNode(node)}}
    Moves node from another - document and returns it. + document and returns it. - If node is a document, throws a "{{NotSupportedError!!exception}}" + If node is a document, throws a "{{NotSupportedError!!exception}}" {{DOMException}} or, if node is a shadow root, throws a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
    @@ -5575,8 +5577,8 @@ method steps are: method steps are:
      -
    1. If node is a document or shadow root, then throw a - "{{NotSupportedError!!exception}}" {{DOMException}}. +

    2. If node is a document or shadow root, then throw + a "{{NotSupportedError!!exception}}" {{DOMException}}.

    3. Return a clone of node, with this and the clone children flag set if deep is true. @@ -5627,7 +5629,7 @@ these steps:

      The adoptNode(node) method steps are:

        -
      1. If node is a document, then throw a +

      2. If node is a document, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.

      3. If node is a shadow root, then throw a @@ -5786,9 +5788,8 @@ method steps are:

        Interface {{DOMImplementation}}

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

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

         [Exposed=Window]
        @@ -5831,7 +5832,7 @@ interface DOMImplementation {
          
        doc = document . {{Document/implementation}} . createHTMLDocument([title])
        - Returns a document, with a basic + Returns a document, with a basic tree already constructed including a <{title}> element, unless the title argument is omitted. @@ -5849,7 +5850,7 @@ method steps are:
      4. Return a new doctype, with qualifiedName as its name, publicId as its public ID, and systemId as its system ID, and with its node document set to the associated - document of this. + document of this.

      No check is performed that publicId code points match the @@ -5874,7 +5875,7 @@ method steps are:

    4. If element is non-null, append element to document.

    5. document's origin is this's associated - document's origin. + document's origin.

    6. document's content type is determined by namespace: @@ -5898,7 +5899,7 @@ method steps are: method steps are:

        -
      1. Let doc be a new document that is an HTML document. +

      2. Let doc be a new document that is an HTML document.

      3. Set doc's content type to "text/html". @@ -5927,8 +5928,8 @@ method steps are:

      4. Append the result of creating an element given doc, "body", and the HTML namespace, to the <{html}> element created earlier.

      5. -
      6. doc's origin is this's associated document's - origin. +

      7. doc's origin is this's associated + document's origin.

      8. Return doc.

      @@ -8194,7 +8195,7 @@ to set this's start and end to
      container = range . {{Range/commonAncestorContainer}} -
      Returns the node, furthest away from the document, that is an +
      Returns the node, furthest away from the document, that is an ancestor of both range's start node and end node.