From fbb1c7de652290c3ab455f5c8f1d83a598942fc9 Mon Sep 17 00:00:00 2001 From: Kaleidea <74888177+Kaleidea@users.noreply.github.com> Date: Wed, 1 Dec 2021 12:16:59 +0100 Subject: [PATCH] Editorial: "form elements" -> "forms", etc. --- source | 423 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 247 insertions(+), 176 deletions(-) diff --git a/source b/source index 1848f28ff2b..2b886aa2a6b 100644 --- a/source +++ b/source @@ -7592,7 +7592,7 @@ interface HTMLAllCollection {

The HTMLFormControlsCollection interface is used for collections of listed - elements in form elements.

+ elements in forms.

[Exposed=Window]
 interface HTMLFormControlsCollection : HTMLCollection {
@@ -9863,8 +9863,8 @@ partial interface Document {
 
    
document.forms
-

Returns an HTMLCollection of the form elements in the - Document.

+

Returns an HTMLCollection of the forms + (form or search elements) in the Document.

document.scripts
@@ -9898,7 +9898,8 @@ partial interface Document {

The forms attribute must return an HTMLCollection rooted at the Document node, - whose filter matches only form elements.

+ whose filter matches only forms + (form or search elements).

The scripts attribute must return an HTMLCollection rooted at the Document node, @@ -9975,7 +9976,8 @@ partial interface Document {

Introduction

Links are a conceptual construct, created by a, area, - form, and link elements, that represent + form, search, + and link elements, that represent a connection between two resources, one of which is the current Document. There are two kinds of links in HTML:

@@ -23196,10 +23200,12 @@ document.body.appendChild(wbr);
beyond linking the element's node document to the resource given by the element's href attribute.

-

Similarly, for form elements with a rel +

Similarly, for forms + with a rel attribute, links must be created for the keywords of the rel attribute as defined for those keywords in the link types section. - form elements that do not have a rel attribute, + forms + that do not have a rel attribute, or whose rel attribute has no keywords that are defined as specifying hyperlinks, must also create a hyperlink. @@ -23831,11 +23837,12 @@ document.body.appendChild(wbr);

This is also used by form submission for - the form element. The exception for a elements is for compatibility with - web content.

+ forms. The exception for a elements is for + compatibility with web content.

-

To get an element's noopener, given an a, area, or - form element element and a string target:

+

To get an element's noopener, given an a, area, + form, or search + element element and a string target:

  1. If element's link types include the

    To determine which link types apply to a link, a, area, - or form element, the element's rel attribute must be form, or search element, + the element's rel attribute must be split on ASCII whitespace. The resulting tokens are the keywords for the link types that apply to that element.

    @@ -24348,7 +24356,7 @@ document.body.appendChild(wbr); link a and area - form + form @@ -24796,7 +24804,8 @@ document.body.appendChild(wbr);

    The external keyword may be used with a, - area, and form elements. This keyword does not create a + area, form, and search + elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

    @@ -24808,10 +24817,12 @@ document.body.appendChild(wbr); data-x="rel-help">help"

    The help keyword may be used with link, - a, area, and form elements. This keyword creates a + a, area, form, and search + elements. This keyword creates a hyperlink.

    -

    For a, area, and form elements, the For a, area, form, and search + elements, the help keyword indicates that the referenced document provides further help information for the parent of the element defining the hyperlink, and its children.

    @@ -24995,7 +25006,8 @@ document.body.appendChild(wbr); data-x="rel-license">license"

    The license keyword may be used with link, - a, area, and form elements. This keyword creates a + a, area, form, and search + elements. This keyword creates a hyperlink.

    The license keyword indicates that the referenced document @@ -25297,7 +25309,8 @@ document.body.appendChild(wbr); data-x="rel-nofollow">nofollow"

    The nofollow keyword may be used with a, - area, and form elements. This keyword does not create a + area, form, and search + elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

    @@ -25311,7 +25324,8 @@ document.body.appendChild(wbr); data-x="rel-noopener">noopener"

    The noopener keyword may be used with a, - area, and form elements. This keyword does not create a + area, form, and search + elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

    @@ -25347,7 +25361,8 @@ document.body.appendChild(wbr); data-x="rel-noreferrer">noreferrer"

    The noreferrer keyword may be used with a, - area, and form elements. This keyword does not create a + area, form, and search + elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

    @@ -25367,7 +25382,8 @@ document.body.appendChild(wbr); data-x="rel-opener">opener"

    The opener keyword may be used with a, - area, and form elements. This keyword does not create a + area, form, and search + elements. This keyword does not create a hyperlink, but annotates any other hyperlinks created by the element (the implied hyperlink, if no other keywords create one).

    @@ -25636,8 +25652,8 @@ document.body.appendChild(wbr); data-x="rel-search">search"

    The search keyword may be used with link, - a, area, and form elements. This keyword creates a - hyperlink.

    + a, area, form, and search + elements. This keyword creates a hyperlink.

    The search keyword indicates that the referenced document provides an interface specifically for searching the document and its related resources.

    @@ -25947,8 +25963,8 @@ document.body.appendChild(wbr); data-x="rel-next">next"

    The next keyword may be used with link, - a, area, and form elements. This keyword creates a - hyperlink.

    + a, area, form, and search + elements. This keyword creates a hyperlink.

    The next keyword indicates that the document is part of a sequence, and that the link is leading to the document that is the next logical document in the @@ -25970,8 +25986,8 @@ document.body.appendChild(wbr); data-x="rel-prev">prev"

    The prev keyword may be used with link, - a, area, and form elements. This keyword creates a - hyperlink.

    + a, area, form, and search + elements. This keyword creates a hyperlink.

    The prev keyword indicates that the document is part of a sequence, and that the link is leading to the document that is the previous logical document in @@ -26059,26 +26075,26 @@ document.body.appendChild(wbr); -

    Effect on... form
    +
    Effect on... form and search

    One of the following:

    Not allowed
    -
    The keyword must not be specified on form elements.
    +
    The keyword must not be specified on forms.
    Hyperlink
    -
    The keyword may be specified on form elements; it creates a +
    The keyword may be specified on forms; it creates a hyperlink.
    External Resource
    -
    The keyword may be specified on form elements; it creates an external - resource link.
    +
    The keyword may be specified on forms; + it creates an external resource link.
    Hyperlink Annotation
    -
    The keyword may be specified on form elements; it annotates other hyperlinks created by the - element.
    +
    The keyword may be specified on forms; + it annotates other + hyperlinks created by the element.
    @@ -42710,9 +42726,10 @@ interface HTMLTableCellElement : HTMLElement { -

    A form is a component of a web page that has form controls, such as text, buttons, checkboxes, - range, or color picker controls. A user can interact with such a form, providing data that can - then be sent to the server for further processing (e.g. returning the results of a search or +

    A form is a component of a web page that groups form controls, such as text, buttons, + checkboxes, range, or color picker controls. A user can interact with the form controls, + inputting data. The form can submit all the data in its form controls in one batch to the + server for further processing (e.g. returning the results of a search or calculation). No client-side scripting is needed in many cases, though an API is available so that scripts can augment the user experience or use forms for purposes other than submitting data to a server.

    @@ -42926,7 +42943,8 @@ interface HTMLTableCellElement : HTMLElement {

    Form submissions are exposed to servers in a variety of ways, most commonly as HTTP GET or POST requests. To specify the exact method used, the method - attribute is specified on the form element. This doesn't specify how the form data is + attribute is specified on the form. + This doesn't specify how the form data is encoded, though; to specify that, you use the enctype attribute. You also have to specify the URL of the service that will handle the submitted data, using the action attribute.

    @@ -43322,7 +43340,8 @@ interface HTMLTableCellElement : HTMLElement {

    Denotes elements that can be used for constructing the entry list when a - form element is submitted.

    + form is + submitted.

      @@ -43342,8 +43361,8 @@ interface HTMLTableCellElement : HTMLElement {
      Resettable elements
      -

      Denotes elements that can be affected when a form element is reset.

      +

      Denotes elements that can be affected when a form is + reset.

        @@ -43450,7 +43469,8 @@ interface HTMLFormElement : HTMLElement {
        Uses HTMLFormElement.
        -

        The form element represents a hyperlink that can be +

        A form + represents a hyperlink that can be manipulated through a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.

        @@ -43461,7 +43481,8 @@ interface HTMLFormElement : HTMLElement { case-insensitive match for "UTF-8".

        The name attribute - represents the form's name within the forms + represents the form's + name within the forms collection. The value must not be the empty string, and the value must be unique amongst the form elements in the forms collection that it is in, if any.

        @@ -43489,13 +43510,15 @@ interface HTMLFormElement : HTMLElement { submission.

        The rel attribute on - form elements controls what kinds of links the elements create. The attribute's value + forms + controls what kinds of links the elements create. The attribute's value must be a unordered set of unique space-separated tokens. The allowed keywords and their meanings are defined in an earlier section.

        rel's supported tokens are the keywords defined in HTML link types which are - allowed on form elements, impact the processing model, and are supported by the user + allowed on forms, + impact the processing model, and are supported by the user agent. The possible supported tokens are noreferrer, noopener, and opener. rel's HTMLFormElement : HTMLElement {

        The elements IDL attribute must return an HTMLFormControlsCollection rooted at the - form element's root, whose filter matches form's root, whose filter matches listed elements whose form owner is the - form element, with the exception of input elements whose type attribute is in the form, with the exception of input elements whose + type attribute is in the Image Button state, which must, for historical reasons, be excluded from this particular collection.

        @@ -43623,14 +43646,16 @@ interface HTMLFormElement : HTMLElement { instant.

        To determine the value of an indexed property for a - form element, the user agent must return the value returned by the form, + the user agent must return the value returned by the item method on the elements collection, when invoked with the given index as its argument.


        -

        Each form element has a mapping of names to elements called the past names +

        Each form + has a mapping of names to elements called the past names map. It is used to persist names of controls even when they change names.

        The supported property names consist of the names obtained from the following @@ -43643,7 +43668,8 @@ interface HTMLFormElement : HTMLElement {

      • For each listed element candidate - whose form owner is the form element, with the exception of any + whose form owner is the form, + with the exception of any input elements whose type attribute is in the Image Button state:

        @@ -43662,7 +43688,7 @@ interface HTMLFormElement : HTMLElement {
      • For each img element candidate whose form owner is the - form element:

        + form:

          @@ -43702,12 +43728,12 @@ interface HTMLFormElement : HTMLElement {

        To determine the value of a named property name - for a form element, the user agent must run the following steps:

        + for a form, the user agent must run the following steps:

        1. Let candidates be a live RadioNodeList object containing all the listed elements, whose form - owner is the form element, that have either an is the form, that have either an id attribute or a name attribute equal to name, with the exception of input elements whose type attribute is in the HTMLFormElement : HTMLElement {

        2. If candidates is empty, let candidates be a live RadioNodeList object containing all the img elements, whose form - owner is the form element, that have either an is the form, that have either an id attribute or a name attribute equal to name, in tree order.

        3. If candidates is empty, name is the name of one of - the entries in the form element's past names map: return the object - associated with name in that map.

        4. + the entries in the form's past names map: + return the object associated with name in that map.

        5. If candidates contains more than one node, return candidates.

        6. Otherwise, candidates contains exactly one node. Add a mapping from - name to the node in candidates in the form - element's past names map, replacing the previous entry with the same name, if - any.

        7. + name to the node in candidates in the + form's past names map, + replacing the previous entry with the same name, if any.

        8. Return the node in candidates.

        -

        If an element listed in a form element's past names map changes +

        If an element listed in a form's + past names map changes form owner, then its entries must be removed from that map.

-
  • Otherwise, if element has an ancestor form element, then

    Otherwise, if element has an ancestor + form, then associate element with the nearest such - ancestor form element.

  • + ancestor form.

    @@ -53347,7 +53389,8 @@ interface HTMLLegendElement : HTMLElement { associations.

    This example is a non-conforming document, though, as it is a violation of the content models - to nest form elements, and there is a parse error for the forms, + and there is a parse error for the </form> tag.

    @@ -53392,7 +53435,7 @@ interface HTMLLegendElement : HTMLElement {

    The name content attribute gives the name of the form control, as - used in form submission and in the form element's form submission and in the form's elements object. If the attribute is specified, its value must not be the empty string or isindex.

    @@ -53616,14 +53659,16 @@ form.method === input; // => true
    Form submission attributes
    -

    Attributes for form submission can be specified both on form elements +

    Attributes for form submission can be specified both on + forms and on submit buttons (elements that represent buttons that submit forms, e.g. an input element whose type attribute is in the Submit Button state). -

    The attributes for form submission that may be specified on form - elements are action, The attributes for form submission that may be specified on + forms + are action, enctype, method, novalidate, and target.

    @@ -53634,7 +53679,7 @@ form.method === input; // => true data-x="attr-fs-formmethod">formmethod
    , formnovalidate, and formtarget. When omitted, they default to the values given on - the corresponding attributes on the form element.

    + the corresponding attributes on the form.


    @@ -53668,7 +53713,8 @@ form.method === input; // => true
  • The keyword dialog, mapping to the state dialog, indicating that submitting the form is + data-x="attr-fs-method-dialog">dialog, indicating that submitting the + form is intended to close the dialog box in which the form finds itself, if any, and otherwise not submit.
  • @@ -53716,7 +53762,8 @@ form.method === input; // => true
    -

    In this example, a form is used with a dialog. The In this example, a form + is used with a dialog. The method attribute's "dialog" keyword is used to have the dialog automatically close when the form is submitted.

    @@ -56209,7 +56256,8 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
    Constraint validation

    When the user agent is required to statically validate the constraints of - form element form, it must run the following steps, which return + a form + form, it must run the following steps, which return either a positive result (all the controls in the form are valid) or a negative result (there are invalid controls) along with a (possibly empty) list of elements that are invalid and for which no script has claimed responsibility:

    @@ -56258,8 +56306,9 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD invalid controls list.

    -

    If a user agent is to interactively validate the constraints of form - element form, then the user agent must run the following steps:

    +

    If a user agent is to interactively validate the constraints of + form + form, then the user agent must run the following steps:

    1. Statically validate the constraints of form, and let @@ -56687,9 +56736,9 @@ fur

      Implicit submission
      -

      A form element's default button is the first A form's default button is the first submit button in tree order whose form - owner is that form element.

      + owner is that form.

      If the user agent supports letting the user submit a form implicitly (for example, on some platforms hitting the "enter" key while a text control is focused implicitly submits @@ -56704,12 +56753,14 @@ fur

      If the form has no submit button, then the implicit submission mechanism must do nothing if the form has more than one field that blocks implicit - submission, and must submit the form - element from the form element itself otherwise.

      + submission, and must submit the + form from the form + itself otherwise.

      For the purpose of the previous paragraph, an element is a field that blocks implicit - submission of a form element if it is an input element whose - form owner is that form element and whose of a form + if it is an input element whose + form owner is that form and whose type attribute is in one of the following states: Text, Search, @@ -56732,13 +56783,13 @@ fur

      Form submission algorithm
      -

      Each form element has a constructing entry list boolean, initially - false.

      +

      Each form has a constructing entry list + boolean, initially false.

      -

      Each form element has a firing submission events boolean, initially - false.

      +

      Each form has a firing submission events + boolean, initially false.

      -

      When a form element form is When a form form is submitted from an element submitter (typically a button), optionally with a submitted from submit() method flag set, the user agent must run the @@ -56917,8 +56968,10 @@ fur defining this, act in a manner analogous to that defined in this specification for similar schemes.

      -

      Each form element has a planned navigation, which is either null or a - task; when the form is first created, its +

      Each form + has a planned navigation, which is either null or a + task; when the + form is first created, its planned navigation must be set to null. In the behaviors described below, when the user agent is required to plan to navigate to a particular resource destination, it must run the following steps:

      @@ -56927,20 +56980,22 @@ fur set destination to a new request whose URL is destination.

    2. -
    3. If the form element's link types include the

      If the form's + link types include the noreferrer keyword, then set destination's referrer to "no-referrer".

    4. -
    5. If the form has a non-null planned navigation, remove it from - its task queue.

    6. +
    7. If the form has a non-null + planned navigation, remove it from its task queue.

    8. Queue an element task on the DOM manipulation task source given - the form element and the following steps:

      + the form and the following steps:

        -
      1. Set the form's planned navigation to null.

      2. +
      3. Set the form's + planned navigation to null.

      4. Navigate target browsing context to destination, with historyHandling set to @@ -56949,8 +57004,8 @@ fur

    9. -
    10. Set the form's planned navigation to the just-queued task.

      +
    11. Set the form's planned navigation + to the just-queued task.

    The behaviors are as follows:

    @@ -57380,12 +57435,12 @@ fur
  • Let encoding be the document's character encoding.

  • -

    If the form element has an If the form has an accept-charset attribute, set encoding to the return value of running these substeps:

      -
    1. Let input be the value of the form element's

      Let input be the value of the form's accept-charset attribute.

    2. Let candidate encoding labels be the result of form. Operations on the FormData + object will affect form data to be submitted.

      @@ -57622,11 +57677,11 @@ dictionary FormDataEventInit : EventInit { data-x="dom-FormDataEvent-formData">formData
      attribute must return the value it was initialized to. It represents a FormData object associated to the entry list that is constructed when the - form is submitted.

      + form is submitted.

      Resetting a form

      -

      When a form element form is When a form form is reset, run these steps:

        @@ -67721,7 +67776,8 @@ customElements.define('my-checkbox', MyCheckbox);

        You can use the custom element my-checkbox like a built-in form-associated element. For example, putting it in form or label associates the my-checkbox element with them, and submitting the - form will send data provided by my-checkbox implementation. + form + will send data provided by my-checkbox implementation.

        <form action="..." method="...">
        @@ -68976,10 +69032,10 @@ customElements.define("x-foo", class extends HTMLElement {
             

        If element is a form-associated custom element, then:

        1. Reset the form owner of element. If element is - associated with a form element, then + associated with a form, then enqueue a custom element callback reaction with element, callback - name "formAssociatedCallback", and « the associated form - ».

        2. + name "formAssociatedCallback", and « the associated + form ».

        3. If element is disabled, then enqueue a custom element callback reaction with element, callback name @@ -70565,7 +70621,8 @@ Demos: constraint validation and that satisfy their constraints

        4. -
        5. form elements that are not the form owner of any elements that +
        6. forms + that are not the form owner of any elements that themselves are candidates for constraint validation but do not satisfy their constraints
        7. @@ -70586,7 +70643,8 @@ Demos: constraint validation but that do not satisfy their constraints -
        8. form elements that are the form owner of one or more elements +
        9. forms + that are the form owner of one or more elements that themselves are candidates for constraint validation but do not satisfy their constraints
        10. @@ -74336,7 +74394,7 @@ END:VCARD

        Similarly, a canvas element with the hidden attribute could be used by a scripted graphics engine as an off-screen buffer, and a form control - could refer to a hidden form element using its

  • element pointer to point to the element created.

    @@ -112673,16 +112734,17 @@ document.body.appendChild(text);
    1. If the stack of open elements does not have a form element in scope, then this is a parse - error; return and ignore the token.

    2. + scope">have a form in scope, then this is a + parse error; return and ignore the token.

    3. Generate implied end tags.

    4. -
    5. If the current node is not a form element, then this is a - parse error.

    6. +
    7. If the current node is not a form, + then this is a parse error.

    8. -
    9. Pop elements from the stack of open elements until a form - element has been popped from the stack.

    10. +
    11. Pop elements from the stack of open elements until a + form (form or search element) + has been popped from the stack.

    @@ -113627,15 +113689,16 @@ document.body.appendChild(text);

    Parse error.

    If there is a template element on the stack of open elements, or if - the form element pointer is not null, ignore the + the form element pointer is not null, ignore the token.

    Otherwise:

    Insert an HTML element for the token, and set the form element pointer to point to the element created.

    + data-x="">form
    element pointer to point to the element created.

    -

    Pop that form element off the stack of open elements.

    +

    Pop that form off the + stack of open elements.

    @@ -115384,8 +115447,9 @@ document.body.appendChild(text);
  • Whether the document is set to no-quirks mode, limited-quirks mode, or quirks mode
  • -
  • The association between form controls and forms that aren't their nearest form - element ancestor (use of the form element pointer in the parser)
  • +
  • The association between form controls and forms that aren't their nearest + form ancestor + (use of the form element pointer in the parser)
  • The template contents of any template elements.
  • @@ -115917,10 +115981,11 @@ document.body.appendChild(text);
    • html
      • head
      • body
        • form id="outer"
          • div
            • form id="inner"
              • input
    -

    The input element will be associated with the inner form element. +

    The input element will be associated with the inner + form. Now, if this tree structure is serialized and reparsed, the <form id="inner"> start tag will be ignored, and so the input element will be - associated with the outer form element instead.

    + associated with the outer form instead.

    <html><head></head><body><form id="outer"><div><form id="inner"><input></form></div></form></body></html>
    @@ -116174,11 +116239,13 @@ console.assert(container.firstChild instanceof SuperP);
  • -

    Set the parser's form element pointer to the nearest node to the - context element that is a form - element (going straight up the ancestor chain, and including the element itself, if it is a - form element), if any. (If there is no such form element, the - form element pointer keeps its initial value, null.)

    +

    Set the parser's form element pointer + to the nearest node to the context + element that is a form + (going straight up the ancestor chain, and including the element itself, if it is a + form), if any. (If there is no such + form, the + form element pointer keeps its initial value, null.)

  • @@ -119831,7 +119898,7 @@ if (s = prompt('What is your name?')) {
    urn on link elements

    Specify the preferred persistent identifier using the href attribute instead.

    -
    accept on form elements
    +
    accept on forms

    Use the accept attribute directly on the input elements instead.

    hreflang on area @@ -124120,7 +124187,7 @@ interface External { select; textarea; form-associated custom elements - Associates the element with a form element + Associates the element with a form ID* formaction @@ -125913,8 +125980,9 @@ INSERT INTERFACES HERE formdata FormDataEvent - form elements - Fired at a form element when it is constructing the entry list + forms + Fired at a form + when it is constructing the entry list hashchange @@ -126016,8 +126084,9 @@ INSERT INTERFACES HERE reset Event - form elements - Fired at a form element when it is reset + forms + Fired at a form + when it is reset securitypolicyviolation @@ -126046,8 +126115,9 @@ INSERT INTERFACES HERE submit SubmitEvent - form elements - Fired at a form element when it is submitted + forms + Fired at a form + when it is submitted toggle @@ -127455,6 +127525,7 @@ INSERT INTERFACES HERE Ka-Sing Chou, Kagami Sascha Rosylight, Kai Hendry, + Kaleidea, Kamishetty Sreeja, 呂康豪 (KangHao Lu), Karl Dubost,