From e38aa416a71dc1e2e78c83f4ef33294e21d40e66 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 24 Sep 2019 14:39:34 +0900 Subject: [PATCH] Update all constructors, including [HTMLConstructor] This updates all the constructors in the standard for recent changes to Web IDL. In particular: * Replace [Constructor] extended attributes with constructor operations * Cross-links constructor operations on events to the DOM event constructor definition * Changes [HTMLConstructor] to apply to constructor operations, instead of to interfaces, and updates all usages of it * Changes the definition of [HTMLConstructor] to leverage new Web IDL concepts of "usual constructor steps" and "internally create a new object implementing the interface" Fixes #4870. Fixes #4890. --- source | 503 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 297 insertions(+), 206 deletions(-) diff --git a/source b/source index 71bdfcafa2a..671c65b7a5b 100644 --- a/source +++ b/source @@ -2893,6 +2893,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute @@ -10270,9 +10278,10 @@ partial interface Document { w-nodev>and which must be used by elements that have no additional requirements, is the HTMLElement interface.

-
[Exposed=Window,
- HTMLConstructor]
+  
[Exposed=Window]
 interface HTMLElement : Element {
+  [HTMLConstructor] constructor();
+
   // metadata attributes
   [CEReactions] attribute DOMString title;
   [CEReactions] attribute DOMString lang;
@@ -10298,9 +10307,10 @@ interface HTMLElement : Element {
 HTMLElement includes ElementContentEditable;
 HTMLElement includes HTMLOrSVGElement;
 
-// Note: intentionally not [HTMLConstructor]
 [Exposed=Window]
-interface HTMLUnknownElement : HTMLElement { };
+interface HTMLUnknownElement : HTMLElement { + // Note: intentionally no [HTMLConstructor] +};

The HTMLElement interface holds methods and attributes related to a number of disparate features, and the members of this interface are therefore described in various different @@ -10371,26 +10381,22 @@ interface HTMLUnknownElement : HTMLElement { };

The [HTMLConstructor] extended attribute must take no - arguments, and must not appear on anything other than an interface. It must appear only once on an - interface, and the interface must not be annotated with the [Constructor] - or [NoInterfaceObject] extended attributes. (However, the interface may be - annotated with [NamedConstructor]; there is no conflict there.) It must not - be used on a callback interface.

+ arguments, and must only appear on constructor + operations. It must appear only once on a constructor operation, and the interface must + contain only the single, annotated constructor operation, and no others. The annotated + constructor operation must be declared to take no arguments.

-

Interface objects for interfaces annotated with the - [HTMLConstructor] extended attribute must run the following - steps as the function body behavior for both [[Call]] and [[Construct]] invocations of the - corresponding JavaScript function object. When invoked with [[Call]], the NewTarget value is - undefined, and so the algorithm below will immediately throw. When invoked with [[Construct]], the - [[Construct]] newTarget parameter provides the NewTarget value.

+

Interfaces declared with constructor operations that are annotated with the [HTMLConstructor] extended attribute have the following + overridden constructor steps:

  1. Let registry be the current global object's CustomElementRegistry object.

  2. -

    If NewTarget is equal to the active function object, then throw a - TypeError.

    +

    If NewTarget is equal to the active function + object, then throw a TypeError.

    This can occur when a custom element is defined using an element interface as @@ -10401,22 +10407,22 @@ new HTMLButtonElement(); // (1) document.createElement("bad-1"); // (2)

    In this case, during the execution of HTMLButtonElement (either explicitly, as - in (1), or implicitly, as in (2)), both the active function object and NewTarget - are HTMLButtonElement. If this check was not present, it would be possible to - create an instance of HTMLButtonElement whose local name was bad-1.

    + in (1), or implicitly, as in (2)), both the active function object and + NewTarget are HTMLButtonElement. If this check was not present, it + would be possible to create an instance of HTMLButtonElement whose local name was + bad-1.

  3. Let definition be the entry in registry with constructor equal to NewTarget. If - there is no such definition, then throw a TypeError.

    + data-x="concept-custom-element-definition-constructor">constructor equal to + NewTarget. If there is no such definition, then throw a TypeError.

    Since there can be no entry in registry with a constructor of undefined, this step also prevents HTML element constructors from being called as functions (since in that case - NewTarget will be undefined).

    + NewTarget will be undefined).

  4. Let is value be null.

  5. @@ -10479,43 +10485,30 @@ document.createElement("bad-1"); // (2)
-
  • Let prototype be Get(NewTarget, "prototype"). - Rethrow any exceptions.

  • - -
  • -

    If Type(prototype) is not Object, then:

    - -
      -
    1. Let realm be GetFunctionRealm(NewTarget).

    2. - -
    3. Set prototype to the interface prototype object of - realm whose interface is the same as the interface of the active function - object.

    4. -
    - -

    The realm of the active function object might not be - realm, so we are using the more general concept of "the same interface" across - realms; we are not looking for equality of interface - objects. This fallback behavior, including using the realm of NewTarget and looking up - the appropriate prototype there, is designed to match analogous behavior for the JavaScript - built-ins.

    -
  • -
  • If definition's construction stack is empty, then:

      -
    1. Let element be a new element that implements the interface to which the - active function object corresponds, with no attributes, namespace set to the - HTML namespace, local name set to definition's local name, and node - document set to the current global object's associated Document.

    2. +
    3. Let element be the result of internally creating a new object implementing the interface + to which the active function object corresponds, given the current Realm + Record and NewTarget.

    4. -
    5. Perform element.[[SetPrototypeOf]](prototype). Rethrow any - exceptions.

    6. +
    7. Set element's node document to the current global + object's associated + Document.

    8. + +
    9. Set element's namespace to + the HTML namespace.

    10. + +
    11. Set element's namespace + prefix to null.

    12. + +
    13. Set element's local name to + definition's local + name.

    14. Set element's custom element state to "custom".

    15. @@ -10533,6 +10526,29 @@ document.createElement("bad-1"); // (2) via new MyCustomElement().

      +
    16. Let prototype be Get(NewTarget, + "prototype"). Rethrow any exceptions.

    17. + +
    18. +

      If Type(prototype) is not Object, then:

      + +
        +
      1. Let realm be GetFunctionRealm(NewTarget).

      2. + +
      3. Set prototype to the interface prototype object of + realm whose interface is the same as the interface of the active function + object.

      4. +
      + +

      The realm of the active function object might not be + realm, so we are using the more general concept of "the same interface" across + realms; we are not looking for equality of interface + objects. This fallback behavior, including using the realm of NewTarget and + looking up the appropriate prototype there, is designed to match analogous behavior for the + JavaScript built-ins and Web IDL's internally create a new object implementing the + interface algorithm.

      +
    19. +
    20. Let element be the last entry in definition's construction stack.

    21. @@ -12973,9 +12989,10 @@ interface DOMStringMap {
      manifest
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLHtmlElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLHtmlElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLHtmlElement.
      @@ -13051,9 +13068,10 @@ gave me some of the songs they wrote. I love sharing my music.</p>
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLHeadElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLHeadElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLHeadElement.
      @@ -13111,9 +13129,10 @@ interface HTMLHeadElement : HTMLElement {};
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTitleElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString text;
       };
      @@ -13205,9 +13224,10 @@ interface HTMLTitleElement : HTMLElement {
      target
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLBaseElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString href;
         [CEReactions] attribute DOMString target;
       };
      @@ -13399,9 +13419,10 @@ interface HTMLBaseElement : HTMLElement {
      Also, the title attribute has special semantics on this element.
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLLinkElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString href;
         [CEReactions] attribute DOMString? crossOrigin;
         [CEReactions] attribute DOMString rel;
      @@ -13973,9 +13994,10 @@ interface HTMLLinkElement : HTMLElement {
          
      charset
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLMetaElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString name;
         [CEReactions] attribute DOMString httpEquiv;
         [CEReactions] attribute DOMString content;
      @@ -15105,9 +15127,10 @@ people expect to have work and what is necessary.
          
      Also, the title attribute has special semantics on this element.
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLStyleElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString media;
       };
       HTMLStyleElement includes LinkStyle;
      @@ -15466,9 +15489,10 @@ interface HTMLStyleElement : HTMLElement {
      onunload
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLBodyElement : HTMLElement {};
      +    
      [Exposed=Window]
      +interface HTMLBodyElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
       
       HTMLBodyElement includes WindowEventHandlers;
      @@ -16185,9 +16209,10 @@ isn't his only passion. He also enjoys other pleasures.</p>
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLHeadingElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLHeadingElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLHeadingElement.
      @@ -17910,9 +17935,10 @@ Space is not the only void
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLParagraphElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLParagraphElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLParagraphElement.
      @@ -18050,9 +18076,10 @@ and is further discussed below.</div>
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLHRElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLHRElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLHRElement.
      @@ -18155,9 +18182,10 @@ of Gralmond's winters.</p>
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLPreElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLPreElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLPreElement.
      @@ -18269,9 +18297,10 @@ a friend lost to the
      cite
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLQuoteElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString cite;
       };

      The HTMLQuoteElement interface is @@ -18639,9 +18668,10 @@ I first lived there):</p>

      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLUListElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLUListElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLUListElement.
      @@ -18915,9 +18945,10 @@ interface HTMLLIElement : HTMLElement {
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLDListElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLDListElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLDListElement.
      @@ -19599,9 +19630,10 @@ included with Exhibit B.
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLDivElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLDivElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLDivElement.
      @@ -19674,9 +19706,10 @@ interface HTMLDivElement : HTMLElement {};
      referrerpolicy
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLAnchorElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString target;
         [CEReactions] attribute DOMString download;
         [CEReactions] attribute USVString ping;
      @@ -21174,9 +21207,10 @@ this specification: the <abbr>WHATWG</abbr> and the
          
      value
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLDataElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString value;
       };
      @@ -22343,9 +22377,10 @@ wormhole connection.</mark></p>
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLSpanElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLSpanElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLSpanElement.
      @@ -22388,9 +22423,10 @@ interface HTMLSpanElement : HTMLElement {};
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLBRElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLBRElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLBRElement.
      @@ -25611,9 +25647,10 @@ document.body.appendChild(wbr);

      The ins and del elements must implement the HTMLModElement interface:

      -
      [Exposed=Window,
      - HTMLConstructor]
      +  
      [Exposed=Window]
       interface HTMLModElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString cite;
         [CEReactions] attribute DOMString dateTime;
       };
      @@ -25796,9 +25833,10 @@ interface HTMLModElement : HTMLElement {
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLPictureElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLPictureElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLPictureElement.
      @@ -25838,9 +25876,10 @@ interface HTMLPictureElement : HTMLElement {};

      media
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLSourceElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString src;
         [CEReactions] attribute DOMString type;
         [CEReactions] attribute USVString srcset;
      @@ -29852,9 +29891,10 @@ href="?audio">audio</a> test instead.)</p>
      referrerpolicy
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLIFrameElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString src;
         [CEReactions] attribute DOMString srcdoc;
         [CEReactions] attribute DOMString name;
      @@ -30571,9 +30611,10 @@ interface HTMLIFrameElement : HTMLElement {
          
      Any other attribute that has no namespace (see prose).
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLEmbedElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString src;
         [CEReactions] attribute DOMString type;
         [CEReactions] attribute DOMString width;
      @@ -30979,9 +31020,10 @@ interface HTMLEmbedElement : HTMLElement {
          
      height
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLObjectElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString data;
         [CEReactions] attribute DOMString type;
         [CEReactions] attribute DOMString name;
      @@ -31703,9 +31745,10 @@ interface HTMLObjectElement : HTMLElement {
          
      value
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLParamElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString name;
         [CEReactions] attribute DOMString value;
       };
      @@ -32339,9 +32382,10 @@ interface HTMLAudioElement : HTMLMediaElement {};
      default
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTrackElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString kind;
         [CEReactions] attribute USVString src;
         [CEReactions] attribute DOMString srclang;
      @@ -38852,9 +38896,10 @@ dictionary TrackEventInit : EventInit {
          
      name
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLMapElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString name;
         [SameObject] readonly attribute HTMLCollection areas;
       };
      @@ -38956,9 +39001,10 @@ interface HTMLMapElement : HTMLElement {
      referrerpolicy
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLAreaElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString alt;
         [CEReactions] attribute DOMString coords;
         [CEReactions] attribute DOMString shape;
      @@ -39641,9 +39687,10 @@ interface HTMLAreaElement : HTMLElement {
          
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTableElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute HTMLTableCaptionElement? caption;
         HTMLTableCaptionElement createCaption();
         [CEReactions] void deleteCaption();
      @@ -40322,9 +40369,10 @@ side in the right column.</p>
          
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      -interface HTMLTableCaptionElement : HTMLElement {};
      +
      [Exposed=Window]
      +interface HTMLTableCaptionElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +};
      Uses HTMLTableCaptionElement.
      @@ -40412,9 +40460,10 @@ the cell that corresponds to the values of the two dice.
      span
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTableColElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute unsigned long span;
       };
      @@ -40499,9 +40548,10 @@ interface HTMLTableColElement : HTMLElement {
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTableSectionElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [SameObject] readonly attribute HTMLCollection rows;
         HTMLTableRowElement insertRow(optional long index = -1);
         [CEReactions] void deleteRow(long index);
      @@ -40733,9 +40783,10 @@ interface HTMLTableSectionElement : HTMLElement {
          
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTableRowElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         readonly attribute long rowIndex;
         readonly attribute long sectionRowIndex;
         [SameObject] readonly attribute HTMLCollection cells;
      @@ -40901,9 +40952,10 @@ interface HTMLTableRowElement : HTMLElement {
          
          
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTableCellElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute unsigned long colSpan;
         [CEReactions] attribute unsigned long rowSpan;
         [CEReactions] attribute DOMString headers;
      @@ -43624,9 +43676,10 @@ interface HTMLFormElement : HTMLElement {
          
      for
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLLabelElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         readonly attribute HTMLFormElement? form;
         [CEReactions] attribute DOMString htmlFor;
         readonly attribute HTMLElement? control;
      @@ -43869,9 +43922,10 @@ interface HTMLLabelElement : HTMLElement {
          
      Also, the title attribute has special semantics on this element.
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLInputElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString accept;
         [CEReactions] attribute DOMString alt;
         [CEReactions] attribute DOMString autocomplete;
      @@ -50008,9 +50062,10 @@ You cannot submit this form when the field is incorrect.
      value
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLButtonElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute boolean disabled;
         readonly attribute HTMLFormElement? form;
         [CEReactions] attribute USVString formAction;
      @@ -50199,9 +50254,10 @@ interface HTMLButtonElement : HTMLElement {
          
      size
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLSelectElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString autocomplete;
         [CEReactions] attribute boolean disabled;
         readonly attribute HTMLFormElement? form;
      @@ -50738,9 +50794,10 @@ interface HTMLSelectElement : HTMLElement {
          
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLDataListElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [SameObject] readonly attribute HTMLCollection options;
       };
      @@ -50839,9 +50896,10 @@ interface HTMLDataListElement : HTMLElement {
      label
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLOptGroupElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute boolean disabled;
         [CEReactions] attribute DOMString label;
       };
      @@ -51213,9 +51271,10 @@ interface HTMLOptionElement : HTMLElement {
      wrap
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTextAreaElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString autocomplete;
         [CEReactions] attribute unsigned long cols;
         [CEReactions] attribute DOMString dirName;
      @@ -51699,9 +51758,10 @@ Daddy"></textarea>
      name
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLOutputElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor;
         readonly attribute HTMLFormElement? form;
         [CEReactions] attribute DOMString name;
      @@ -51889,9 +51949,10 @@ interface HTMLOutputElement : HTMLElement {
          
      max
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLProgressElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute double value;
         [CEReactions] attribute double max;
         readonly attribute double position;
      @@ -52061,9 +52122,10 @@ interface HTMLProgressElement : HTMLElement {
          
      optimum
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLMeterElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute double value;
         [CEReactions] attribute double min;
         [CEReactions] attribute double max;
      @@ -52445,9 +52507,10 @@ out of 233 257 824 bytes available</meter></p>
      name
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLFieldSetElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute boolean disabled;
         readonly attribute HTMLFormElement? form;
         [CEReactions] attribute DOMString name;
      @@ -52624,9 +52687,10 @@ interface HTMLFieldSetElement : HTMLElement {
          
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLLegendElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         readonly attribute HTMLFormElement? form;
       };
      @@ -57099,9 +57163,10 @@ dictionary FormDataEventInit : EventInit {
      open
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLDetailsElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute boolean open;
       };
      @@ -57595,9 +57660,10 @@ interface HTMLDetailsElement : HTMLElement {
      open
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLDialogElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute boolean open;
         attribute DOMString returnValue;
         [CEReactions] void show();
      @@ -57953,9 +58019,10 @@ interface HTMLDialogElement : HTMLElement {
          
      referrerpolicy
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLScriptElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute USVString src;
         [CEReactions] attribute DOMString type;
         [CEReactions] attribute boolean noModule;
      @@ -59498,9 +59565,10 @@ not-slash     = %x0000-002E / %x0030-10FFFF
          
      Global attributes
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLTemplateElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         readonly attribute DocumentFragment content;
       };
      @@ -59785,9 +59853,10 @@ interface HTMLTemplateElement : HTMLElement {
      name
      DOM interface:
      -
      [Exposed=Window,
      - HTMLConstructor]
      +    
      [Exposed=Window]
       interface HTMLSlotElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString name;
         sequence<Node> assignedNodes(optional AssignedNodesOptions options = {});
         sequence<Element> assignedElements(optional AssignedNodesOptions options = {});
      @@ -60625,19 +60694,21 @@ interface TextMetrics {
         readonly attribute double ideographicBaseline;
       };
       
      -[Constructor(unsigned long sw, unsigned long sh),
      - Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
      - Exposed=(Window,Worker),
      +[Exposed=(Window,Worker),
        Serializable]
       interface ImageData {
      +  constructor(unsigned long sw, unsigned long sh);
      +  constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh);
      +
         readonly attribute unsigned long width;
         readonly attribute unsigned long height;
         readonly attribute Uint8ClampedArray data;
       };
       
      -[Constructor(optional (Path2D or DOMString) path),
      - Exposed=(Window,Worker)]
      +[Exposed=(Window,Worker)]
       interface Path2D {
      +  constructor(optional (Path2D or DOMString) path);
      +
         void addPath(Path2D path, optional DOMMatrix2DInit transform = {});
       };
       Path2D includes CanvasPath;
      @@ -65574,8 +65645,10 @@ dictionary ImageEncodeOptions { enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2" }; -[Constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height), Exposed=(Window,Worker), Transferable] +[Exposed=(Window,Worker), Transferable] interface OffscreenCanvas : EventTarget { + constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height); + attribute [EnforceRange] unsigned long long width; attribute [EnforceRange] unsigned long long height; @@ -90756,9 +90829,10 @@ import "https://example.com/foo/../module2.mjs";
      The ErrorEvent interface
      -
      [Constructor(DOMString type, optional ErrorEventInit eventInitDict = {}),
      - Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface ErrorEvent : Event {
      +  constructor(DOMString type, optional ErrorEventInit eventInitDict = {});
      +
         readonly attribute DOMString message;
         readonly attribute USVString filename;
         readonly attribute unsigned long lineno;
      @@ -90917,8 +90991,10 @@ dictionary ErrorEventInit : EventInit {
       
         
      The PromiseRejectionEvent interface
      -
      [Constructor(DOMString type, PromiseRejectionEventInit eventInitDict), Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface PromiseRejectionEvent : Event {
      +  constructor(DOMString type, PromiseRejectionEventInit eventInitDict);
      +
         readonly attribute Promise<any> promise;
         readonly attribute any reason;
       };
      @@ -96262,9 +96338,10 @@ self.onmessage = function(ev) {
         MessageEvent interface for their message
         events:

      -
      [Constructor(DOMString type, optional MessageEventInit eventInitDict = {}),
      - Exposed=(Window,Worker,AudioWorklet)]
      +  
      [Exposed=(Window,Worker,AudioWorklet)]
       interface MessageEvent : Event {
      +  constructor(DOMString type, optional MessageEventInit eventInitDict = {});
      +
         readonly attribute any data;
         readonly attribute USVString origin;
         readonly attribute DOMString lastEventId;
      @@ -96445,8 +96522,10 @@ source.addEventListener('remove', removeHandler, false);

      The EventSource interface

      -
      [Constructor(USVString url, optional EventSourceInit eventSourceInitDict = {}), Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface EventSource : EventTarget {
      +  constructor(USVString url, optional EventSourceInit eventSourceInitDict = {});
      +
         readonly attribute USVString url;
         readonly attribute boolean withCredentials;
       
      @@ -97269,8 +97348,10 @@ data: test
         

      The WebSocket interface

      enum BinaryType { "blob", "arraybuffer" };
      -[Constructor(USVString url, optional (DOMString or sequence<DOMString>) protocols = []), Exposed=(Window,Worker)]
      +[Exposed=(Window,Worker)]
       interface WebSocket : EventTarget {
      +  constructor(USVString url, optional (DOMString or sequence<DOMString>) protocols = []);
      +
         readonly attribute USVString url;
       
         // ready state
      @@ -98007,9 +98088,10 @@ socket.onopen = function () {
         

      WebSocket objects use the CloseEvent interface for their close events:

      -
      [Constructor(DOMString type, optional CloseEventInit eventInitDict = {}),
      - Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface CloseEvent : Event {
      +  constructor(DOMString type, optional CloseEventInit eventInitDict = {});
      +
         readonly attribute boolean wasClean;
         readonly attribute unsigned short code;
         readonly attribute USVString reason;
      @@ -99057,8 +99139,10 @@ dictionary PostMessageOptions {
         

      For simple cases, though, where a shared worker would be an unreasonable overhead, authors can use the simple channel-based broadcast mechanism described in this section.

      -
      [Constructor(DOMString name), Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface BroadcastChannel : EventTarget {
      +  constructor(DOMString name);
      +
         readonly attribute DOMString name;
         void postMessage(any message);
         void close();
      @@ -100573,9 +100657,10 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {
       
         
      Dedicated workers and the Worker interface
      -
      [Constructor(USVString scriptURL, optional WorkerOptions options = {}),
      - Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface Worker : EventTarget {
      +  constructor(USVString scriptURL, optional WorkerOptions options = {});
      +
         void terminate();
       
         void postMessage(any message, sequence<object> transfer);
      @@ -100720,9 +100805,10 @@ enum WorkerType { "classic", "module" };
       
         
      Shared workers and the SharedWorker interface
      -
      [Constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {}),
      - Exposed=(Window,Worker)]
      +  
      [Exposed=(Window,Worker)]
       interface SharedWorker : EventTarget {
      +  constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {});
      +
         readonly attribute MessagePort port;
       };
       SharedWorker includes AbstractWorker;
      @@ -116943,9 +117029,10 @@ if (s = prompt('What is your name?')) {

      The marquee element must implement the HTMLMarqueeElement interface.

      -
      [Exposed=Window,
      - HTMLConstructor]
      +  
      [Exposed=Window]
       interface HTMLMarqueeElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString behavior;
         [CEReactions] attribute DOMString bgColor;
         [CEReactions] attribute DOMString direction;
      @@ -117163,9 +117250,10 @@ interface HTMLMarqueeElement : HTMLElement {
         

      The frameset element must implement the HTMLFrameSetElement interface.

      -
      [Exposed=Window,
      - HTMLConstructor]
      +  
      [Exposed=Window]
       interface HTMLFrameSetElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString cols;
         [CEReactions] attribute DOMString rows;
       };
      @@ -117263,9 +117351,10 @@ interface HTMLFrameSetElement : HTMLElement {
       
         

      The frame element must implement the HTMLFrameElement interface.

      -
      [Exposed=Window,
      - HTMLConstructor]
      +  
      [Exposed=Window]
       interface HTMLFrameElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute DOMString name;
         [CEReactions] attribute DOMString scrolling;
         [CEReactions] attribute USVString src;
      @@ -117434,9 +117523,10 @@ interface HTMLFrameElement : HTMLElement {
         

      The dir element must implement the HTMLDirectoryElement interface.

      -
      [Exposed=Window,
      - HTMLConstructor]
      +  
      [Exposed=Window]
       interface HTMLDirectoryElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute boolean compact;
       };
      @@ -117475,9 +117565,10 @@ interface HTMLDirectoryElement : HTMLElement {

      The font element must implement the HTMLFontElement interface.

      -
      [Exposed=Window,
      - HTMLConstructor]
      +  
      [Exposed=Window]
       interface HTMLFontElement : HTMLElement {
      +  [HTMLConstructor] constructor();
      +
         [CEReactions] attribute [TreatNullAs=EmptyString] DOMString color;
         [CEReactions] attribute DOMString face;
         [CEReactions] attribute DOMString size;