Changeset 213517 in webkit


Ignore:
Timestamp:
Mar 7, 2017, 9:03:16 AM (8 years ago)
Author:
Chris Dumez
Message:

Align initEvent / initCustomEvent / initMessageEvent with the latest specification
https://bugs.webkit.org/show_bug.cgi?id=169176

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Re-sync web-platform tests from upstream after:

  • web-platform-tests/dom/events/CustomEvent-expected.txt:
  • web-platform-tests/dom/events/CustomEvent.html:
  • web-platform-tests/dom/events/Event-initEvent-expected.txt:
  • web-platform-tests/dom/events/Event-initEvent.html:
  • web-platform-tests/dom/interfaces-expected.txt:
  • web-platform-tests/dom/interfaces.html:
  • web-platform-tests/html/dom/interfaces-expected.txt:
  • web-platform-tests/html/dom/interfaces.html:
  • web-platform-tests/html/dom/resources/interfaces.idl: Copied from LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html.
  • web-platform-tests/html/dom/resources/untested-interfaces.idl: Added.
  • web-platform-tests/html/webappapis/scripting/events/messageevent-constructor-expected.txt: Removed.
  • web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.html: Removed.
  • web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt:
  • web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html:

Source/WebCore:

Align initEvent / initCustomEvent / initMessageEvent with the latest specification
after:

In particular, the following changes were made:

  • initEvent: The length property now properly returns 1 instead of 3 as only the first parameter is mandatory. We were already behaving correcting the the length property value was wrong because we forgot to drop a hack from the bindings generator.
  • initCustomEvent: Make all parameters except the first optional. Previously, all parameters were mandatory so this is safe.
  • initMessageEvent: Drop the custom code and mark the first parameter as mandatory. A side effect of dropping the custom code is that null is no longer considered as valid input for the last parameter. The parameter is of type sequence<> and the new behavior is consistent with the specification and Firefox. If it turns out to break existing content, I'll make the parameter nullable in a follow-up.

No new tests, updated existing tests.

  • bindings/js/JSMessageEventCustom.cpp:
  • bindings/scripts/CodeGeneratorJS.pm:

(GeneratePropertiesHashTable):

  • dom/CustomEvent.idl:
  • dom/MessageEvent.idl:

LayoutTests:

Updated existing tests to reflect behavior change.

  • fast/events/init-events-expected.txt:
  • fast/events/script-tests/init-events.js:
  • fast/eventsource/eventsource-attribute-listeners.html:
Location:
trunk
Files:
2 added
2 deleted
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r213516 r213517  
     12017-03-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
     4        https://bugs.webkit.org/show_bug.cgi?id=169176
     5
     6        Reviewed by Alex Christensen.
     7
     8        Updated existing tests to reflect behavior change.
     9
     10        * fast/events/init-events-expected.txt:
     11        * fast/events/script-tests/init-events.js:
     12        * fast/eventsource/eventsource-attribute-listeners.html:
     13
    1142017-03-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    215
  • trunk/LayoutTests/fast/events/init-events-expected.txt

    r209895 r213517  
    3939PASS testInitEvent('Keyboard', '"a", false, true, window, "b", 1001, false, false, false, false, false').pageY is 0
    4040PASS testInitEvent('Keyboard', '"a", false, true, window, "b", 1001, false, false, false, false, false').which is 0
    41 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').type is 'a'
    42 PASS testInitEvent('Message', 'null, false, false, "b", "c", "d", window, null').type is 'null'
    43 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').bubbles is false
    44 PASS testInitEvent('Message', '"a", true, false, "b", "c", "d", window, null').bubbles is true
    45 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').cancelable is false
    46 PASS testInitEvent('Message', '"a", false, true, "b", "c", "d", window, null').cancelable is true
    47 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').data is 'b'
    48 PASS testInitEvent('Message', '"a", false, false, null, "c", "d", window, null').data is null
    49 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').origin is 'c'
    50 PASS testInitEvent('Message', '"a", false, false, "b", null, "d", window, null').origin is 'null'
    51 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').lastEventId is 'd'
    52 PASS testInitEvent('Message', '"a", false, false, "b", "c", null, window, null').lastEventId is 'null'
    53 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, null').source is window
    54 PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", null, null').source is null
     41PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').type is 'a'
     42PASS testInitEvent('Message', 'null, false, false, "b", "c", "d", window, []').type is 'null'
     43PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').bubbles is false
     44PASS testInitEvent('Message', '"a", true, false, "b", "c", "d", window, []').bubbles is true
     45PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').cancelable is false
     46PASS testInitEvent('Message', '"a", false, true, "b", "c", "d", window, []').cancelable is true
     47PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').data is 'b'
     48PASS testInitEvent('Message', '"a", false, false, null, "c", "d", window, []').data is null
     49PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').origin is 'c'
     50PASS testInitEvent('Message', '"a", false, false, "b", null, "d", window, []').origin is 'null'
     51PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').lastEventId is 'd'
     52PASS testInitEvent('Message', '"a", false, false, "b", "c", null, window, []').lastEventId is 'null'
     53PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", window, []').source is window
     54PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", null, []').source is null
     55PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", null, []').ports is []
    5556PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", null, channelArray').ports[0] is channel.port1
    5657PASS testInitEvent('Message', '"a", false, false, "b", "c", "d", null, channelArray').ports[1] is channel.port2
  • trunk/LayoutTests/fast/events/script-tests/init-events.js

    r209895 r213517  
    5656shouldBe("testInitEvent('Keyboard', '\"a\", false, true, window, \"b\", 1001, false, false, false, false, false').which", "0");
    5757
    58 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').type", "'a'");
    59 shouldBe("testInitEvent('Message', 'null, false, false, \"b\", \"c\", \"d\", window, null').type", "'null'");
    60 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').bubbles", "false");
    61 shouldBe("testInitEvent('Message', '\"a\", true, false, \"b\", \"c\", \"d\", window, null').bubbles", "true");
    62 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').cancelable", "false");
    63 shouldBe("testInitEvent('Message', '\"a\", false, true, \"b\", \"c\", \"d\", window, null').cancelable", "true");
    64 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').data", "'b'");
    65 shouldBe("testInitEvent('Message', '\"a\", false, false, null, \"c\", \"d\", window, null').data", "null");
    66 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').origin", "'c'");
    67 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", null, \"d\", window, null').origin", "'null'");
    68 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').lastEventId", "'d'");
    69 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", null, window, null').lastEventId", "'null'");
    70 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, null').source", "window");
    71 shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", null, null').source", "null");
     58shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').type", "'a'");
     59shouldBe("testInitEvent('Message', 'null, false, false, \"b\", \"c\", \"d\", window, []').type", "'null'");
     60shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').bubbles", "false");
     61shouldBe("testInitEvent('Message', '\"a\", true, false, \"b\", \"c\", \"d\", window, []').bubbles", "true");
     62shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').cancelable", "false");
     63shouldBe("testInitEvent('Message', '\"a\", false, true, \"b\", \"c\", \"d\", window, []').cancelable", "true");
     64shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').data", "'b'");
     65shouldBe("testInitEvent('Message', '\"a\", false, false, null, \"c\", \"d\", window, []').data", "null");
     66shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').origin", "'c'");
     67shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", null, \"d\", window, []').origin", "'null'");
     68shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').lastEventId", "'d'");
     69shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", null, window, []').lastEventId", "'null'");
     70shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", window, []').source", "window");
     71shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", null, []').source", "null");
     72shouldBe("testInitEvent('Message', '\"a\", false, false, \"b\", \"c\", \"d\", null, []').ports", "[]");
    7273var channel = new MessageChannel;
    7374var channelArray = [channel.port1, channel.port2];
  • trunk/LayoutTests/fast/eventsource/eventsource-attribute-listeners.html

    r120792 r213517  
    3737es.onmessage = function (e) { flag = (e.data == "hello"); };
    3838var evt = document.createEvent("MessageEvent");
    39 evt.initMessageEvent("message", false, false, "hello", null, null, null, null);
     39evt.initMessageEvent("message", false, false, "hello", null, null, null, []);
    4040es.dispatchEvent(evt);
    4141if (flag) {
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r213489 r213517  
     12017-03-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
     4        https://bugs.webkit.org/show_bug.cgi?id=169176
     5
     6        Reviewed by Alex Christensen.
     7
     8        Re-sync web-platform tests from upstream after:
     9        - https://github.com/w3c/web-platform-tests/pull/5043
     10        - https://github.com/w3c/web-platform-tests/pull/5044
     11
     12        * web-platform-tests/dom/events/CustomEvent-expected.txt:
     13        * web-platform-tests/dom/events/CustomEvent.html:
     14        * web-platform-tests/dom/events/Event-initEvent-expected.txt:
     15        * web-platform-tests/dom/events/Event-initEvent.html:
     16        * web-platform-tests/dom/interfaces-expected.txt:
     17        * web-platform-tests/dom/interfaces.html:
     18        * web-platform-tests/html/dom/interfaces-expected.txt:
     19        * web-platform-tests/html/dom/interfaces.html:
     20        * web-platform-tests/html/dom/resources/interfaces.idl: Copied from LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html.
     21        * web-platform-tests/html/dom/resources/untested-interfaces.idl: Added.
     22        * web-platform-tests/html/webappapis/scripting/events/messageevent-constructor-expected.txt: Removed.
     23        * web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.html: Removed.
     24        * web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt:
     25        * web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html:
     26
    1272017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
    228
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent-expected.txt

    r203164 r213517  
    11
    2 PASS CustomEvent
     2PASS CustomEvent dispatching.
     3PASS First parameter to initCustomEvent should be mandatory.
     4PASS initCustomEvent's default parameter values.
    35
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/CustomEvent.html

    r203164 r213517  
    1616  fooEvent.initEvent(type, true, true);
    1717  target.dispatchEvent(fooEvent);
    18 });
     18}, "CustomEvent dispatching.");
     19
     20test(function() {
     21    var e = document.createEvent("CustomEvent");
     22    assert_throws(new TypeError(), function() {
     23        e.initCustomEvent();
     24    });
     25}, "First parameter to initCustomEvent should be mandatory.");
     26
     27test(function() {
     28    var e = document.createEvent("CustomEvent");
     29    e.initCustomEvent("foo");
     30    assert_equals(e.type, "foo", "type");
     31    assert_false(e.bubbles, "bubbles");
     32    assert_false(e.cancelable, "cancelable");
     33    assert_equals(e.detail, null, "detail");
     34}, "initCustomEvent's default parameter values.");
    1935</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent-expected.txt

    r204623 r213517  
    1010PASS Calling initEvent must unset the stop immediate propagation flag.
    1111PASS Calling initEvent during propagation.
     12PASS First parameter to initEvent should be mandatory.
     13PASS Tests initEvent's default parameter values.
    1214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-initEvent.html

    r210254 r213517  
    117117  this.done()
    118118}, "Calling initEvent during propagation.")
     119
     120test(function() {
     121  var e = document.createEvent("Event")
     122  assert_throws(new TypeError(), function() {
     123    e.initEvent()
     124  })
     125}, "First parameter to initEvent should be mandatory.")
     126
     127test(function() {
     128  var e = document.createEvent("Event")
     129  e.initEvent("type")
     130  assert_equals(e.type, "type", "type")
     131  assert_false(e.bubbles, "bubbles")
     132  assert_false(e.cancelable, "cancelable")
     133}, "Tests initEvent's default parameter values.")
    119134</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt

    r211970 r213517  
    4747PASS Event interface: document.createEvent("Event") must inherit property "timeStamp" with the proper type (15)
    4848PASS Event interface: document.createEvent("Event") must inherit property "initEvent" with the proper type (16)
    49 FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError assert_throws: Called with 1 arguments function "function () {
    50             fn.apply(obj, args);
    51         }" did not throw
     49PASS Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError
    5250PASS Event must be primary interface of new Event("foo")
    5351PASS Stringification of new Event("foo")
     
    6967PASS Event interface: new Event("foo") must inherit property "timeStamp" with the proper type (15)
    7068PASS Event interface: new Event("foo") must inherit property "initEvent" with the proper type (16)
    71 FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError assert_throws: Called with 1 arguments function "function () {
    72             fn.apply(obj, args);
    73         }" did not throw
     69PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError
    7470PASS CustomEvent interface: existence and properties of interface object
    7571PASS CustomEvent interface object length
     
    10197PASS Event interface: new CustomEvent("foo") must inherit property "timeStamp" with the proper type (15)
    10298PASS Event interface: new CustomEvent("foo") must inherit property "initEvent" with the proper type (16)
    103 FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError assert_throws: Called with 1 arguments function "function () {
    104             fn.apply(obj, args);
    105         }" did not throw
     99PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError
    106100PASS EventTarget interface: existence and properties of interface object
    107101PASS EventTarget interface object length
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces.html

    r206260 r213517  
    3535  readonly attribute DOMTimeStamp timeStamp;
    3636
    37   void initEvent(DOMString type, boolean bubbles, boolean cancelable);
     37  void initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false);
    3838};
    3939
     
    4949  readonly attribute any detail;
    5050
    51   void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
     51  void initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null);
    5252};
    5353
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt

    r213431 r213517  
    99
    1010
     11PASS Test driver
    1112PASS NodeList must be primary interface of document.getElementsByName("name")
    1213PASS Stringification of document.getElementsByName("name")
     
    938939FAIL HTMLElement interface: attribute accessKeyLabel assert_true: The prototype object must have a property "accessKeyLabel" expected true got false
    939940PASS HTMLElement interface: attribute draggable
    940 FAIL HTMLElement interface: attribute dropzone assert_true: The prototype object must have a property "dropzone" expected true got false
    941941FAIL HTMLElement interface: attribute contextMenu assert_true: The prototype object must have a property "contextMenu" expected true got false
    942942PASS HTMLElement interface: attribute spellcheck
     
    10241024FAIL HTMLElement interface: document.createElement("noscript") must inherit property "accessKeyLabel" with the proper type (11) assert_inherits: property "accessKeyLabel" not found in prototype chain
    10251025PASS HTMLElement interface: document.createElement("noscript") must inherit property "draggable" with the proper type (12)
    1026 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "dropzone" with the proper type (13) assert_inherits: property "dropzone" not found in prototype chain
    1027 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "contextMenu" with the proper type (14) assert_inherits: property "contextMenu" not found in prototype chain
    1028 PASS HTMLElement interface: document.createElement("noscript") must inherit property "spellcheck" with the proper type (15)
    1029 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "forceSpellCheck" with the proper type (16) assert_inherits: property "forceSpellCheck" not found in prototype chain
    1030 PASS HTMLElement interface: document.createElement("noscript") must inherit property "innerText" with the proper type (17)
    1031 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onabort" with the proper type (18)
    1032 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onauxclick" with the proper type (19) assert_inherits: property "onauxclick" not found in prototype chain
    1033 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onblur" with the proper type (20)
    1034 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type (21) assert_inherits: property "oncancel" not found in prototype chain
    1035 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplay" with the proper type (22)
    1036 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplaythrough" with the proper type (23)
    1037 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onchange" with the proper type (24)
    1038 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onclick" with the proper type (25)
    1039 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onclose" with the proper type (26) assert_inherits: property "onclose" not found in prototype chain
    1040 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncontextmenu" with the proper type (27)
    1041 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncuechange" with the proper type (28)
    1042 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondblclick" with the proper type (29)
    1043 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrag" with the proper type (30)
    1044 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragend" with the proper type (31)
    1045 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragenter" with the proper type (32)
    1046 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "ondragexit" with the proper type (33) assert_inherits: property "ondragexit" not found in prototype chain
    1047 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragleave" with the proper type (34)
    1048 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragover" with the proper type (35)
    1049 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragstart" with the proper type (36)
    1050 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrop" with the proper type (37)
    1051 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondurationchange" with the proper type (38)
    1052 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onemptied" with the proper type (39)
    1053 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onended" with the proper type (40)
    1054 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onerror" with the proper type (41)
    1055 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onfocus" with the proper type (42)
    1056 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninput" with the proper type (43)
    1057 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninvalid" with the proper type (44)
    1058 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeydown" with the proper type (45)
    1059 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeypress" with the proper type (46)
    1060 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeyup" with the proper type (47)
    1061 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onload" with the proper type (48)
    1062 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadeddata" with the proper type (49)
    1063 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadedmetadata" with the proper type (50)
    1064 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadstart" with the proper type (51)
    1065 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousedown" with the proper type (52)
    1066 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseenter" with the proper type (53)
    1067 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseleave" with the proper type (54)
    1068 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousemove" with the proper type (55)
    1069 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseout" with the proper type (56)
    1070 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseover" with the proper type (57)
    1071 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseup" with the proper type (58)
    1072 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousewheel" with the proper type (59)
    1073 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpause" with the proper type (60)
    1074 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplay" with the proper type (61)
    1075 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplaying" with the proper type (62)
    1076 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onprogress" with the proper type (63)
    1077 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onratechange" with the proper type (64)
    1078 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onreset" with the proper type (65)
    1079 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type (66)
    1080 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onscroll" with the proper type (67)
    1081 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeked" with the proper type (68)
    1082 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeking" with the proper type (69)
    1083 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onselect" with the proper type (70)
    1084 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onshow" with the proper type (71) assert_inherits: property "onshow" not found in prototype chain
    1085 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onstalled" with the proper type (72)
    1086 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsubmit" with the proper type (73)
    1087 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsuspend" with the proper type (74)
    1088 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontimeupdate" with the proper type (75)
    1089 PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontoggle" with the proper type (76)
    1090 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onvolumechange" with the proper type (77)
    1091 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwaiting" with the proper type (78)
    1092 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncopy" with the proper type (79)
    1093 PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncut" with the proper type (80)
    1094 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpaste" with the proper type (81)
    1095 PASS HTMLElement interface: document.createElement("noscript") must inherit property "contentEditable" with the proper type (82)
    1096 PASS HTMLElement interface: document.createElement("noscript") must inherit property "isContentEditable" with the proper type (83)
     1026FAIL HTMLElement interface: document.createElement("noscript") must inherit property "contextMenu" with the proper type (13) assert_inherits: property "contextMenu" not found in prototype chain
     1027PASS HTMLElement interface: document.createElement("noscript") must inherit property "spellcheck" with the proper type (14)
     1028FAIL HTMLElement interface: document.createElement("noscript") must inherit property "forceSpellCheck" with the proper type (15) assert_inherits: property "forceSpellCheck" not found in prototype chain
     1029PASS HTMLElement interface: document.createElement("noscript") must inherit property "innerText" with the proper type (16)
     1030PASS HTMLElement interface: document.createElement("noscript") must inherit property "onabort" with the proper type (17)
     1031FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onauxclick" with the proper type (18) assert_inherits: property "onauxclick" not found in prototype chain
     1032PASS HTMLElement interface: document.createElement("noscript") must inherit property "onblur" with the proper type (19)
     1033FAIL HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type (20) assert_inherits: property "oncancel" not found in prototype chain
     1034PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplay" with the proper type (21)
     1035PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplaythrough" with the proper type (22)
     1036PASS HTMLElement interface: document.createElement("noscript") must inherit property "onchange" with the proper type (23)
     1037PASS HTMLElement interface: document.createElement("noscript") must inherit property "onclick" with the proper type (24)
     1038FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onclose" with the proper type (25) assert_inherits: property "onclose" not found in prototype chain
     1039PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncontextmenu" with the proper type (26)
     1040PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncuechange" with the proper type (27)
     1041PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondblclick" with the proper type (28)
     1042PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrag" with the proper type (29)
     1043PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragend" with the proper type (30)
     1044PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragenter" with the proper type (31)
     1045FAIL HTMLElement interface: document.createElement("noscript") must inherit property "ondragexit" with the proper type (32) assert_inherits: property "ondragexit" not found in prototype chain
     1046PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragleave" with the proper type (33)
     1047PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragover" with the proper type (34)
     1048PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragstart" with the proper type (35)
     1049PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrop" with the proper type (36)
     1050PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondurationchange" with the proper type (37)
     1051PASS HTMLElement interface: document.createElement("noscript") must inherit property "onemptied" with the proper type (38)
     1052PASS HTMLElement interface: document.createElement("noscript") must inherit property "onended" with the proper type (39)
     1053PASS HTMLElement interface: document.createElement("noscript") must inherit property "onerror" with the proper type (40)
     1054PASS HTMLElement interface: document.createElement("noscript") must inherit property "onfocus" with the proper type (41)
     1055PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninput" with the proper type (42)
     1056PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninvalid" with the proper type (43)
     1057PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeydown" with the proper type (44)
     1058PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeypress" with the proper type (45)
     1059PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeyup" with the proper type (46)
     1060PASS HTMLElement interface: document.createElement("noscript") must inherit property "onload" with the proper type (47)
     1061PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadeddata" with the proper type (48)
     1062PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadedmetadata" with the proper type (49)
     1063PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadstart" with the proper type (50)
     1064PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousedown" with the proper type (51)
     1065PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseenter" with the proper type (52)
     1066PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseleave" with the proper type (53)
     1067PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousemove" with the proper type (54)
     1068PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseout" with the proper type (55)
     1069PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseover" with the proper type (56)
     1070PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseup" with the proper type (57)
     1071PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousewheel" with the proper type (58)
     1072PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpause" with the proper type (59)
     1073PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplay" with the proper type (60)
     1074PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplaying" with the proper type (61)
     1075PASS HTMLElement interface: document.createElement("noscript") must inherit property "onprogress" with the proper type (62)
     1076PASS HTMLElement interface: document.createElement("noscript") must inherit property "onratechange" with the proper type (63)
     1077PASS HTMLElement interface: document.createElement("noscript") must inherit property "onreset" with the proper type (64)
     1078PASS HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type (65)
     1079PASS HTMLElement interface: document.createElement("noscript") must inherit property "onscroll" with the proper type (66)
     1080PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeked" with the proper type (67)
     1081PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeking" with the proper type (68)
     1082PASS HTMLElement interface: document.createElement("noscript") must inherit property "onselect" with the proper type (69)
     1083FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onshow" with the proper type (70) assert_inherits: property "onshow" not found in prototype chain
     1084PASS HTMLElement interface: document.createElement("noscript") must inherit property "onstalled" with the proper type (71)
     1085PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsubmit" with the proper type (72)
     1086PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsuspend" with the proper type (73)
     1087PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontimeupdate" with the proper type (74)
     1088PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontoggle" with the proper type (75)
     1089PASS HTMLElement interface: document.createElement("noscript") must inherit property "onvolumechange" with the proper type (76)
     1090PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwaiting" with the proper type (77)
     1091PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncopy" with the proper type (78)
     1092PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncut" with the proper type (79)
     1093PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpaste" with the proper type (80)
     1094PASS HTMLElement interface: document.createElement("noscript") must inherit property "contentEditable" with the proper type (81)
     1095PASS HTMLElement interface: document.createElement("noscript") must inherit property "isContentEditable" with the proper type (82)
    10971096PASS Element interface: document.createElement("noscript") must inherit property "namespaceURI" with the proper type (0)
    10981097PASS Element interface: document.createElement("noscript") must inherit property "prefix" with the proper type (1)
     
    50275026PASS Window interface: attribute onstorage
    50285027PASS Window interface: attribute onunload
     5028FAIL Window interface: attribute origin assert_own_property: The global object must have a property "origin" expected property "origin" missing
    50295029PASS Window interface: operation btoa(DOMString)
    50305030PASS Window interface: operation atob(DOMString)
    5031 PASS Window interface: operation setTimeout(Function,long,any)
    5032 PASS Window interface: operation setTimeout(DOMString,long,any)
     5031PASS Window interface: operation setTimeout(TimerHandler,long,any)
    50335032PASS Window interface: operation clearTimeout(long)
    5034 PASS Window interface: operation setInterval(Function,long,any)
    5035 PASS Window interface: operation setInterval(DOMString,long,any)
     5033PASS Window interface: operation setInterval(TimerHandler,long,any)
    50365034PASS Window interface: operation clearInterval(long)
    5037 FAIL Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long) assert_own_property: global object missing non-static operation expected property "createImageBitmap" missing
     5035FAIL Window interface: operation createImageBitmap(ImageBitmapSource,ImageBitmapOptions) assert_own_property: global object missing non-static operation expected property "createImageBitmap" missing
     5036FAIL Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long,ImageBitmapOptions) assert_own_property: global object missing non-static operation expected property "createImageBitmap" missing
    50385037PASS Window interface: attribute sessionStorage
    50395038PASS Window interface: attribute localStorage
     
    51555154PASS Window interface: window must inherit property "onstorage" with the proper type (110)
    51565155PASS Window interface: window must inherit property "onunload" with the proper type (111)
    5157 PASS Window interface: window must inherit property "btoa" with the proper type (112)
     5156FAIL Window interface: window must inherit property "origin" with the proper type (112) assert_own_property: expected property "origin" missing
     5157PASS Window interface: window must inherit property "btoa" with the proper type (113)
    51585158PASS Window interface: calling btoa(DOMString) on window with too few arguments must throw TypeError
    5159 PASS Window interface: window must inherit property "atob" with the proper type (113)
     5159PASS Window interface: window must inherit property "atob" with the proper type (114)
    51605160PASS Window interface: calling atob(DOMString) on window with too few arguments must throw TypeError
    5161 PASS Window interface: window must inherit property "setTimeout" with the proper type (114)
    5162 PASS Window interface: calling setTimeout(Function,long,any) on window with too few arguments must throw TypeError
    51635161PASS Window interface: window must inherit property "setTimeout" with the proper type (115)
    5164 PASS Window interface: calling setTimeout(DOMString,long,any) on window with too few arguments must throw TypeError
     5162PASS Window interface: calling setTimeout(TimerHandler,long,any) on window with too few arguments must throw TypeError
    51655163PASS Window interface: window must inherit property "clearTimeout" with the proper type (116)
    51665164PASS Window interface: calling clearTimeout(long) on window with too few arguments must throw TypeError
    51675165PASS Window interface: window must inherit property "setInterval" with the proper type (117)
    5168 PASS Window interface: calling setInterval(Function,long,any) on window with too few arguments must throw TypeError
    5169 PASS Window interface: window must inherit property "setInterval" with the proper type (118)
    5170 PASS Window interface: calling setInterval(DOMString,long,any) on window with too few arguments must throw TypeError
    5171 PASS Window interface: window must inherit property "clearInterval" with the proper type (119)
     5166PASS Window interface: calling setInterval(TimerHandler,long,any) on window with too few arguments must throw TypeError
     5167PASS Window interface: window must inherit property "clearInterval" with the proper type (118)
    51725168PASS Window interface: calling clearInterval(long) on window with too few arguments must throw TypeError
     5169FAIL Window interface: window must inherit property "createImageBitmap" with the proper type (119) assert_own_property: expected property "createImageBitmap" missing
     5170FAIL Window interface: calling createImageBitmap(ImageBitmapSource,ImageBitmapOptions) on window with too few arguments must throw TypeError assert_own_property: expected property "createImageBitmap" missing
    51735171FAIL Window interface: window must inherit property "createImageBitmap" with the proper type (120) assert_own_property: expected property "createImageBitmap" missing
    5174 FAIL Window interface: calling createImageBitmap(ImageBitmapSource,long,long,long,long) on window with too few arguments must throw TypeError assert_own_property: expected property "createImageBitmap" missing
     5172FAIL Window interface: calling createImageBitmap(ImageBitmapSource,long,long,long,long,ImageBitmapOptions) on window with too few arguments must throw TypeError assert_own_property: expected property "createImageBitmap" missing
    51755173PASS Window interface: window must inherit property "sessionStorage" with the proper type (121)
    51765174PASS Window interface: window must inherit property "localStorage" with the proper type (122)
     
    54755473PASS MessageEvent interface: attribute source
    54765474PASS MessageEvent interface: attribute ports
    5477 FAIL MessageEvent interface: operation initMessageEvent(DOMString,boolean,boolean,any,DOMString,DOMString,[object Object],[object Object],[object Object]) assert_equals: property has wrong .length expected 8 but got 0
     5475PASS MessageEvent interface: operation initMessageEvent(DOMString,boolean,boolean,any,DOMString,DOMString,[object Object],[object Object],[object Object])
     5476PASS MessageEvent must be primary interface of new MessageEvent("message", { data: 5 })
     5477PASS Stringification of new MessageEvent("message", { data: 5 })
     5478PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "data" with the proper type (0)
     5479PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "origin" with the proper type (1)
     5480PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "lastEventId" with the proper type (2)
     5481PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "source" with the proper type (3)
     5482FAIL MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "ports" with the proper type (4) Unrecognized type [object Object]
     5483PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "initMessageEvent" with the proper type (5)
     5484PASS MessageEvent interface: calling initMessageEvent(DOMString,boolean,boolean,any,DOMString,DOMString,[object Object],[object Object],[object Object]) on new MessageEvent("message", { data: 5 }) with too few arguments must throw TypeError
     5485PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "type" with the proper type (0)
     5486PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "target" with the proper type (1)
     5487PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "currentTarget" with the proper type (2)
     5488PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "NONE" with the proper type (3)
     5489PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "CAPTURING_PHASE" with the proper type (4)
     5490PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "AT_TARGET" with the proper type (5)
     5491PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "BUBBLING_PHASE" with the proper type (6)
     5492PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "eventPhase" with the proper type (7)
     5493PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "stopPropagation" with the proper type (8)
     5494PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "stopImmediatePropagation" with the proper type (9)
     5495PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "bubbles" with the proper type (10)
     5496PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "cancelable" with the proper type (11)
     5497PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "preventDefault" with the proper type (12)
     5498PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "defaultPrevented" with the proper type (13)
     5499PASS Event interface: new MessageEvent("message", { data: 5 }) must have own property "isTrusted"
     5500PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "timeStamp" with the proper type (15)
     5501PASS Event interface: new MessageEvent("message", { data: 5 }) must inherit property "initEvent" with the proper type (16)
     5502FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new MessageEvent("message", { data: 5 }) with too few arguments must throw TypeError assert_throws: Called with 1 arguments function "function () {
     5503            fn.apply(obj, args);
     5504        }" did not throw
    54785505PASS EventSource interface: existence and properties of interface object
    54795506PASS EventSource interface object length
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces.html

    r212202 r213517  
    11<!doctype html>
    22<meta charset=utf-8>
    3 <!--  WARNING: These tests are preliminary and probably partly incorrect.   -->
     3<!-- WARNING: These tests are preliminary and probably partly incorrect.  -->
    44<title>HTML IDL tests</title>
    55<meta name=timeout content=long>
     
    1212<div id=log></div>
    1313
    14 <script type=text/plain class=untested>
    15 [Constructor(DOMString type, optional EventInit eventInitDict)/*,
    16  Exposed=(Window,Worker)*/]
    17 interface Event {
    18   readonly attribute DOMString type;
    19   readonly attribute EventTarget? target;
    20   readonly attribute EventTarget? currentTarget;
    21 
    22   const unsigned short NONE = 0;
    23   const unsigned short CAPTURING_PHASE = 1;
    24   const unsigned short AT_TARGET = 2;
    25   const unsigned short BUBBLING_PHASE = 3;
    26   readonly attribute unsigned short eventPhase;
    27 
    28   void stopPropagation();
    29   void stopImmediatePropagation();
    30 
    31   readonly attribute boolean bubbles;
    32   readonly attribute boolean cancelable;
    33   void preventDefault();
    34   readonly attribute boolean defaultPrevented;
    35 
    36   [Unforgeable] readonly attribute boolean isTrusted;
    37   readonly attribute DOMTimeStamp timeStamp;
    38 
    39   void initEvent(DOMString type, boolean bubbles, boolean cancelable);
    40 };
    41 
    42 dictionary EventInit {
    43   boolean bubbles = false;
    44   boolean cancelable = false;
    45 };
    46 
    47 [Constructor(DOMString type, optional CustomEventInit eventInitDict)/*,
    48  Exposed=(Window,Worker)*/]
    49 interface CustomEvent : Event {
    50   readonly attribute any detail;
    51 
    52   void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
    53 };
    54 
    55 dictionary CustomEventInit : EventInit {
    56   any detail = null;
    57 };
    58 
    59 //[Exposed=(Window,Worker)]
    60 interface EventTarget {
    61   void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
    62   void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
    63   boolean dispatchEvent(Event event);
    64 };
    65 
    66 callback interface EventListener {
    67   void handleEvent(Event event);
    68 };
    69 
    70 [NoInterfaceObject]
    71 interface NonElementParentNode {
    72   Element? getElementById(DOMString elementId);
    73 };
    74 Document implements NonElementParentNode;
    75 DocumentFragment implements NonElementParentNode;
    76 
    77 [NoInterfaceObject]
    78 interface ParentNode {
    79   [SameObject] readonly attribute HTMLCollection children;
    80   readonly attribute Element? firstElementChild;
    81   readonly attribute Element? lastElementChild;
    82   readonly attribute unsigned long childElementCount;
    83 
    84   [Unscopable] void prepend((Node or DOMString)... nodes);
    85   [Unscopable] void append((Node or DOMString)... nodes);
    86 
    87   Element? querySelector(DOMString selectors);
    88   [NewObject] NodeList querySelectorAll(DOMString selectors);
    89 };
    90 Document implements ParentNode;
    91 DocumentFragment implements ParentNode;
    92 Element implements ParentNode;
    93 
    94 [NoInterfaceObject]
    95 interface NonDocumentTypeChildNode {
    96   readonly attribute Element? previousElementSibling;
    97   readonly attribute Element? nextElementSibling;
    98 };
    99 Element implements NonDocumentTypeChildNode;
    100 CharacterData implements NonDocumentTypeChildNode;
    101 
    102 [NoInterfaceObject]
    103 interface ChildNode {
    104   [Unscopable] void before((Node or DOMString)... nodes);
    105   [Unscopable] void after((Node or DOMString)... nodes);
    106   [Unscopable] void replaceWith((Node or DOMString)... nodes);
    107   [Unscopable] void remove();
    108 };
    109 DocumentType implements ChildNode;
    110 Element implements ChildNode;
    111 CharacterData implements ChildNode;
    112 
    113 // XXX unrecognized tokens "class", "extends"
    114 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20020
    115 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23225
    116 //class Elements extends Array {
    117 //  Element? query(DOMString relativeSelectors);
    118 //  Elements queryAll(DOMString relativeSelectors);
    119 //};
    120 
    121 interface NodeList {
    122   getter Node? item(unsigned long index);
    123   readonly attribute unsigned long length;
    124 //  iterable<Node>;
    125 };
    126 
    127 interface HTMLCollection {
    128   readonly attribute unsigned long length;
    129   getter Element? item(unsigned long index);
    130   getter Element? namedItem(DOMString name);
    131 };
    132 
    133 [Constructor(MutationCallback callback)]
    134 interface MutationObserver {
    135   void observe(Node target, MutationObserverInit options);
    136   void disconnect();
    137   sequence<MutationRecord> takeRecords();
    138 };
    139 
    140 callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
    141 
    142 dictionary MutationObserverInit {
    143   boolean childList = false;
    144   boolean attributes;
    145   boolean characterData;
    146   boolean subtree = false;
    147   boolean attributeOldValue;
    148   boolean characterDataOldValue;
    149   sequence<DOMString> attributeFilter;
    150 };
    151 
    152 interface MutationRecord {
    153   readonly attribute DOMString type;
    154   readonly attribute Node target;
    155   [SameObject] readonly attribute NodeList addedNodes;
    156   [SameObject] readonly attribute NodeList removedNodes;
    157   readonly attribute Node? previousSibling;
    158   readonly attribute Node? nextSibling;
    159   readonly attribute DOMString? attributeName;
    160   readonly attribute DOMString? attributeNamespace;
    161   readonly attribute DOMString? oldValue;
    162 };
    163 
    164 interface Node : EventTarget {
    165   const unsigned short ELEMENT_NODE = 1;
    166   const unsigned short ATTRIBUTE_NODE = 2; // historical
    167   const unsigned short TEXT_NODE = 3;
    168   const unsigned short CDATA_SECTION_NODE = 4;
    169   const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
    170   const unsigned short ENTITY_NODE = 6; // historical
    171   const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
    172   const unsigned short COMMENT_NODE = 8;
    173   const unsigned short DOCUMENT_NODE = 9;
    174   const unsigned short DOCUMENT_TYPE_NODE = 10;
    175   const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
    176   const unsigned short NOTATION_NODE = 12; // historical
    177   readonly attribute unsigned short nodeType;
    178   readonly attribute DOMString nodeName;
    179 
    180   readonly attribute DOMString? baseURI;
    181 
    182   readonly attribute Document? ownerDocument;
    183   readonly attribute Node? parentNode;
    184   readonly attribute Element? parentElement;
    185   boolean hasChildNodes();
    186   [SameObject] readonly attribute NodeList childNodes;
    187   readonly attribute Node? firstChild;
    188   readonly attribute Node? lastChild;
    189   readonly attribute Node? previousSibling;
    190   readonly attribute Node? nextSibling;
    191 
    192            attribute DOMString? nodeValue;
    193            attribute DOMString? textContent;
    194   void normalize();
    195 
    196   [NewObject] Node cloneNode(optional boolean deep = false);
    197   boolean isEqualNode(Node? node);
    198 
    199   const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
    200   const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
    201   const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
    202   const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
    203   const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
    204   const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
    205   unsigned short compareDocumentPosition(Node other);
    206   boolean contains(Node? other);
    207 
    208   DOMString? lookupPrefix(DOMString? namespace);
    209   DOMString? lookupNamespaceURI(DOMString? prefix);
    210   boolean isDefaultNamespace(DOMString? namespace);
    211 
    212   Node insertBefore(Node node, Node? child);
    213   Node appendChild(Node node);
    214   Node replaceChild(Node node, Node child);
    215   Node removeChild(Node child);
    216 };
    217 
    218 [Constructor]
    219 interface Document : Node {
    220   [SameObject] readonly attribute DOMImplementation implementation;
    221   readonly attribute DOMString URL;
    222   readonly attribute DOMString documentURI;
    223   readonly attribute DOMString origin;
    224   readonly attribute DOMString compatMode;
    225   readonly attribute DOMString characterSet;
    226   readonly attribute DOMString charset; // legacy alias of .characterSet
    227   readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
    228   readonly attribute DOMString contentType;
    229 
    230   readonly attribute DocumentType? doctype;
    231   readonly attribute Element? documentElement;
    232   HTMLCollection getElementsByTagName(DOMString localName);
    233   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
    234   HTMLCollection getElementsByClassName(DOMString classNames);
    235 
    236   [NewObject] Element createElement(DOMString localName);
    237   [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName);
    238   [NewObject] DocumentFragment createDocumentFragment();
    239   [NewObject] Text createTextNode(DOMString data);
    240   [NewObject] CDATASection createCDATASection(DOMString data);
    241   [NewObject] Comment createComment(DOMString data);
    242   [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
    243 
    244   [NewObject] Node importNode(Node node, optional boolean deep = false);
    245   Node adoptNode(Node node);
    246 
    247   [NewObject] Attr createAttribute(DOMString localName);
    248   [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString name);
    249 
    250   [NewObject] Event createEvent(DOMString interface);
    251 
    252   [NewObject] Range createRange();
    253 
    254   // NodeFilter.SHOW_ALL = 0xFFFFFFFF
    255   [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
    256   [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
    257 };
    258 
    259 interface XMLDocument : Document {};
    260 
    261 interface DOMImplementation {
    262   [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
    263   [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
    264   [NewObject] Document createHTMLDocument(optional DOMString title);
    265 
    266   boolean hasFeature(); // useless; always returns true
    267 };
    268 
    269 [Constructor]
    270 interface DocumentFragment : Node {
    271 };
    272 
    273 interface DocumentType : Node {
    274   readonly attribute DOMString name;
    275   readonly attribute DOMString publicId;
    276   readonly attribute DOMString systemId;
    277 };
    278 
    279 interface Element : Node {
    280   readonly attribute DOMString? namespaceURI;
    281   readonly attribute DOMString? prefix;
    282   readonly attribute DOMString localName;
    283   readonly attribute DOMString tagName;
    284 
    285            attribute DOMString id;
    286            attribute DOMString className;
    287   [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
    288 
    289   boolean hasAttributes();
    290   [SameObject] readonly attribute NamedNodeMap attributes;
    291   sequence<DOMString> getAttributeNames();
    292   DOMString? getAttribute(DOMString name);
    293   DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
    294   void setAttribute(DOMString name, DOMString value);
    295   void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
    296   void removeAttribute(DOMString name);
    297   void removeAttributeNS(DOMString? namespace, DOMString localName);
    298   boolean hasAttribute(DOMString name);
    299   boolean hasAttributeNS(DOMString? namespace, DOMString localName);
    300 
    301   Attr? getAttributeNode(DOMString name);
    302   Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
    303   Attr? setAttributeNode(Attr attr);
    304   Attr? setAttributeNodeNS(Attr attr);
    305   Attr removeAttributeNode(Attr attr);
    306 
    307   Element? closest(DOMString selectors);
    308   boolean matches(DOMString selectors);
    309 
    310   HTMLCollection getElementsByTagName(DOMString localName);
    311   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
    312   HTMLCollection getElementsByClassName(DOMString classNames);
    313 };
    314 
    315 interface NamedNodeMap {
    316   readonly attribute unsigned long length;
    317   getter Attr? item(unsigned long index);
    318   getter Attr? getNamedItem(DOMString name);
    319   Attr? getNamedItemNS(DOMString? namespace, DOMString localName);
    320   Attr? setNamedItem(Attr attr);
    321   Attr? setNamedItemNS(Attr attr);
    322   Attr removeNamedItem(DOMString name);
    323   Attr removeNamedItemNS(DOMString? namespace, DOMString localName);
    324 };
    325 
    326 interface Attr {
    327   readonly attribute DOMString? namespaceURI;
    328   readonly attribute DOMString? prefix;
    329   readonly attribute DOMString localName;
    330   readonly attribute DOMString name;
    331            attribute DOMString value;
    332            attribute DOMString nodeValue; // legacy alias of .value
    333            attribute DOMString textContent; // legacy alias of .value
    334 
    335   readonly attribute Element? ownerElement;
    336 
    337   readonly attribute boolean specified; // useless; always returns true
    338 };
    339 
    340 interface CharacterData : Node {
    341   [TreatNullAs=EmptyString] attribute DOMString data;
    342   readonly attribute unsigned long length;
    343   DOMString substringData(unsigned long offset, unsigned long count);
    344   void appendData(DOMString data);
    345   void insertData(unsigned long offset, DOMString data);
    346   void deleteData(unsigned long offset, unsigned long count);
    347   void replaceData(unsigned long offset, unsigned long count, DOMString data);
    348 };
    349 
    350 [Constructor(optional DOMString data = "")]
    351 interface Text : CharacterData {
    352   [NewObject] Text splitText(unsigned long offset);
    353   readonly attribute DOMString wholeText;
    354 };
    355 
    356 [Exposed=Window]
    357 interface CDATASection : Text {
    358 };
    359 
    360 interface ProcessingInstruction : CharacterData {
    361   readonly attribute DOMString target;
    362 };
    363 
    364 [Constructor(optional DOMString data = "")]
    365 interface Comment : CharacterData {
    366 };
    367 
    368 [Constructor]
    369 interface Range {
    370   readonly attribute Node startContainer;
    371   readonly attribute unsigned long startOffset;
    372   readonly attribute Node endContainer;
    373   readonly attribute unsigned long endOffset;
    374   readonly attribute boolean collapsed;
    375   readonly attribute Node commonAncestorContainer;
    376 
    377   void setStart(Node node, unsigned long offset);
    378   void setEnd(Node node, unsigned long offset);
    379   void setStartBefore(Node node);
    380   void setStartAfter(Node node);
    381   void setEndBefore(Node node);
    382   void setEndAfter(Node node);
    383   void collapse(optional boolean toStart = false);
    384   void selectNode(Node node);
    385   void selectNodeContents(Node node);
    386 
    387   const unsigned short START_TO_START = 0;
    388   const unsigned short START_TO_END = 1;
    389   const unsigned short END_TO_END = 2;
    390   const unsigned short END_TO_START = 3;
    391   short compareBoundaryPoints(unsigned short how, Range sourceRange);
    392 
    393   void deleteContents();
    394   [NewObject] DocumentFragment extractContents();
    395   [NewObject] DocumentFragment cloneContents();
    396   void insertNode(Node node);
    397   void surroundContents(Node newParent);
    398 
    399   [NewObject] Range cloneRange();
    400   void detach();
    401 
    402   boolean isPointInRange(Node node, unsigned long offset);
    403   short comparePoint(Node node, unsigned long offset);
    404 
    405   boolean intersectsNode(Node node);
    406 
    407   stringifier;
    408 };
    409 
    410 interface NodeIterator {
    411   [SameObject] readonly attribute Node root;
    412   readonly attribute Node referenceNode;
    413   readonly attribute boolean pointerBeforeReferenceNode;
    414   readonly attribute unsigned long whatToShow;
    415   readonly attribute NodeFilter? filter;
    416 
    417   Node? nextNode();
    418   Node? previousNode();
    419 
    420   void detach();
    421 };
    422 
    423 interface TreeWalker {
    424   [SameObject] readonly attribute Node root;
    425   readonly attribute unsigned long whatToShow;
    426   readonly attribute NodeFilter? filter;
    427            attribute Node currentNode;
    428 
    429   Node? parentNode();
    430   Node? firstChild();
    431   Node? lastChild();
    432   Node? previousSibling();
    433   Node? nextSibling();
    434   Node? previousNode();
    435   Node? nextNode();
    436 };
    437 
    438 callback interface NodeFilter {
    439   // Constants for acceptNode()
    440   const unsigned short FILTER_ACCEPT = 1;
    441   const unsigned short FILTER_REJECT = 2;
    442   const unsigned short FILTER_SKIP = 3;
    443 
    444   // Constants for whatToShow
    445   const unsigned long SHOW_ALL = 0xFFFFFFFF;
    446   const unsigned long SHOW_ELEMENT = 0x1;
    447   const unsigned long SHOW_ATTRIBUTE = 0x2; // historical
    448   const unsigned long SHOW_TEXT = 0x4;
    449   const unsigned long SHOW_CDATA_SECTION = 0x8;
    450   const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical
    451   const unsigned long SHOW_ENTITY = 0x20; // historical
    452   const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40;
    453   const unsigned long SHOW_COMMENT = 0x80;
    454   const unsigned long SHOW_DOCUMENT = 0x100;
    455   const unsigned long SHOW_DOCUMENT_TYPE = 0x200;
    456   const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400;
    457   const unsigned long SHOW_NOTATION = 0x800; // historical
    458 
    459   unsigned short acceptNode(Node node);
    460 };
    461 
    462 interface DOMTokenList {
    463   readonly attribute unsigned long length;
    464   getter DOMString? item(unsigned long index);
    465   boolean contains(DOMString token);
    466   [CEReactions] void add(DOMString... tokens);
    467   [CEReactions] void remove(DOMString... tokens);
    468   [CEReactions] boolean toggle(DOMString token, optional boolean force);
    469   [CEReactions] void replace(DOMString token, DOMString newToken);
    470   boolean supports(DOMString token);
    471   [CEReactions] stringifier attribute DOMString value;
    472   //  iterable<DOMString>;
    473 };</script>
    474 <!--  UI Events IDLs  -->
    475 <script type=text/plain class=untested>
    476 [Constructor(DOMString type, optional UIEventInit eventInitDict)]
    477 interface UIEvent : Event {
    478     readonly    attribute WindowProxy? view;
    479     readonly    attribute long         detail;
    480 };
    481 
    482 dictionary UIEventInit : EventInit {
    483     WindowProxy? view = null;
    484     long         detail = 0;
    485 };
    486 
    487 [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
    488 interface MouseEvent : UIEvent {
    489     readonly    attribute long           screenX;
    490     readonly    attribute long           screenY;
    491     readonly    attribute long           clientX;
    492     readonly    attribute long           clientY;
    493     readonly    attribute boolean        ctrlKey;
    494     readonly    attribute boolean        shiftKey;
    495     readonly    attribute boolean        altKey;
    496     readonly    attribute boolean        metaKey;
    497     readonly    attribute short          button;
    498     readonly    attribute EventTarget?   relatedTarget;
    499     // Introduced in DOM Level 3
    500     readonly    attribute unsigned short buttons;
    501     boolean getModifierState (DOMString keyArg);
    502 };
    503 
    504 dictionary MouseEventInit : EventModifierInit {
    505     long           screenX = 0;
    506     long           screenY = 0;
    507     long           clientX = 0;
    508     long           clientY = 0;
    509     short          button = 0;
    510     unsigned short buttons = 0;
    511     EventTarget?   relatedTarget = null;
    512 };
    513 
    514 dictionary EventModifierInit : UIEventInit {
    515     boolean ctrlKey = false;
    516     boolean shiftKey = false;
    517     boolean altKey = false;
    518     boolean metaKey = false;
    519     boolean keyModifierStateAltGraph = false;
    520     boolean keyModifierStateCapsLock = false;
    521     boolean keyModifierStateFn = false;
    522     boolean keyModifierStateFnLock = false;
    523     boolean keyModifierStateHyper = false;
    524     boolean keyModifierStateNumLock = false;
    525     boolean keyModifierStateOS = false;
    526     boolean keyModifierStateScrollLock = false;
    527     boolean keyModifierStateSuper = false;
    528     boolean keyModifierStateSymbol = false;
    529     boolean keyModifierStateSymbolLock = false;
    530 };
    531 
    532 partial interface MouseEvent {
    533     // Deprecated in DOM Level 3
    534     void initMouseEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, boolean ctrlKeyArg, boolean altKeyArg, boolean shiftKeyArg, boolean metaKeyArg, short buttonArg, EventTarget? relatedTargetArg);
    535 };
    536 </script>
    537 <!--  Touch Events IDLs  -->
    538 <script type=text/plain class=untested>
    539 interface Touch {
    540     readonly    attribute long        identifier;
    541     readonly    attribute EventTarget target;
    542     readonly    attribute long        screenX;
    543     readonly    attribute long        screenY;
    544     readonly    attribute long        clientX;
    545     readonly    attribute long        clientY;
    546     readonly    attribute long        pageX;
    547     readonly    attribute long        pageY;
    548 };
    549 </script>
    550 <!--  CSSOM IDLs  -->
    551 <script type=text/plain class=untested>
    552 interface MediaList {
    553   stringifier attribute DOMString mediaText;
    554   readonly attribute unsigned long length;
    555   getter DOMString item(unsigned long index);
    556   void appendMedium(DOMString medium);
    557   void deleteMedium(DOMString medium);
    558 };
    559 
    560 interface StyleSheet {
    561   readonly attribute DOMString type;
    562   readonly attribute DOMString href;
    563   readonly attribute Node ownerNode;
    564   readonly attribute StyleSheet parentStyleSheet;
    565   readonly attribute DOMString title;
    566   [PutForwards=mediaText] readonly attribute MediaList media;
    567            attribute boolean disabled;
    568 };
    569 
    570 interface CSSStyleSheet : StyleSheet {
    571   readonly attribute CSSRule ownerRule;
    572   readonly attribute CSSRuleList cssRules;
    573   unsigned long insertRule(DOMString rule, unsigned long index);
    574   void deleteRule(unsigned long index);
    575 };
    576 
    577 typedef sequence<StyleSheet> StyleSheetList;
    578 
    579 partial interface Document {
    580   [SameObject] readonly attribute StyleSheetList styleSheets;
    581 };
    582 
    583 [NoInterfaceObject] interface LinkStyle {
    584   readonly attribute StyleSheet sheet;
    585 };
    586 
    587 ProcessingInstruction implements LinkStyle;
    588 
    589 typedef sequence<CSSRule> CSSRuleList;
    590 
    591 interface CSSRule {
    592   // Types
    593   const unsigned short STYLE_RULE = 1;
    594   const unsigned short IMPORT_RULE = 3;
    595   const unsigned short MEDIA_RULE = 4;
    596   const unsigned short FONT_FACE_RULE = 5;
    597   const unsigned short PAGE_RULE = 6;
    598   const unsigned short NAMESPACE_RULE = 10;
    599   readonly attribute unsigned short type;
    600 
    601   // Parsing and serialization
    602            attribute DOMString cssText;
    603 
    604   // Context
    605   readonly attribute CSSRule parentRule;
    606   readonly attribute CSSStyleSheet parentStyleSheet;
    607 };
    608 
    609 interface CSSStyleRule : CSSRule {
    610            attribute DOMString selectorText;
    611   readonly attribute CSSStyleDeclaration style;
    612 };
    613 
    614 interface CSSImportRule : CSSRule {
    615   readonly attribute DOMString href;
    616   [PutForwards=mediaText] readonly attribute MediaList media;
    617   readonly attribute CSSStyleSheet styleSheet;
    618 };
    619 
    620 interface CSSMediaRule : CSSRule {
    621   [PutForwards=mediaText] readonly attribute MediaList media;
    622   readonly attribute CSSRuleList cssRules;
    623   unsigned long insertRule(DOMString rule, unsigned long index);
    624   void deleteRule(unsigned long index);
    625 };
    626 
    627 interface CSSFontFaceRule : CSSRule {
    628   readonly attribute CSSStyleDeclaration style;
    629 };
    630 
    631 interface CSSPageRule : CSSRule {
    632            attribute DOMString selectorText;
    633   readonly attribute CSSStyleDeclaration style;
    634 };
    635 
    636 interface CSSNamespaceRule : CSSRule {
    637   readonly attribute DOMString namespaceURI;
    638   readonly attribute DOMString? prefix;
    639 };
    640 
    641 interface CSSStyleDeclaration {
    642            attribute DOMString cssText;
    643 
    644   readonly attribute unsigned long length;
    645   DOMString item(unsigned long index);
    646 
    647   DOMString getPropertyValue(DOMString property);
    648   DOMString getPropertyPriority(DOMString property);
    649   void setProperty(DOMString property, DOMString value, optional DOMString priority);
    650   DOMString removeProperty(DOMString property);
    651 
    652   readonly attribute CSSStyleDeclarationValue values;
    653 
    654   readonly attribute CSSRule parentRule;
    655 
    656   // CSS Properties
    657            attribute DOMString azimuth;
    658            attribute DOMString background;
    659            attribute DOMString backgroundAttachment;
    660            attribute DOMString backgroundColor;
    661            attribute DOMString backgroundImage;
    662            attribute DOMString backgroundPosition;
    663            attribute DOMString backgroundRepeat;
    664            attribute DOMString border;
    665            attribute DOMString borderCollapse;
    666            attribute DOMString borderColor;
    667            attribute DOMString borderSpacing;
    668            attribute DOMString borderStyle;
    669            attribute DOMString borderTop;
    670            attribute DOMString borderRight;
    671            attribute DOMString borderBottom;
    672            attribute DOMString borderLeft;
    673            attribute DOMString borderTopColor;
    674            attribute DOMString borderRightColor;
    675            attribute DOMString borderBottomColor;
    676            attribute DOMString borderLeftColor;
    677            attribute DOMString borderTopStyle;
    678            attribute DOMString borderRightStyle;
    679            attribute DOMString borderBottomStyle;
    680            attribute DOMString borderLeftStyle;
    681            attribute DOMString borderTopWidth;
    682            attribute DOMString borderRightWidth;
    683            attribute DOMString borderBottomWidth;
    684            attribute DOMString borderLeftWidth;
    685            attribute DOMString borderWidth;
    686            attribute DOMString bottom;
    687            attribute DOMString captionSide;
    688            attribute DOMString clear;
    689            attribute DOMString clip;
    690            attribute DOMString color;
    691            attribute DOMString content;
    692            attribute DOMString counterIncrement;
    693            attribute DOMString counterReset;
    694            attribute DOMString cue;
    695            attribute DOMString cueAfter;
    696            attribute DOMString cueBefore;
    697            attribute DOMString cursor;
    698            attribute DOMString direction;
    699            attribute DOMString display;
    700            attribute DOMString elevation;
    701            attribute DOMString emptyCells;
    702            attribute DOMString cssFloat;
    703            attribute DOMString font;
    704            attribute DOMString fontFamily;
    705            attribute DOMString fontSize;
    706            attribute DOMString fontSizeAdjust;
    707            attribute DOMString fontStretch;
    708            attribute DOMString fontStyle;
    709            attribute DOMString fontVariant;
    710            attribute DOMString fontWeight;
    711            attribute DOMString height;
    712            attribute DOMString left;
    713            attribute DOMString letterSpacing;
    714            attribute DOMString lineHeight;
    715            attribute DOMString listStyle;
    716            attribute DOMString listStyleImage;
    717            attribute DOMString listStylePosition;
    718            attribute DOMString listStyleType;
    719            attribute DOMString margin;
    720            attribute DOMString marginTop;
    721            attribute DOMString marginRight;
    722            attribute DOMString marginBottom;
    723            attribute DOMString marginLeft;
    724            attribute DOMString marks;
    725            attribute DOMString maxHeight;
    726            attribute DOMString maxWidth;
    727            attribute DOMString minHeight;
    728            attribute DOMString minWidth;
    729            attribute DOMString orphans;
    730            attribute DOMString outline;
    731            attribute DOMString outlineColor;
    732            attribute DOMString outlineStyle;
    733            attribute DOMString outlineWidth;
    734            attribute DOMString overflow;
    735            attribute DOMString padding;
    736            attribute DOMString paddingTop;
    737            attribute DOMString paddingRight;
    738            attribute DOMString paddingBottom;
    739            attribute DOMString paddingLeft;
    740            attribute DOMString page;
    741            attribute DOMString pageBreakAfter;
    742            attribute DOMString pageBreakBefore;
    743            attribute DOMString pageBreakInside;
    744            attribute DOMString pause;
    745            attribute DOMString pauseAfter;
    746            attribute DOMString pauseBefore;
    747            attribute DOMString pitch;
    748            attribute DOMString pitchRange;
    749            attribute DOMString playDuring;
    750            attribute DOMString position;
    751            attribute DOMString quotes;
    752            attribute DOMString richness;
    753            attribute DOMString right;
    754            attribute DOMString size;
    755            attribute DOMString speak;
    756            attribute DOMString speakHeader;
    757            attribute DOMString speakNumeral;
    758            attribute DOMString speakPunctuation;
    759            attribute DOMString speechRate;
    760            attribute DOMString stress;
    761            attribute DOMString tableLayout;
    762            attribute DOMString textAlign;
    763            attribute DOMString textDecoration;
    764            attribute DOMString textIndent;
    765            attribute DOMString textShadow;
    766            attribute DOMString textTransform;
    767            attribute DOMString top;
    768            attribute DOMString unicodeBidi;
    769            attribute DOMString verticalAlign;
    770            attribute DOMString visibility;
    771            attribute DOMString voiceFamily;
    772            attribute DOMString volume;
    773            attribute DOMString whiteSpace;
    774            attribute DOMString widows;
    775            attribute DOMString width;
    776            attribute DOMString wordSpacing;
    777            attribute DOMString zIndex;
    778 };
    779 
    780 interface CSSStyleDeclarationValue {
    781   // ...
    782 
    783   // CSS Properties
    784 
    785 };
    786 
    787 interface CSSPropertyValue {
    788            attribute DOMString cssText;
    789 };
    790 
    791 [NoInterfaceObject] interface CSSMapValue {
    792   getter CSSValue (DOMString name);
    793 };
    794 
    795 [NoInterfaceObject] interface CSSPropertyValueList {
    796   readonly attribute CSSValue[] list;
    797 };
    798 
    799 [NoInterfaceObject] interface CSSComponentValue {
    800   readonly attribute DOMString type;
    801            attribute any value;
    802 };
    803 
    804 [NoInterfaceObject] interface CSSStringComponentValue {
    805            attribute DOMString string;
    806 };
    807 
    808 [NoInterfaceObject] interface CSSKeywordComponentValue {
    809            attribute DOMString keyword;
    810 };
    811 
    812 [NoInterfaceObject] interface CSSIdentifierComponentValue {
    813            attribute DOMString identifier;
    814 };
    815 
    816 [NoInterfaceObject] interface CSSColorComponentValue {
    817            attribute short red;
    818            attribute short green;
    819            attribute short blue;
    820            attribute float alpha;
    821 };
    822 
    823 [NoInterfaceObject] interface CSSLengthComponentValue {
    824            attribute float em;
    825            attribute float ex;
    826            attribute float px;
    827            // figure out what to do with absolute lengths
    828 };
    829 
    830 [NoInterfaceObject] interface CSSPercentageComponentValue {
    831            attribute float percent;
    832 };
    833 
    834 [NoInterfaceObject] interface CSSURLComponentValue {
    835            attribute DOMString? url;
    836 };
    837 
    838 [NoInterfaceObject] interface ElementCSSInlineStyle {
    839   readonly attribute CSSStyleDeclaration style;
    840 };
    841 
    842 //partial interface Window {
    843 //  CSSStyleDeclaration getComputedStyle(Element elt);
    844 //  CSSStyleDeclaration getComputedStyle(Element elt, DOMString pseudoElt);
    845 //};
    846 </script>
    847 
    848 <!--  HTML IDLs  -->
    849 <script type=text/plain>
    850 typedef (Int8Array or Uint8Array or Uint8ClampedArray or
    851          Int16Array or Uint16Array or
    852          Int32Array or Uint32Array or
    853          Float32Array or Float64Array or
    854          DataView) ArrayBufferView;
    855 
    856 [NoInterfaceObject, Exposed=Window]
    857 interface HTMLHyperlinkElementUtils {
    858   stringifier attribute USVString href;
    859   readonly attribute USVString origin;
    860            attribute USVString protocol;
    861            attribute USVString username;
    862            attribute USVString password;
    863            attribute USVString host;
    864            attribute USVString hostname;
    865            attribute USVString port;
    866            attribute USVString pathname;
    867            attribute USVString search;
    868            attribute USVString hash;
    869 };
    870 
    871 interface HTMLAllCollection {
    872   readonly attribute unsigned long length;
    873   getter Element? item(unsigned long index);
    874   (HTMLCollection or Element)? item(DOMString name);
    875   legacycaller getter (HTMLCollection or Element)? namedItem(DOMString name);
    876 };
    877 
    878 interface HTMLFormControlsCollection : HTMLCollection {
    879   // inherits length and item()
    880   getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
    881 };
    882 
    883 interface RadioNodeList : NodeList {
    884           attribute DOMString value;
    885 };
    886 
    887 interface HTMLOptionsCollection : HTMLCollection {
    888   // inherits item(), namedItem()
    889   attribute unsigned long length; // shadows inherited length
    890   [CEReactions] setter void (unsigned long index, HTMLOptionElement? option);
    891   [CEReactions] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
    892   [CEReactions] void remove(long index);
    893   attribute long selectedIndex;
    894 };
    895 
    896 typedef sequence<any> PropertyValueArray;
    897 
    898 [OverrideBuiltins, Exposed=(Window,Worker)]
    899 interface DOMStringMap {
    900   getter DOMString (DOMString name);
    901   setter creator void (DOMString name, DOMString value);
    902   deleter void (DOMString name);
    903 };
    904 
    905 typedef (ArrayBuffer or MessagePort) Transferable;
    906 
    907 callback FileCallback = void (File file);
    908 
    909 enum DocumentReadyState { "loading", "interactive", "complete" };
    910 typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
    911 
    912 [OverrideBuiltins]
    913 partial /*sealed*/ interface Document {
    914   // resource metadata management
    915   [PutForwards=href, Unforgeable] readonly attribute Location? location;
    916            attribute USVString domain;
    917   readonly attribute USVString referrer;
    918            attribute USVString cookie;
    919   readonly attribute DOMString lastModified;
    920   readonly attribute DocumentReadyState readyState;
    921 
    922   // DOM tree accessors
    923   getter object (DOMString name);
    924   [CEReactions] attribute DOMString title;
    925   [CEReactions] attribute DOMString dir;
    926   [CEReactions] attribute HTMLElement? body;
    927   readonly attribute HTMLHeadElement? head;
    928   [SameObject] readonly attribute HTMLCollection images;
    929   [SameObject] readonly attribute HTMLCollection embeds;
    930   [SameObject] readonly attribute HTMLCollection plugins;
    931   [SameObject] readonly attribute HTMLCollection links;
    932   [SameObject] readonly attribute HTMLCollection forms;
    933   [SameObject] readonly attribute HTMLCollection scripts;
    934   NodeList getElementsByName(DOMString elementName);
    935   readonly attribute HTMLOrSVGScriptElement? currentScript; // classic scripts in a document tree only
    936 
    937   // dynamic markup insertion
    938   [CEReactions] Document open(optional DOMString type = "text/html", optional DOMString replace = "");
    939   WindowProxy open(USVString url, DOMString name, DOMString features);
    940   [CEReactions] void close();
    941   [CEReactions] void write(DOMString... text);
    942   [CEReactions] void writeln(DOMString... text);
    943 
    944   // user interaction
    945   readonly attribute WindowProxy? defaultView;
    946   readonly attribute Element? activeElement;
    947   boolean hasFocus();
    948   [CEReactions] attribute DOMString designMode;
    949   [CEReactions] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = "");
    950   boolean queryCommandEnabled(DOMString commandId);
    951   boolean queryCommandIndeterm(DOMString commandId);
    952   boolean queryCommandState(DOMString commandId);
    953   boolean queryCommandSupported(DOMString commandId);
    954   DOMString queryCommandValue(DOMString commandId);
    955 
    956   // special event handler IDL attributes that only apply to Document objects
    957   [LenientThis] attribute EventHandler onreadystatechange;
    958 
    959   // also has obsolete members
    960 };
    961 Document implements GlobalEventHandlers;
    962 Document implements DocumentAndElementEventHandlers;
    963 
    964 [NoInterfaceObject]
    965 interface ElementContentEditable {
    966   [CEReactions] attribute DOMString contentEditable;
    967   readonly attribute boolean isContentEditable;
    968 };
    969 
    970 interface HTMLElement : Element {
    971   // metadata attributes
    972   [CEReactions] attribute DOMString title;
    973   [CEReactions] attribute DOMString lang;
    974   [CEReactions] attribute boolean translate;
    975   [CEReactions] attribute DOMString dir;
    976   [SameObject] readonly attribute DOMStringMap dataset;
    977 
    978   // user interaction
    979   [CEReactions] attribute boolean hidden;
    980   void click();
    981   [CEReactions] attribute long tabIndex;
    982   void focus();
    983   void blur();
    984   [CEReactions] attribute DOMString accessKey;
    985   readonly attribute DOMString accessKeyLabel;
    986   [CEReactions] attribute boolean draggable;
    987   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList dropzone;
    988   [CEReactions] attribute HTMLMenuElement? contextMenu;
    989   [CEReactions] attribute boolean spellcheck;
    990   void forceSpellCheck();
    991 
    992   [CEReactions, TreatNullAs=EmptyString] attribute DOMString innerText;
    993 };
    994 HTMLElement implements GlobalEventHandlers;
    995 HTMLElement implements DocumentAndElementEventHandlers;
    996 HTMLElement implements ElementContentEditable;
    997 
    998 interface HTMLUnknownElement : HTMLElement { };
    999 
    1000 interface HTMLHtmlElement : HTMLElement {
    1001   // also has obsolete members
    1002 };
    1003 
    1004 interface HTMLHeadElement : HTMLElement {};
    1005 
    1006 interface HTMLTitleElement : HTMLElement {
    1007            attribute DOMString text;
    1008 };
    1009 
    1010 interface HTMLBaseElement : HTMLElement {
    1011            attribute DOMString href;
    1012            attribute DOMString target;
    1013 };
    1014 
    1015 [HTMLConstructor]
    1016 interface HTMLLinkElement : HTMLElement {
    1017   [CEReactions] attribute USVString href;
    1018   [CEReactions] attribute DOMString? crossOrigin;
    1019   [CEReactions] attribute DOMString rel;
    1020   // [CEReactions] attribute RequestDestination as; // (default "") XXX TODO
    1021   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
    1022   [CEReactions] attribute DOMString media;
    1023   [CEReactions] attribute DOMString nonce;
    1024   [CEReactions] attribute DOMString integrity;
    1025   [CEReactions] attribute DOMString hreflang;
    1026   [CEReactions] attribute DOMString type;
    1027   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList sizes;
    1028   [CEReactions] attribute DOMString referrerPolicy;
    1029 
    1030   // also has obsolete members
    1031 };
    1032 HTMLLinkElement implements LinkStyle;
    1033 
    1034 interface HTMLMetaElement : HTMLElement {
    1035            attribute DOMString name;
    1036            attribute DOMString httpEquiv;
    1037            attribute DOMString content;
    1038 
    1039   // also has obsolete members
    1040 };
    1041 
    1042 interface HTMLStyleElement : HTMLElement {
    1043   [CEReactions] attribute DOMString media;
    1044   [CEReactions] attribute DOMString nonce;
    1045   [CEReactions] attribute DOMString type;
    1046 };
    1047 HTMLStyleElement implements LinkStyle;
    1048 
    1049 interface HTMLBodyElement : HTMLElement {
    1050 
    1051   // also has obsolete members
    1052 };
    1053 HTMLBodyElement implements WindowEventHandlers;
    1054 
    1055 interface HTMLHeadingElement : HTMLElement {
    1056   // also has obsolete members
    1057 };
    1058 
    1059 interface HTMLParagraphElement : HTMLElement {
    1060   // also has obsolete members
    1061 };
    1062 
    1063 interface HTMLHRElement : HTMLElement {
    1064   // also has obsolete members
    1065 };
    1066 
    1067 interface HTMLPreElement : HTMLElement {
    1068   // also has obsolete members
    1069 };
    1070 
    1071 interface HTMLQuoteElement : HTMLElement {
    1072            attribute DOMString cite;
    1073 };
    1074 
    1075 interface HTMLOListElement : HTMLElement {
    1076            attribute boolean reversed;
    1077            attribute long start;
    1078            attribute DOMString type;
    1079 
    1080   // also has obsolete members
    1081 };
    1082 
    1083 interface HTMLUListElement : HTMLElement {
    1084   // also has obsolete members
    1085 };
    1086 
    1087 interface HTMLLIElement : HTMLElement {
    1088            attribute long value;
    1089 
    1090   // also has obsolete members
    1091 };
    1092 
    1093 interface HTMLDListElement : HTMLElement {
    1094   // also has obsolete members
    1095 };
    1096 
    1097 interface HTMLDivElement : HTMLElement {
    1098   // also has obsolete members
    1099 };
    1100 
    1101 [HTMLConstructor]
    1102 interface HTMLAnchorElement : HTMLElement {
    1103   [CEReactions] attribute DOMString target;
    1104   [CEReactions] attribute DOMString download;
    1105   [CEReactions] attribute USVString ping;
    1106   [CEReactions] attribute DOMString rel;
    1107   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
    1108   [CEReactions] attribute DOMString hreflang;
    1109   [CEReactions] attribute DOMString type;
    1110 
    1111   [CEReactions] attribute DOMString text;
    1112 
    1113   [CEReactions] attribute DOMString referrerPolicy;
    1114 
    1115   // also has obsolete members
    1116 };
    1117 HTMLAnchorElement implements HTMLHyperlinkElementUtils;
    1118 
    1119 interface HTMLDataElement : HTMLElement {
    1120            attribute DOMString value;
    1121 };
    1122 
    1123 interface HTMLTimeElement : HTMLElement {
    1124            attribute DOMString dateTime;
    1125 };
    1126 
    1127 interface HTMLSpanElement : HTMLElement {};
    1128 
    1129 interface HTMLBRElement : HTMLElement {
    1130   // also has obsolete members
    1131 };
    1132 
    1133 interface HTMLModElement : HTMLElement {
    1134            attribute DOMString cite;
    1135            attribute DOMString dateTime;
    1136 };
    1137 
    1138 interface HTMLPictureElement : HTMLElement {};
    1139 
    1140 partial interface HTMLSourceElement {
    1141            attribute DOMString srcset;
    1142            attribute DOMString sizes;
    1143            attribute DOMString media;
    1144 };
    1145 
    1146 [HTMLConstructor, NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
    1147 interface HTMLImageElement : HTMLElement {
    1148   [CEReactions] attribute DOMString alt;
    1149   [CEReactions] attribute USVString src;
    1150   [CEReactions] attribute USVString srcset;
    1151   [CEReactions] attribute DOMString sizes;
    1152   [CEReactions] attribute DOMString? crossOrigin;
    1153   [CEReactions] attribute DOMString useMap;
    1154   [CEReactions] attribute boolean isMap;
    1155   [CEReactions] attribute unsigned long width;
    1156   [CEReactions] attribute unsigned long height;
    1157   readonly attribute unsigned long naturalWidth;
    1158   readonly attribute unsigned long naturalHeight;
    1159   readonly attribute boolean complete;
    1160   readonly attribute USVString currentSrc;
    1161   [CEReactions] attribute DOMString referrerPolicy;
    1162 
    1163   // also has obsolete members
    1164 };
    1165 
    1166 [HTMLConstructor]
    1167 interface HTMLIFrameElement : HTMLElement {
    1168   [CEReactions] attribute USVString src;
    1169   [CEReactions] attribute DOMString srcdoc;
    1170   [CEReactions] attribute DOMString name;
    1171   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox;
    1172   [CEReactions] attribute boolean allowFullscreen;
    1173   [CEReactions] attribute boolean allowUserMedia;
    1174   [CEReactions] attribute boolean allowPaymentRequest;
    1175   [CEReactions] attribute DOMString width;
    1176   [CEReactions] attribute DOMString height;
    1177   [CEReactions] attribute DOMString referrerPolicy;
    1178   readonly attribute Document? contentDocument;
    1179   readonly attribute WindowProxy? contentWindow;
    1180   Document? getSVGDocument();
    1181 };
    1182 
    1183 interface HTMLEmbedElement : HTMLElement {
    1184            attribute DOMString src;
    1185            attribute DOMString type;
    1186            attribute DOMString width;
    1187            attribute DOMString height;
    1188   Document getSVGDocument();
    1189 
    1190   // also has obsolete members
    1191 };
    1192 
    1193 interface HTMLObjectElement : HTMLElement {
    1194            attribute DOMString data;
    1195            attribute DOMString type;
    1196            attribute boolean typeMustMatch;
    1197            attribute DOMString name;
    1198            attribute DOMString useMap;
    1199   readonly attribute HTMLFormElement? form;
    1200            attribute DOMString width;
    1201            attribute DOMString height;
    1202   readonly attribute Document? contentDocument;
    1203   readonly attribute WindowProxy? contentWindow;
    1204 
    1205   readonly attribute boolean willValidate;
    1206   readonly attribute ValidityState validity;
    1207   readonly attribute DOMString validationMessage;
    1208   boolean checkValidity();
    1209   boolean reportValidity();
    1210   void setCustomValidity(DOMString error);
    1211 
    1212   // also has obsolete members
    1213 };
    1214 
    1215 interface HTMLParamElement : HTMLElement {
    1216            attribute DOMString name;
    1217            attribute DOMString value;
    1218 
    1219   // also has obsolete members
    1220 };
    1221 
    1222 interface HTMLVideoElement : HTMLMediaElement {
    1223            attribute unsigned long width;
    1224            attribute unsigned long height;
    1225   readonly attribute unsigned long videoWidth;
    1226   readonly attribute unsigned long videoHeight;
    1227            attribute DOMString poster;
    1228 };
    1229 
    1230 [NamedConstructor=Audio(optional DOMString src)]
    1231 interface HTMLAudioElement : HTMLMediaElement {};
    1232 
    1233 interface HTMLSourceElement : HTMLElement {
    1234            attribute DOMString src;
    1235            attribute DOMString type;
    1236 
    1237   // also has obsolete members
    1238 };
    1239 
    1240 interface HTMLTrackElement : HTMLElement {
    1241            attribute DOMString kind;
    1242            attribute DOMString src;
    1243            attribute DOMString srclang;
    1244            attribute DOMString label;
    1245            attribute boolean default;
    1246 
    1247   const unsigned short NONE = 0;
    1248   const unsigned short LOADING = 1;
    1249   const unsigned short LOADED = 2;
    1250   const unsigned short ERROR = 3;
    1251   readonly attribute unsigned short readyState;
    1252 
    1253   readonly attribute TextTrack track;
    1254 };
    1255 
    1256 enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
    1257 interface HTMLMediaElement : HTMLElement {
    1258 
    1259   // error state
    1260   readonly attribute MediaError? error;
    1261 
    1262   // network state
    1263            attribute DOMString src;
    1264   readonly attribute DOMString currentSrc;
    1265            attribute DOMString? crossOrigin;
    1266   const unsigned short NETWORK_EMPTY = 0;
    1267   const unsigned short NETWORK_IDLE = 1;
    1268   const unsigned short NETWORK_LOADING = 2;
    1269   const unsigned short NETWORK_NO_SOURCE = 3;
    1270   readonly attribute unsigned short networkState;
    1271            attribute DOMString preload;
    1272   readonly attribute TimeRanges buffered;
    1273   void load();
    1274   CanPlayTypeResult canPlayType(DOMString type);
    1275 
    1276   // ready state
    1277   const unsigned short HAVE_NOTHING = 0;
    1278   const unsigned short HAVE_METADATA = 1;
    1279   const unsigned short HAVE_CURRENT_DATA = 2;
    1280   const unsigned short HAVE_FUTURE_DATA = 3;
    1281   const unsigned short HAVE_ENOUGH_DATA = 4;
    1282   readonly attribute unsigned short readyState;
    1283   readonly attribute boolean seeking;
    1284 
    1285   // playback state
    1286            attribute double currentTime;
    1287   void fastSeek(double time);
    1288   readonly attribute unrestricted double duration;
    1289   Date getStartDate();
    1290   readonly attribute boolean paused;
    1291            attribute double defaultPlaybackRate;
    1292            attribute double playbackRate;
    1293   readonly attribute TimeRanges played;
    1294   readonly attribute TimeRanges seekable;
    1295   readonly attribute boolean ended;
    1296            attribute boolean autoplay;
    1297            attribute boolean loop;
    1298   Promise<void> play();
    1299   void pause();
    1300 
    1301   // controls
    1302            attribute boolean controls;
    1303            attribute double volume;
    1304            attribute boolean muted;
    1305            attribute boolean defaultMuted;
    1306 
    1307   // tracks
    1308   readonly attribute AudioTrackList audioTracks;
    1309   readonly attribute VideoTrackList videoTracks;
    1310   readonly attribute TextTrackList textTracks;
    1311   TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
    1312 };
    1313 
    1314 interface MediaError {
    1315   const unsigned short MEDIA_ERR_ABORTED = 1;
    1316   const unsigned short MEDIA_ERR_NETWORK = 2;
    1317   const unsigned short MEDIA_ERR_DECODE = 3;
    1318   const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
    1319   readonly attribute unsigned short code;
    1320   readonly attribute DOMString message;
    1321 };
    1322 
    1323 interface AudioTrackList : EventTarget {
    1324   readonly attribute unsigned long length;
    1325   getter AudioTrack (unsigned long index);
    1326   AudioTrack? getTrackById(DOMString id);
    1327 
    1328            attribute EventHandler onchange;
    1329            attribute EventHandler onaddtrack;
    1330            attribute EventHandler onremovetrack;
    1331 };
    1332 
    1333 interface AudioTrack {
    1334   readonly attribute DOMString id;
    1335   readonly attribute DOMString kind;
    1336   readonly attribute DOMString label;
    1337   readonly attribute DOMString language;
    1338            attribute boolean enabled;
    1339 };
    1340 
    1341 interface VideoTrackList : EventTarget {
    1342   readonly attribute unsigned long length;
    1343   getter VideoTrack (unsigned long index);
    1344   VideoTrack? getTrackById(DOMString id);
    1345   readonly attribute long selectedIndex;
    1346 
    1347            attribute EventHandler onchange;
    1348            attribute EventHandler onaddtrack;
    1349            attribute EventHandler onremovetrack;
    1350 };
    1351 
    1352 interface VideoTrack {
    1353   readonly attribute DOMString id;
    1354   readonly attribute DOMString kind;
    1355   readonly attribute DOMString label;
    1356   readonly attribute DOMString language;
    1357            attribute boolean selected;
    1358 };
    1359 
    1360 interface TextTrackList : EventTarget {
    1361   readonly attribute unsigned long length;
    1362   getter TextTrack (unsigned long index);
    1363   TextTrack? getTrackById(DOMString id);
    1364 
    1365            attribute EventHandler onchange;
    1366            attribute EventHandler onaddtrack;
    1367            attribute EventHandler onremovetrack;
    1368 };
    1369 
    1370 enum TextTrackMode { "disabled",  "hidden",  "showing" };
    1371 enum TextTrackKind { "subtitles",  "captions",  "descriptions",  "chapters",  "metadata" };
    1372 interface TextTrack : EventTarget {
    1373   readonly attribute TextTrackKind kind;
    1374   readonly attribute DOMString label;
    1375   readonly attribute DOMString language;
    1376 
    1377   readonly attribute DOMString id;
    1378   readonly attribute DOMString inBandMetadataTrackDispatchType;
    1379 
    1380            attribute TextTrackMode mode;
    1381 
    1382   readonly attribute TextTrackCueList? cues;
    1383   readonly attribute TextTrackCueList? activeCues;
    1384 
    1385   void addCue(TextTrackCue cue);
    1386   void removeCue(TextTrackCue cue);
    1387 
    1388            attribute EventHandler oncuechange;
    1389 };
    1390 
    1391 interface TextTrackCueList {
    1392   readonly attribute unsigned long length;
    1393   getter TextTrackCue (unsigned long index);
    1394   TextTrackCue? getCueById(DOMString id);
    1395 };
    1396 
    1397 interface TextTrackCue : EventTarget {
    1398   readonly attribute TextTrack? track;
    1399 
    1400            attribute DOMString id;
    1401            attribute double startTime;
    1402            attribute double endTime;
    1403            attribute boolean pauseOnExit;
    1404 
    1405            attribute EventHandler onenter;
    1406            attribute EventHandler onexit;
    1407 };
    1408 
    1409 interface TimeRanges {
    1410   readonly attribute unsigned long length;
    1411   double start(unsigned long index);
    1412   double end(unsigned long index);
    1413 };
    1414 
    1415 [Constructor(DOMString type, optional TrackEventInit eventInitDict)]
    1416 interface TrackEvent : Event {
    1417   readonly attribute (VideoTrack or AudioTrack or TextTrack) track;
    1418 };
    1419 
    1420 dictionary TrackEventInit : EventInit {
    1421   (VideoTrack or AudioTrack or TextTrack) track;
    1422 };
    1423 
    1424 interface HTMLMapElement : HTMLElement {
    1425            attribute DOMString name;
    1426   readonly attribute HTMLCollection areas;
    1427 };
    1428 
    1429 [HTMLConstructor]
    1430 interface HTMLAreaElement : HTMLElement {
    1431   [CEReactions] attribute DOMString alt;
    1432   [CEReactions] attribute DOMString coords;
    1433   [CEReactions] attribute DOMString shape;
    1434   [CEReactions] attribute DOMString target;
    1435   [CEReactions] attribute DOMString download;
    1436   [CEReactions] attribute USVString ping;
    1437   [CEReactions] attribute DOMString rel;
    1438   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
    1439   [CEReactions] attribute DOMString referrerPolicy;
    1440 
    1441   // also has obsolete members
    1442 };
    1443 HTMLAreaElement implements HTMLHyperlinkElementUtils;
    1444 
    1445 interface HTMLTableElement : HTMLElement {
    1446            attribute HTMLTableCaptionElement? caption;
    1447   HTMLElement createCaption();
    1448   void deleteCaption();
    1449            attribute HTMLTableSectionElement? tHead;
    1450   HTMLElement createTHead();
    1451   void deleteTHead();
    1452            attribute HTMLTableSectionElement? tFoot;
    1453   HTMLElement createTFoot();
    1454   void deleteTFoot();
    1455   readonly attribute HTMLCollection tBodies;
    1456   HTMLElement createTBody();
    1457   readonly attribute HTMLCollection rows;
    1458   HTMLElement insertRow(optional long index = -1);
    1459   void deleteRow(long index);
    1460 
    1461   // also has obsolete members
    1462 };
    1463 
    1464 interface HTMLTableCaptionElement : HTMLElement {
    1465   // also has obsolete members
    1466 };
    1467 
    1468 interface HTMLTableColElement : HTMLElement {
    1469            attribute unsigned long span;
    1470 
    1471   // also has obsolete members
    1472 };
    1473 
    1474 interface HTMLTableSectionElement : HTMLElement {
    1475   readonly attribute HTMLCollection rows;
    1476   HTMLElement insertRow(optional long index = -1);
    1477   void deleteRow(long index);
    1478 
    1479   // also has obsolete members
    1480 };
    1481 
    1482 interface HTMLTableRowElement : HTMLElement {
    1483   readonly attribute long rowIndex;
    1484   readonly attribute long sectionRowIndex;
    1485   readonly attribute HTMLCollection cells;
    1486   HTMLElement insertCell(optional long index = -1);
    1487   void deleteCell(long index);
    1488 
    1489   // also has obsolete members
    1490 };
    1491 
    1492 interface HTMLTableCellElement : HTMLElement {
    1493   [CEReactions] attribute unsigned long colSpan;
    1494   [CEReactions] attribute unsigned long rowSpan;
    1495   [CEReactions] attribute DOMString headers;
    1496   readonly attribute long cellIndex;
    1497 
    1498   [CEReactions] attribute DOMString scope; // only conforming for th elements
    1499   [CEReactions] attribute DOMString abbr;  // only conforming for th elements
    1500 
    1501   // also has obsolete members
    1502 };
    1503 
    1504 [OverrideBuiltins]
    1505 interface HTMLFormElement : HTMLElement {
    1506            attribute DOMString acceptCharset;
    1507            attribute DOMString action;
    1508            attribute DOMString autocomplete;
    1509            attribute DOMString enctype;
    1510            attribute DOMString encoding;
    1511            attribute DOMString method;
    1512            attribute DOMString name;
    1513            attribute boolean noValidate;
    1514            attribute DOMString target;
    1515 
    1516   readonly attribute HTMLFormControlsCollection elements;
    1517   readonly attribute unsigned long length;
    1518   getter Element (unsigned long index);
    1519   getter (RadioNodeList or Element) (DOMString name);
    1520 
    1521   void submit();
    1522   void reset();
    1523   boolean checkValidity();
    1524   boolean reportValidity();
    1525 };
    1526 
    1527 interface HTMLLabelElement : HTMLElement {
    1528   readonly attribute HTMLFormElement? form;
    1529            attribute DOMString htmlFor;
    1530   readonly attribute HTMLElement? control;
    1531 };
    1532 
    1533 interface HTMLInputElement : HTMLElement {
    1534            attribute DOMString accept;
    1535            attribute DOMString alt;
    1536            attribute DOMString autocomplete;
    1537            attribute boolean autofocus;
    1538            attribute boolean defaultChecked;
    1539            attribute boolean checked;
    1540            attribute DOMString dirName;
    1541            attribute boolean disabled;
    1542   readonly attribute HTMLFormElement? form;
    1543   readonly attribute FileList? files;
    1544            attribute DOMString formAction;
    1545            attribute DOMString formEnctype;
    1546            attribute DOMString formMethod;
    1547            attribute boolean formNoValidate;
    1548            attribute DOMString formTarget;
    1549            attribute unsigned long height;
    1550            attribute boolean indeterminate;
    1551            attribute DOMString inputMode;
    1552   readonly attribute HTMLElement? list;
    1553            attribute DOMString max;
    1554            attribute long maxLength;
    1555            attribute DOMString min;
    1556            attribute long minLength;
    1557            attribute boolean multiple;
    1558            attribute DOMString name;
    1559            attribute DOMString pattern;
    1560            attribute DOMString placeholder;
    1561            attribute boolean readOnly;
    1562            attribute boolean required;
    1563            attribute unsigned long size;
    1564            attribute DOMString src;
    1565            attribute DOMString step;
    1566            attribute DOMString type;
    1567            attribute DOMString defaultValue;
    1568   [TreatNullAs=EmptyString] attribute DOMString value;
    1569            attribute Date? valueAsDate;
    1570            attribute unrestricted double valueAsNumber;
    1571            attribute unsigned long width;
    1572 
    1573   void stepUp(optional long n = 1);
    1574   void stepDown(optional long n = 1);
    1575 
    1576   readonly attribute boolean willValidate;
    1577   readonly attribute ValidityState validity;
    1578   readonly attribute DOMString validationMessage;
    1579   boolean checkValidity();
    1580   boolean reportValidity();
    1581   void setCustomValidity(DOMString error);
    1582 
    1583   readonly attribute NodeList labels;
    1584 
    1585   void select();
    1586            attribute unsigned long? selectionStart;
    1587            attribute unsigned long? selectionEnd;
    1588            attribute DOMString? selectionDirection;
    1589   void setRangeText(DOMString replacement);
    1590   void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
    1591   void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
    1592 
    1593   // also has obsolete members
    1594 };
    1595 
    1596 interface HTMLButtonElement : HTMLElement {
    1597            attribute boolean autofocus;
    1598            attribute boolean disabled;
    1599   readonly attribute HTMLFormElement? form;
    1600            attribute DOMString formAction;
    1601            attribute DOMString formEnctype;
    1602            attribute DOMString formMethod;
    1603            attribute boolean formNoValidate;
    1604            attribute DOMString formTarget;
    1605            attribute DOMString name;
    1606            attribute DOMString type;
    1607            attribute DOMString value;
    1608 
    1609   readonly attribute boolean willValidate;
    1610   readonly attribute ValidityState validity;
    1611   readonly attribute DOMString validationMessage;
    1612   boolean checkValidity();
    1613   boolean reportValidity();
    1614   void setCustomValidity(DOMString error);
    1615 
    1616   readonly attribute NodeList labels;
    1617 };
    1618 
    1619 interface HTMLSelectElement : HTMLElement {
    1620            attribute DOMString autocomplete;
    1621            attribute boolean autofocus;
    1622            attribute boolean disabled;
    1623   readonly attribute HTMLFormElement? form;
    1624            attribute boolean multiple;
    1625            attribute DOMString name;
    1626            attribute boolean required;
    1627            attribute unsigned long size;
    1628 
    1629   readonly attribute DOMString type;
    1630 
    1631   readonly attribute HTMLOptionsCollection options;
    1632            attribute unsigned long length;
    1633   getter Element? item(unsigned long index);
    1634   HTMLOptionElement? namedItem(DOMString name);
    1635   void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
    1636   void remove(); // ChildNode overload
    1637   void remove(long index);
    1638   setter creator void (unsigned long index, HTMLOptionElement? option);
    1639 
    1640   readonly attribute HTMLCollection selectedOptions;
    1641            attribute long selectedIndex;
    1642            attribute DOMString value;
    1643 
    1644   readonly attribute boolean willValidate;
    1645   readonly attribute ValidityState validity;
    1646   readonly attribute DOMString validationMessage;
    1647   boolean checkValidity();
    1648   boolean reportValidity();
    1649   void setCustomValidity(DOMString error);
    1650 
    1651   readonly attribute NodeList labels;
    1652 };
    1653 
    1654 interface HTMLDataListElement : HTMLElement {
    1655   readonly attribute HTMLCollection options;
    1656 };
    1657 
    1658 interface HTMLOptGroupElement : HTMLElement {
    1659            attribute boolean disabled;
    1660            attribute DOMString label;
    1661 };
    1662 
    1663 [NamedConstructor=Option(optional DOMString text = "", optional DOMString value, optional boolean defaultSelected = false, optional boolean selected = false)]
    1664 interface HTMLOptionElement : HTMLElement {
    1665            attribute boolean disabled;
    1666   readonly attribute HTMLFormElement? form;
    1667            attribute DOMString label;
    1668            attribute boolean defaultSelected;
    1669            attribute boolean selected;
    1670            attribute DOMString value;
    1671 
    1672            attribute DOMString text;
    1673   readonly attribute long index;
    1674 };
    1675 
    1676 interface HTMLTextAreaElement : HTMLElement {
    1677            attribute DOMString autocomplete;
    1678            attribute boolean autofocus;
    1679            attribute unsigned long cols;
    1680            attribute DOMString dirName;
    1681            attribute boolean disabled;
    1682   readonly attribute HTMLFormElement? form;
    1683            attribute DOMString inputMode;
    1684            attribute long maxLength;
    1685            attribute long minLength;
    1686            attribute DOMString name;
    1687            attribute DOMString placeholder;
    1688            attribute boolean readOnly;
    1689            attribute boolean required;
    1690            attribute unsigned long rows;
    1691            attribute DOMString wrap;
    1692 
    1693   readonly attribute DOMString type;
    1694            attribute DOMString defaultValue;
    1695   [TreatNullAs=EmptyString] attribute DOMString value;
    1696   readonly attribute unsigned long textLength;
    1697 
    1698   readonly attribute boolean willValidate;
    1699   readonly attribute ValidityState validity;
    1700   readonly attribute DOMString validationMessage;
    1701   boolean checkValidity();
    1702   boolean reportValidity();
    1703   void setCustomValidity(DOMString error);
    1704 
    1705   readonly attribute NodeList labels;
    1706 
    1707   void select();
    1708            attribute unsigned long? selectionStart;
    1709            attribute unsigned long? selectionEnd;
    1710            attribute DOMString? selectionDirection;
    1711   void setRangeText(DOMString replacement);
    1712   void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
    1713   void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
    1714 };
    1715 
    1716 interface HTMLOutputElement : HTMLElement {
    1717   [PutForwards=value] readonly attribute DOMTokenList htmlFor;
    1718   readonly attribute HTMLFormElement? form;
    1719            attribute DOMString name;
    1720 
    1721   readonly attribute DOMString type;
    1722            attribute DOMString defaultValue;
    1723            attribute DOMString value;
    1724 
    1725   readonly attribute boolean willValidate;
    1726   readonly attribute ValidityState validity;
    1727   readonly attribute DOMString validationMessage;
    1728   boolean checkValidity();
    1729   boolean reportValidity();
    1730   void setCustomValidity(DOMString error);
    1731 
    1732   readonly attribute NodeList labels;
    1733 };
    1734 
    1735 interface HTMLProgressElement : HTMLElement {
    1736            attribute double value;
    1737            attribute double max;
    1738   readonly attribute double position;
    1739   readonly attribute NodeList labels;
    1740 };
    1741 
    1742 interface HTMLMeterElement : HTMLElement {
    1743            attribute double value;
    1744            attribute double min;
    1745            attribute double max;
    1746            attribute double low;
    1747            attribute double high;
    1748            attribute double optimum;
    1749   readonly attribute NodeList labels;
    1750 };
    1751 
    1752 interface HTMLFieldSetElement : HTMLElement {
    1753            attribute boolean disabled;
    1754   readonly attribute HTMLFormElement? form;
    1755            attribute DOMString name;
    1756 
    1757   readonly attribute DOMString type;
    1758 
    1759   readonly attribute HTMLFormControlsCollection elements;
    1760 
    1761   readonly attribute boolean willValidate;
    1762   readonly attribute ValidityState validity;
    1763   readonly attribute DOMString validationMessage;
    1764   boolean checkValidity();
    1765   boolean reportValidity();
    1766   void setCustomValidity(DOMString error);
    1767 };
    1768 
    1769 interface HTMLLegendElement : HTMLElement {
    1770   readonly attribute HTMLFormElement? form;
    1771 
    1772   // also has obsolete members
    1773 };
    1774 
    1775 enum SelectionMode {
    1776   "select",
    1777   "start",
    1778   "end",
    1779   "preserve"/*,*/ // default
    1780 };
    1781 
    1782 interface ValidityState {
    1783   readonly attribute boolean valueMissing;
    1784   readonly attribute boolean typeMismatch;
    1785   readonly attribute boolean patternMismatch;
    1786   readonly attribute boolean tooLong;
    1787   readonly attribute boolean tooShort;
    1788   readonly attribute boolean rangeUnderflow;
    1789   readonly attribute boolean rangeOverflow;
    1790   readonly attribute boolean stepMismatch;
    1791   readonly attribute boolean badInput;
    1792   readonly attribute boolean customError;
    1793   readonly attribute boolean valid;
    1794 };
    1795 
    1796 interface HTMLDetailsElement : HTMLElement {
    1797            attribute boolean open;
    1798 };
    1799 
    1800 interface HTMLMenuElement : HTMLElement {
    1801            attribute DOMString type;
    1802            attribute DOMString label;
    1803 
    1804   // also has obsolete members
    1805 };
    1806 
    1807 interface HTMLMenuItemElement : HTMLElement {
    1808            attribute DOMString type;
    1809            attribute DOMString label;
    1810            attribute DOMString icon;
    1811            attribute boolean disabled;
    1812            attribute boolean checked;
    1813            attribute DOMString radiogroup;
    1814            attribute boolean default;
    1815   readonly attribute HTMLElement? command;
    1816 };
    1817 
    1818 [Constructor(DOMString type, optional RelatedEventInit eventInitDict)]
    1819 interface RelatedEvent : Event {
    1820   readonly attribute EventTarget? relatedTarget;
    1821 };
    1822 
    1823 dictionary RelatedEventInit : EventInit {
    1824   EventTarget? relatedTarget;
    1825 };
    1826 
    1827 interface HTMLDialogElement : HTMLElement {
    1828            attribute boolean open;
    1829            attribute DOMString returnValue;
    1830   void show();
    1831   void showModal();
    1832   void close(optional DOMString returnValue);
    1833 };
    1834 
    1835 [HTMLConstructor]
    1836 interface HTMLScriptElement : HTMLElement {
    1837   [CEReactions] attribute USVString src;
    1838   [CEReactions] attribute DOMString type;
    1839   [CEReactions] attribute boolean noModule;
    1840   [CEReactions] attribute DOMString charset;
    1841   [CEReactions] attribute boolean async;
    1842   [CEReactions] attribute boolean defer;
    1843   [CEReactions] attribute DOMString? crossOrigin;
    1844   [CEReactions] attribute DOMString text;
    1845   [CEReactions] attribute DOMString nonce;
    1846   [CEReactions] attribute DOMString integrity;
    1847 
    1848 
    1849   // also has obsolete members
    1850 };
    1851 
    1852 interface HTMLTemplateElement : HTMLElement {
    1853   readonly attribute DocumentFragment content;
    1854 };
    1855 
    1856 interface HTMLSlotElement : HTMLElement {
    1857   /*[CEReactions]*/ attribute DOMString name;
    1858   sequence<Node> assignedNodes(optional AssignedNodesOptions options);
    1859 };
    1860 
    1861 dictionary AssignedNodesOptions {
    1862   boolean flatten = false;
    1863 };
    1864 
    1865 typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
    1866 callback BlobCallback = void (Blob? blob);
    1867 
    1868 interface HTMLCanvasElement : HTMLElement {
    1869            attribute unsigned long width;
    1870            attribute unsigned long height;
    1871 
    1872   RenderingContext? getContext(DOMString contextId, any... arguments);
    1873 
    1874   DOMString toDataURL(optional DOMString type, any... arguments);
    1875   void toBlob(BlobCallback _callback, optional DOMString type, any... arguments);
    1876 };
    1877 
    1878 typedef (HTMLImageElement or
    1879          SVGImageElement) HTMLOrSVGImageElement;
    1880 
    1881 typedef (HTMLOrSVGImageElement or
    1882          HTMLVideoElement or
    1883          HTMLCanvasElement or
    1884          ImageBitmap) CanvasImageSource;
    1885 
    1886 enum CanvasFillRule { "nonzero", "evenodd" };
    1887 
    1888 dictionary CanvasRenderingContext2DSettings {
    1889   boolean alpha = true;
    1890 };
    1891 
    1892 enum ImageSmoothingQuality { "low", "medium", "high" };
    1893 
    1894 interface CanvasRenderingContext2D {
    1895   // back-reference to the canvas
    1896   readonly attribute HTMLCanvasElement canvas;
    1897 };
    1898 CanvasRenderingContext2D implements CanvasState;
    1899 CanvasRenderingContext2D implements CanvasTransform;
    1900 CanvasRenderingContext2D implements CanvasCompositing;
    1901 CanvasRenderingContext2D implements CanvasImageSmoothing;
    1902 CanvasRenderingContext2D implements CanvasFillStrokeStyles;
    1903 CanvasRenderingContext2D implements CanvasShadowStyles;
    1904 CanvasRenderingContext2D implements CanvasFilters;
    1905 CanvasRenderingContext2D implements CanvasRect;
    1906 CanvasRenderingContext2D implements CanvasDrawPath;
    1907 CanvasRenderingContext2D implements CanvasUserInterface;
    1908 CanvasRenderingContext2D implements CanvasText;
    1909 CanvasRenderingContext2D implements CanvasDrawImage;
    1910 CanvasRenderingContext2D implements CanvasHitRegion;
    1911 CanvasRenderingContext2D implements CanvasImageData;
    1912 CanvasRenderingContext2D implements CanvasPathDrawingStyles;
    1913 CanvasRenderingContext2D implements CanvasTextDrawingStyles;
    1914 CanvasRenderingContext2D implements CanvasPath;
    1915 
    1916 [NoInterfaceObject]
    1917 interface CanvasState {
    1918   // state
    1919   void save(); // push state on state stack
    1920   void restore(); // pop state stack and restore state
    1921 };
    1922 
    1923 [NoInterfaceObject]
    1924 interface CanvasTransform {
    1925   // transformations (default transform is the identity matrix)
    1926   void scale(unrestricted double x, unrestricted double y);
    1927   void rotate(unrestricted double angle);
    1928   void translate(unrestricted double x, unrestricted double y);
    1929   void transform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
    1930 
    1931   [NewObject] DOMMatrix getTransform();
    1932   void setTransform(unrestricted double a, unrestricted double b, unrestricted double c, unrestricted double d, unrestricted double e, unrestricted double f);
    1933   void setTransform(optional DOMMatrixInit transform);
    1934   void resetTransform();
    1935 
    1936 };
    1937 
    1938 [NoInterfaceObject]
    1939 interface CanvasCompositing {
    1940   // compositing
    1941   attribute unrestricted double globalAlpha; // (default 1.0)
    1942   attribute DOMString globalCompositeOperation; // (default source-over)
    1943 };
    1944 
    1945 [NoInterfaceObject]
    1946 interface CanvasImageSmoothing {
    1947   // image smoothing
    1948   attribute boolean imageSmoothingEnabled; // (default true)
    1949   attribute ImageSmoothingQuality imageSmoothingQuality; // (default low)
    1950 
    1951 };
    1952 
    1953 [NoInterfaceObject]
    1954 interface CanvasFillStrokeStyles {
    1955   // colours and styles (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
    1956   attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
    1957   attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
    1958   CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
    1959   CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
    1960   CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
    1961 
    1962 };
    1963 
    1964 [NoInterfaceObject]
    1965 interface CanvasShadowStyles {
    1966   // shadows
    1967   attribute unrestricted double shadowOffsetX; // (default 0)
    1968   attribute unrestricted double shadowOffsetY; // (default 0)
    1969   attribute unrestricted double shadowBlur; // (default 0)
    1970   attribute DOMString shadowColor; // (default transparent black)
    1971 };
    1972 
    1973 [NoInterfaceObject]
    1974 interface CanvasFilters {
    1975   // filters
    1976   attribute DOMString filter; // (default "none")
    1977 };
    1978 
    1979 [NoInterfaceObject]
    1980 interface CanvasRect {
    1981   // rects
    1982   void clearRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
    1983   void fillRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
    1984   void strokeRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
    1985 };
    1986 
    1987 [NoInterfaceObject]
    1988 interface CanvasDrawPath {
    1989   // path API (see also CanvasPath)
    1990   void beginPath();
    1991   void fill(optional CanvasFillRule fillRule = "nonzero");
    1992   void fill(Path2D path, optional CanvasFillRule fillRule = "nonzero");
    1993   void stroke();
    1994   void stroke(Path2D path);
    1995   void clip(optional CanvasFillRule fillRule = "nonzero");
    1996   void clip(Path2D path, optional CanvasFillRule fillRule = "nonzero");
    1997   void resetClip();
    1998   boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero");
    1999   boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, optional CanvasFillRule fillRule = "nonzero");
    2000   boolean isPointInStroke(unrestricted double x, unrestricted double y);
    2001   boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
    2002 };
    2003 
    2004 [NoInterfaceObject]
    2005 interface CanvasUserInterface {
    2006   void drawFocusIfNeeded(Element element);
    2007   void drawFocusIfNeeded(Path2D path, Element element);
    2008   void scrollPathIntoView();
    2009   void scrollPathIntoView(Path2D path);
    2010 };
    2011 
    2012 [NoInterfaceObject]
    2013 interface CanvasText {
    2014   // text (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
    2015   void fillText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
    2016   void strokeText(DOMString text, unrestricted double x, unrestricted double y, optional unrestricted double maxWidth);
    2017   TextMetrics measureText(DOMString text);
    2018 };
    2019 
    2020 [NoInterfaceObject]
    2021 interface CanvasDrawImage {
    2022   // drawing images
    2023   void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy);
    2024   void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
    2025   void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
    2026 };
    2027 
    2028 [NoInterfaceObject]
    2029 interface CanvasHitRegion {
    2030   // hit regions
    2031   void addHitRegion(optional HitRegionOptions options);
    2032   void removeHitRegion(DOMString id);
    2033   void clearHitRegions();
    2034 };
    2035 
    2036 [NoInterfaceObject]
    2037 interface CanvasImageData {
    2038   // pixel manipulation
    2039   ImageData createImageData(double sw, double sh);
    2040   ImageData createImageData(ImageData imagedata);
    2041   ImageData getImageData(double sx, double sy, double sw, double sh);
    2042   void putImageData(ImageData imagedata, double dx, double dy);
    2043   void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
    2044 };
    2045 
    2046 enum CanvasLineCap { "butt", "round", "square" };
    2047 enum CanvasLineJoin { "round", "bevel", "miter"};
    2048 enum CanvasTextAlign { "start", "end", "left", "right", "center" };
    2049 enum CanvasTextBaseline { "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" };
    2050 enum CanvasDirection { "ltr", "rtl", "inherit" };
    2051 
    2052 [NoInterfaceObject]
    2053 interface CanvasPathDrawingStyles {
    2054   // line caps/joins
    2055   attribute unrestricted double lineWidth; // (default 1)
    2056   attribute CanvasLineCap lineCap; // (default "butt")
    2057   attribute CanvasLineJoin lineJoin; // (default "miter")
    2058   attribute unrestricted double miterLimit; // (default 10)
    2059 
    2060   // dashed lines
    2061   void setLineDash(sequence<unrestricted double> segments); // default empty
    2062   sequence<unrestricted double> getLineDash();
    2063   attribute unrestricted double lineDashOffset;
    2064 };
    2065 
    2066 [NoInterfaceObject]
    2067 interface CanvasTextDrawingStyles {
    2068   // text
    2069   attribute DOMString font; // (default 10px sans-serif)
    2070   attribute CanvasTextAlign textAlign; // (default: "start")
    2071   attribute CanvasTextBaseline textBaseline; // (default: "alphabetic")
    2072   attribute CanvasDirection direction; // (default: "inherit")
    2073 };
    2074 
    2075 [NoInterfaceObject, Exposed=(Window,Worker)]
    2076 interface CanvasPath {
    2077   // shared path API methods
    2078   void closePath();
    2079   void moveTo(unrestricted double x, unrestricted double y);
    2080   void lineTo(unrestricted double x, unrestricted double y);
    2081   void quadraticCurveTo(unrestricted double cpx, unrestricted double cpy, unrestricted double x, unrestricted double y);
    2082   void bezierCurveTo(unrestricted double cp1x, unrestricted double cp1y, unrestricted double cp2x, unrestricted double cp2y, unrestricted double x, unrestricted double y);
    2083   void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radius);
    2084   void arcTo(unrestricted double x1, unrestricted double y1, unrestricted double x2, unrestricted double y2, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation);
    2085   void rect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
    2086   void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
    2087   void ellipse(unrestricted double x, unrestricted double y, unrestricted double radiusX, unrestricted double radiusY, unrestricted double rotation, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
    2088 };
    2089 
    2090 interface CanvasGradient {
    2091   // opaque object
    2092   void addColorStop(double offset, DOMString color);
    2093 };
    2094 
    2095 interface CanvasPattern {
    2096   // opaque object
    2097   void setTransform(optional DOMMatrixInit transform);
    2098 };
    2099 
    2100 interface TextMetrics {
    2101   // x-direction
    2102   readonly attribute double width; // advance width
    2103   readonly attribute double actualBoundingBoxLeft;
    2104   readonly attribute double actualBoundingBoxRight;
    2105 
    2106   // y-direction
    2107   readonly attribute double fontBoundingBoxAscent;
    2108   readonly attribute double fontBoundingBoxDescent;
    2109   readonly attribute double actualBoundingBoxAscent;
    2110   readonly attribute double actualBoundingBoxDescent;
    2111   readonly attribute double emHeightAscent;
    2112   readonly attribute double emHeightDescent;
    2113   readonly attribute double hangingBaseline;
    2114   readonly attribute double alphabeticBaseline;
    2115   readonly attribute double ideographicBaseline;
    2116 };
    2117 
    2118 dictionary HitRegionOptions {
    2119   Path2D? path = null;
    2120   CanvasFillRule fillRule = "nonzero";
    2121   DOMString id = "";
    2122   DOMString? parentID = null;
    2123   DOMString cursor = "inherit";
    2124   // for control-backed regions:
    2125   Element? control = null;
    2126   // for unbacked regions:
    2127   DOMString? label = null;
    2128   DOMString? role = null;
    2129 };
    2130 
    2131 [Constructor(unsigned long sw, unsigned long sh),
    2132  Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
    2133  Exposed=(Window,Worker)]
    2134 interface ImageData {
    2135   readonly attribute unsigned long width;
    2136   readonly attribute unsigned long height;
    2137   readonly attribute Uint8ClampedArray data;
    2138 };
    2139 
    2140 [Constructor,
    2141  Constructor(Path2D path),
    2142  Constructor(sequence<Path2D> paths, optional CanvasFillRule fillRule = "nonzero"),
    2143  Constructor(DOMString d), Exposed=(Window,Worker)]
    2144 interface Path2D {
    2145   void addPath(Path2D path, optional DOMMatrixInit transform);
    2146 };
    2147 Path2D implements CanvasPath;
    2148 
    2149 partial interface MouseEvent {
    2150   readonly attribute DOMString? region;
    2151 };
    2152 
    2153 // https://github.com/w3c/testharness.js/issues/84
    2154 //partial dictionary MouseEventInit {
    2155 //  DOMString? region;
    2156 //};
    2157 
    2158 partial interface Touch {
    2159   readonly attribute DOMString? region;
    2160 };
    2161 
    2162 interface DataTransfer {
    2163            attribute DOMString dropEffect;
    2164            attribute DOMString effectAllowed;
    2165 
    2166   readonly attribute DataTransferItemList items;
    2167 
    2168   void setDragImage(Element image, long x, long y);
    2169 
    2170   /* old interface */
    2171   readonly attribute DOMString[] types;
    2172   DOMString getData(DOMString format);
    2173   void setData(DOMString format, DOMString data);
    2174   void clearData(optional DOMString format);
    2175   readonly attribute FileList files;
    2176 };
    2177 
    2178 interface DataTransferItemList {
    2179   readonly attribute unsigned long length;
    2180   getter DataTransferItem (unsigned long index);
    2181   DataTransferItem? add(DOMString data, DOMString type);
    2182   DataTransferItem? add(File data);
    2183   void remove(unsigned long index);
    2184   void clear();
    2185 };
    2186 
    2187 interface DataTransferItem {
    2188   readonly attribute DOMString kind;
    2189   readonly attribute DOMString type;
    2190   void getAsString(FunctionStringCallback? _callback);
    2191   File? getAsFile();
    2192 };
    2193 
    2194 callback FunctionStringCallback = void (DOMString data);
    2195 
    2196 [Constructor(DOMString type, optional DragEventInit eventInitDict)]
    2197 interface DragEvent : MouseEvent {
    2198   readonly attribute DataTransfer? dataTransfer;
    2199 };
    2200 
    2201 dictionary DragEventInit : MouseEventInit {
    2202   DataTransfer? dataTransfer;
    2203 };
    2204 
    2205 // For purposes of this test, just treat WindowProxy as the same thing as
    2206 // Window.
    2207 typedef Window WindowProxy;
    2208 
    2209 [PrimaryGlobal]
    2210 /*sealed*/ interface Window : EventTarget {
    2211   // the current browsing context
    2212   [Unforgeable] readonly attribute WindowProxy window;
    2213   [Replaceable] readonly attribute WindowProxy self;
    2214   [Unforgeable] readonly attribute Document document;
    2215            attribute DOMString name;
    2216   [PutForwards=href, Unforgeable] readonly attribute Location location;
    2217   readonly attribute History history;
    2218   [Replaceable] readonly attribute BarProp locationbar;
    2219   [Replaceable] readonly attribute BarProp menubar;
    2220   [Replaceable] readonly attribute BarProp personalbar;
    2221   [Replaceable] readonly attribute BarProp scrollbars;
    2222   [Replaceable] readonly attribute BarProp statusbar;
    2223   [Replaceable] readonly attribute BarProp toolbar;
    2224            attribute DOMString status;
    2225   void close();
    2226   readonly attribute boolean closed;
    2227   void stop();
    2228   void focus();
    2229   void blur();
    2230 
    2231   // other browsing contexts
    2232   [Replaceable] readonly attribute WindowProxy frames;
    2233   [Replaceable] readonly attribute unsigned long length;
    2234   [Unforgeable] readonly attribute WindowProxy top;
    2235            attribute any opener;
    2236   [Replaceable] readonly attribute WindowProxy parent;
    2237   readonly attribute Element? frameElement;
    2238   WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "", optional boolean replace = false);
    2239   getter WindowProxy (unsigned long index);
    2240   getter object (DOMString name);
    2241 
    2242   // the user agent
    2243   readonly attribute Navigator navigator;
    2244   [Replaceable] readonly attribute External external;
    2245   readonly attribute ApplicationCache applicationCache;
    2246 
    2247   // user prompts
    2248   void alert();
    2249   //void alert(DOMString message);
    2250   boolean confirm(optional DOMString message = "");
    2251   DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
    2252   void print();
    2253   any showModalDialog(DOMString url, optional any argument);
    2254 
    2255   void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
    2256 
    2257   // also has obsolete members
    2258 };
    2259 Window implements GlobalEventHandlers;
    2260 Window implements WindowEventHandlers;
    2261 
    2262 interface BarProp {
    2263   readonly attribute boolean visible;
    2264 };
    2265 
    2266 enum ScrollRestoration { "auto", "manual" };
    2267 interface History {
    2268 
    2269   readonly attribute long length;
    2270   attribute ScrollRestoration scrollRestoration;
    2271   readonly attribute any state;
    2272   void go(optional long delta);
    2273   void back();
    2274   void forward();
    2275   void pushState(any data, DOMString title, optional DOMString? url = null);
    2276   void replaceState(any data, DOMString title, optional DOMString? url = null);
    2277 };
    2278 
    2279 [Unforgeable] interface Location {
    2280   stringifier attribute USVString href;
    2281   readonly attribute USVString origin;
    2282            attribute USVString protocol;
    2283            attribute USVString host;
    2284            attribute USVString hostname;
    2285            attribute USVString port;
    2286            attribute USVString pathname;
    2287            attribute USVString search;
    2288            attribute USVString hash;
    2289 
    2290   void assign(USVString url);
    2291   void replace(USVString url);
    2292   void reload();
    2293 
    2294   [SameObject] readonly attribute USVString[] ancestorOrigins;
    2295 };
    2296 
    2297 [Constructor(DOMString type, optional PopStateEventInit eventInitDict), Exposed=(Window,Worker)]
    2298 interface PopStateEvent : Event {
    2299   readonly attribute any state;
    2300 };
    2301 
    2302 dictionary PopStateEventInit : EventInit {
    2303   any state;
    2304 };
    2305 
    2306 [Constructor(DOMString type, optional HashChangeEventInit eventInitDict), Exposed=(Window,Worker)]
    2307 interface HashChangeEvent : Event {
    2308   readonly attribute DOMString oldURL;
    2309   readonly attribute DOMString newURL;
    2310 };
    2311 
    2312 dictionary HashChangeEventInit : EventInit {
    2313   DOMString oldURL;
    2314   DOMString newURL;
    2315 };
    2316 
    2317 [Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), Exposed=(Window,Worker)]
    2318 interface PageTransitionEvent : Event {
    2319   readonly attribute boolean persisted;
    2320 };
    2321 
    2322 dictionary PageTransitionEventInit : EventInit {
    2323   boolean persisted;
    2324 };
    2325 
    2326 interface BeforeUnloadEvent : Event {
    2327            attribute DOMString returnValue;
    2328 };
    2329 
    2330 [Exposed=(Window,SharedWorker)]
    2331 interface ApplicationCache : EventTarget {
    2332 
    2333   // update status
    2334   const unsigned short UNCACHED = 0;
    2335   const unsigned short IDLE = 1;
    2336   const unsigned short CHECKING = 2;
    2337   const unsigned short DOWNLOADING = 3;
    2338   const unsigned short UPDATEREADY = 4;
    2339   const unsigned short OBSOLETE = 5;
    2340   readonly attribute unsigned short status;
    2341 
    2342   // updates
    2343   void update();
    2344   void abort();
    2345   void swapCache();
    2346 
    2347   // events
    2348            attribute EventHandler onchecking;
    2349            attribute EventHandler onerror;
    2350            attribute EventHandler onnoupdate;
    2351            attribute EventHandler ondownloading;
    2352            attribute EventHandler onprogress;
    2353            attribute EventHandler onupdateready;
    2354            attribute EventHandler oncached;
    2355            attribute EventHandler onobsolete;
    2356 };
    2357 
    2358 [NoInterfaceObject, Exposed=(Window,Worker)]
    2359 interface NavigatorOnLine {
    2360   readonly attribute boolean onLine;
    2361 };
    2362 
    2363 [Constructor(DOMString type, optional ErrorEventInit eventInitDict), Exposed=(Window,Worker)]
    2364 interface ErrorEvent : Event {
    2365   readonly attribute DOMString message;
    2366   readonly attribute DOMString filename;
    2367   readonly attribute unsigned long lineno;
    2368   readonly attribute unsigned long colno;
    2369   readonly attribute any error;
    2370 };
    2371 
    2372 dictionary ErrorEventInit : EventInit {
    2373   DOMString message;
    2374   DOMString filename;
    2375   unsigned long lineno;
    2376   unsigned long colno;
    2377   any error;
    2378 };
    2379 
    2380 [TreatNonCallableAsNull]
    2381 callback EventHandlerNonNull = any (Event event);
    2382 typedef EventHandlerNonNull? EventHandler;
    2383 
    2384 [TreatNonCallableAsNull]
    2385 callback OnErrorEventHandlerNonNull = any ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error);
    2386 typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
    2387 
    2388 [TreatNonCallableAsNull]
    2389 callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
    2390 typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
    2391 
    2392 [NoInterfaceObject]
    2393 interface GlobalEventHandlers {
    2394            attribute EventHandler onabort;
    2395            attribute EventHandler onauxclick;
    2396            attribute EventHandler onblur;
    2397            attribute EventHandler oncancel;
    2398            attribute EventHandler oncanplay;
    2399            attribute EventHandler oncanplaythrough;
    2400            attribute EventHandler onchange;
    2401            attribute EventHandler onclick;
    2402            attribute EventHandler onclose;
    2403            attribute EventHandler oncontextmenu;
    2404            attribute EventHandler oncuechange;
    2405            attribute EventHandler ondblclick;
    2406            attribute EventHandler ondrag;
    2407            attribute EventHandler ondragend;
    2408            attribute EventHandler ondragenter;
    2409            attribute EventHandler ondragexit;
    2410            attribute EventHandler ondragleave;
    2411            attribute EventHandler ondragover;
    2412            attribute EventHandler ondragstart;
    2413            attribute EventHandler ondrop;
    2414            attribute EventHandler ondurationchange;
    2415            attribute EventHandler onemptied;
    2416            attribute EventHandler onended;
    2417            attribute OnErrorEventHandler onerror;
    2418            attribute EventHandler onfocus;
    2419            attribute EventHandler oninput;
    2420            attribute EventHandler oninvalid;
    2421            attribute EventHandler onkeydown;
    2422            attribute EventHandler onkeypress;
    2423            attribute EventHandler onkeyup;
    2424            attribute EventHandler onload;
    2425            attribute EventHandler onloadeddata;
    2426            attribute EventHandler onloadedmetadata;
    2427            attribute EventHandler onloadstart;
    2428            attribute EventHandler onmousedown;
    2429   [LenientThis] attribute EventHandler onmouseenter;
    2430   [LenientThis] attribute EventHandler onmouseleave;
    2431            attribute EventHandler onmousemove;
    2432            attribute EventHandler onmouseout;
    2433            attribute EventHandler onmouseover;
    2434            attribute EventHandler onmouseup;
    2435            attribute EventHandler onmousewheel;
    2436            attribute EventHandler onpause;
    2437            attribute EventHandler onplay;
    2438            attribute EventHandler onplaying;
    2439            attribute EventHandler onprogress;
    2440            attribute EventHandler onratechange;
    2441            attribute EventHandler onreset;
    2442            attribute EventHandler onresize;
    2443            attribute EventHandler onscroll;
    2444            attribute EventHandler onseeked;
    2445            attribute EventHandler onseeking;
    2446            attribute EventHandler onselect;
    2447            attribute EventHandler onshow;
    2448            attribute EventHandler onstalled;
    2449            attribute EventHandler onsubmit;
    2450            attribute EventHandler onsuspend;
    2451            attribute EventHandler ontimeupdate;
    2452            attribute EventHandler ontoggle;
    2453            attribute EventHandler onvolumechange;
    2454            attribute EventHandler onwaiting;
    2455 };
    2456 
    2457 [NoInterfaceObject]
    2458 interface DocumentAndElementEventHandlers {
    2459            attribute EventHandler oncopy;
    2460            attribute EventHandler oncut;
    2461            attribute EventHandler onpaste;
    2462 };
    2463 
    2464 [NoInterfaceObject]
    2465 interface WindowEventHandlers {
    2466            attribute EventHandler onafterprint;
    2467            attribute EventHandler onbeforeprint;
    2468            attribute OnBeforeUnloadEventHandler onbeforeunload;
    2469            attribute EventHandler onhashchange;
    2470            attribute EventHandler onlanguagechange;
    2471            attribute EventHandler onmessage;
    2472            attribute EventHandler onoffline;
    2473            attribute EventHandler ononline;
    2474            attribute EventHandler onpagehide;
    2475            attribute EventHandler onpageshow;
    2476            attribute EventHandler onpopstate;
    2477            attribute EventHandler onstorage;
    2478            attribute EventHandler onunload;
    2479 };
    2480 
    2481 [NoInterfaceObject, Exposed=(Window,Worker)]
    2482 interface WindowBase64 {
    2483   DOMString btoa(DOMString btoa);
    2484   DOMString atob(DOMString atob);
    2485 };
    2486 Window implements WindowBase64;
    2487 
    2488 [NoInterfaceObject, Exposed=(Window,Worker)]
    2489 interface WindowTimers {
    2490   long setTimeout(Function handler, optional long timeout = 0, any... arguments);
    2491   long setTimeout(DOMString handler, optional long timeout = 0, any... arguments);
    2492   void clearTimeout(optional long handle = 0);
    2493   long setInterval(Function handler, optional long timeout = 0, any... arguments);
    2494   long setInterval(DOMString handler, optional long timeout = 0, any... arguments);
    2495   void clearInterval(optional long handle = 0);
    2496 };
    2497 Window implements WindowTimers;
    2498 
    2499 [NoInterfaceObject]
    2500 interface WindowModal {
    2501   readonly attribute any dialogArguments;
    2502            attribute any returnValue;
    2503 };
    2504 
    2505 interface Navigator {
    2506   // objects implementing this interface also implement the interfaces given below
    2507 };
    2508 Navigator implements NavigatorID;
    2509 Navigator implements NavigatorLanguage;
    2510 Navigator implements NavigatorOnLine;
    2511 Navigator implements NavigatorContentUtils;
    2512 Navigator implements NavigatorCookies;
    2513 Navigator implements NavigatorPlugins;
    2514 Navigator implements NavigatorConcurrentHardware;
    2515 
    2516 [NoInterfaceObject, Exposed=(Window,Worker)]
    2517 interface NavigatorID {
    2518   [Exposed=Window] readonly attribute DOMString appCodeName; // constant "Mozilla"
    2519   readonly attribute DOMString appName; // constant "Netscape"
    2520   readonly attribute DOMString appVersion;
    2521   readonly attribute DOMString platform;
    2522   [Exposed=Window] readonly attribute DOMString product; // constant "Gecko"
    2523   [Exposed=Window] readonly attribute DOMString productSub;
    2524   readonly attribute DOMString userAgent;
    2525   [Exposed=Window] readonly attribute DOMString vendor;
    2526   [Exposed=Window] readonly attribute DOMString vendorSub; // constant ""
    2527 };
    2528 
    2529 [NoInterfaceObject, Exposed=(Window,Worker)]
    2530 interface NavigatorLanguage {
    2531   readonly attribute DOMString language;
    2532   readonly attribute FrozenArray<DOMString> languages;
    2533 };
    2534 
    2535 [NoInterfaceObject]
    2536 interface NavigatorContentUtils {
    2537   // content handler registration
    2538   void registerProtocolHandler(DOMString scheme, USVString url, DOMString title);
    2539   void registerContentHandler(DOMString mimeType, USVString url, DOMString title);
    2540   DOMString isProtocolHandlerRegistered(DOMString scheme, USVString url);
    2541   DOMString isContentHandlerRegistered(DOMString mimeType, USVString url);
    2542   void unregisterProtocolHandler(DOMString scheme, USVString url);
    2543   void unregisterContentHandler(DOMString mimeType, USVString url);
    2544 };
    2545 
    2546 [NoInterfaceObject]
    2547 interface NavigatorCookies {
    2548   readonly attribute boolean cookieEnabled;
    2549 };
    2550 
    2551 [NoInterfaceObject]
    2552 interface NavigatorPlugins {
    2553   [SameObject] readonly attribute PluginArray plugins;
    2554   [SameObject] readonly attribute MimeTypeArray mimeTypes;
    2555   boolean javaEnabled();
    2556 };
    2557 
    2558 interface PluginArray {
    2559   void refresh(optional boolean reload = false);
    2560   readonly attribute unsigned long length;
    2561   getter Plugin? item(unsigned long index);
    2562   getter Plugin? namedItem(DOMString name);
    2563 };
    2564 
    2565 [NoInterfaceObject, Exposed=(Window,Worker)]
    2566 interface NavigatorConcurrentHardware {
    2567   readonly attribute unsigned long long hardwareConcurrency;
    2568 };
    2569 
    2570 interface MimeTypeArray {
    2571   readonly attribute unsigned long length;
    2572   getter MimeType? item(unsigned long index);
    2573   getter MimeType? namedItem(DOMString name);
    2574 };
    2575 
    2576 interface Plugin {
    2577   readonly attribute DOMString name;
    2578   readonly attribute DOMString description;
    2579   readonly attribute DOMString filename;
    2580   readonly attribute unsigned long length;
    2581   getter MimeType? item(unsigned long index);
    2582   getter MimeType? namedItem(DOMString name);
    2583 };
    2584 
    2585 interface MimeType {
    2586   readonly attribute DOMString type;
    2587   readonly attribute DOMString description;
    2588   readonly attribute DOMString suffixes; // comma-separated
    2589   readonly attribute Plugin enabledPlugin;
    2590 };
    2591 
    2592 interface External {
    2593   void AddSearchProvider(DOMString engineURL);
    2594   unsigned long IsSearchProviderInstalled(DOMString engineURL);
    2595 };
    2596 
    2597 [Exposed=(Window,Worker)]
    2598 interface ImageBitmap {
    2599   readonly attribute unsigned long width;
    2600   readonly attribute unsigned long height;
    2601 };
    2602 
    2603 typedef (HTMLImageElement or
    2604          HTMLVideoElement or
    2605          HTMLCanvasElement or
    2606          Blob or
    2607          ImageData or
    2608          CanvasRenderingContext2D or
    2609          ImageBitmap) ImageBitmapSource;
    2610 
    2611 [NoInterfaceObject, Exposed=(Window,Worker)]
    2612 interface ImageBitmapFactories {
    2613   Promise createImageBitmap(ImageBitmapSource image, optional long sx, long sy, long sw, long sh);
    2614 };
    2615 Window implements ImageBitmapFactories;
    2616 WorkerGlobalScope implements ImageBitmapFactories;
    2617 
    2618 [Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker)]
    2619 interface MessageEvent : Event {
    2620   readonly attribute any data;
    2621   readonly attribute DOMString origin;
    2622   readonly attribute DOMString lastEventId;
    2623   readonly attribute (WindowProxy or MessagePort)? source;
    2624   readonly attribute FrozenArray<MessagePort> ports;
    2625 
    2626   void initMessageEvent(DOMString type, boolean bubbles, boolean cancelable, any data, DOMString origin, DOMString lastEventId, (WindowProxy or MessagePort) source, sequence<MessagePort> ports);
    2627 };
    2628 
    2629 dictionary MessageEventInit : EventInit {
    2630   any data;
    2631   DOMString origin;
    2632   DOMString lastEventId;
    2633   (WindowProxy or MessagePort)? source;
    2634   sequence<MessagePort> ports;
    2635 };
    2636 
    2637 [Constructor(DOMString url, optional EventSourceInit eventSourceInitDict), Exposed=(Window,Worker)]
    2638 interface EventSource : EventTarget {
    2639   readonly attribute DOMString url;
    2640   readonly attribute boolean withCredentials;
    2641 
    2642   // ready state
    2643   const unsigned short CONNECTING = 0;
    2644   const unsigned short OPEN = 1;
    2645   const unsigned short CLOSED = 2;
    2646   readonly attribute unsigned short readyState;
    2647 
    2648   // networking
    2649            attribute EventHandler onopen;
    2650            attribute EventHandler onmessage;
    2651            attribute EventHandler onerror;
    2652   void close();
    2653 };
    2654 
    2655 dictionary EventSourceInit {
    2656   boolean withCredentials = false;
    2657 };
    2658 
    2659 enum BinaryType { "blob", "arraybuffer" };
    2660 [Constructor(DOMString url, optional (DOMString or DOMString[]) protocols), Exposed=(Window,Worker)]
    2661 interface WebSocket : EventTarget {
    2662   readonly attribute DOMString url;
    2663 
    2664   // ready state
    2665   const unsigned short CONNECTING = 0;
    2666   const unsigned short OPEN = 1;
    2667   const unsigned short CLOSING = 2;
    2668   const unsigned short CLOSED = 3;
    2669   readonly attribute unsigned short readyState;
    2670   readonly attribute unsigned long bufferedAmount;
    2671 
    2672   // networking
    2673   attribute EventHandler onopen;
    2674   attribute EventHandler onerror;
    2675   attribute EventHandler onclose;
    2676   readonly attribute DOMString extensions;
    2677   readonly attribute DOMString protocol;
    2678   void close([Clamp] optional unsigned short code, optional USVString reason);
    2679 
    2680   // messaging
    2681   attribute EventHandler onmessage;
    2682   attribute BinaryType binaryType;
    2683   void send(USVString data);
    2684   void send(Blob data);
    2685   void send(ArrayBuffer data);
    2686   void send(ArrayBufferView data);
    2687 };
    2688 
    2689 [Constructor(DOMString type, optional CloseEventInit eventInitDict), Exposed=(Window,Worker)]
    2690 interface CloseEvent : Event {
    2691   readonly attribute boolean wasClean;
    2692   readonly attribute unsigned short code;
    2693   readonly attribute DOMString reason;
    2694 };
    2695 
    2696 dictionary CloseEventInit : EventInit {
    2697   boolean wasClean;
    2698   unsigned short code;
    2699   DOMString reason;
    2700 };
    2701 
    2702 [Constructor, Exposed=(Window,Worker)]
    2703 interface MessageChannel {
    2704   readonly attribute MessagePort port1;
    2705   readonly attribute MessagePort port2;
    2706 };
    2707 
    2708 [Exposed=(Window,Worker)]
    2709 interface MessagePort : EventTarget {
    2710   void postMessage(any message, optional sequence<Transferable> transfer);
    2711   void start();
    2712   void close();
    2713 
    2714   // event handlers
    2715            attribute EventHandler onmessage;
    2716 };
    2717 // MessagePort implements Transferable;
    2718 
    2719 [Constructor(DOMString channel), Exposed=(Window,Worker)]
    2720 interface BroadcastChannel : EventTarget {
    2721   readonly attribute DOMString name;
    2722   void postMessage(any message);
    2723   void close();
    2724            attribute EventHandler onmessage;
    2725 };
    2726 
    2727 [Exposed=Worker]
    2728 interface WorkerGlobalScope : EventTarget {
    2729   readonly attribute WorkerGlobalScope self;
    2730   readonly attribute WorkerLocation location;
    2731 
    2732   void close();
    2733            attribute OnErrorEventHandler onerror;
    2734            attribute EventHandler onlanguagechange;
    2735            attribute EventHandler onoffline;
    2736            attribute EventHandler ononline;
    2737 
    2738   // also has additional members in a partial interface
    2739 };
    2740 
    2741 [Global=(Worker,DedicatedWorker),Exposed=DedicatedWorker]
    2742 /*sealed*/ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
    2743   void postMessage(any message, optional sequence<Transferable> transfer);
    2744            attribute EventHandler onmessage;
    2745 };
    2746 
    2747 [Global=(Worker,SharedWorker),Exposed=SharedWorker]
    2748 /*sealed*/ interface SharedWorkerGlobalScope : WorkerGlobalScope {
    2749   readonly attribute DOMString name;
    2750   readonly attribute ApplicationCache applicationCache;
    2751            attribute EventHandler onconnect;
    2752 };
    2753 
    2754 [NoInterfaceObject, Exposed=(Window,Worker)]
    2755 interface AbstractWorker {
    2756            attribute EventHandler onerror;
    2757 };
    2758 
    2759 [Constructor(DOMString scriptURL), Exposed=(Window,Worker)]
    2760 interface Worker : EventTarget {
    2761   void terminate();
    2762 
    2763   void postMessage(any message, optional sequence<Transferable> transfer);
    2764            attribute EventHandler onmessage;
    2765 };
    2766 Worker implements AbstractWorker;
    2767 
    2768 [Constructor(DOMString scriptURL, optional DOMString name), Exposed=(Window,Worker)]
    2769 interface SharedWorker : EventTarget {
    2770   readonly attribute MessagePort port;
    2771 };
    2772 SharedWorker implements AbstractWorker;
    2773 
    2774 partial interface WorkerGlobalScope { // not obsolete
    2775   void importScripts(DOMString... urls);
    2776   readonly attribute WorkerNavigator navigator;
    2777 };
    2778 WorkerGlobalScope implements WindowTimers;
    2779 WorkerGlobalScope implements WindowBase64;
    2780 
    2781 [Exposed=Worker]
    2782 interface WorkerNavigator {};
    2783 WorkerNavigator implements NavigatorID;
    2784 WorkerNavigator implements NavigatorLanguage;
    2785 WorkerNavigator implements NavigatorOnLine;
    2786 
    2787 [Exposed=Worker]
    2788 interface WorkerLocation {
    2789   stringifier readonly attribute USVString href;
    2790   readonly attribute USVString origin;
    2791   readonly attribute USVString protocol;
    2792   readonly attribute USVString host;
    2793   readonly attribute USVString hostname;
    2794   readonly attribute USVString port;
    2795   readonly attribute USVString pathname;
    2796   readonly attribute USVString search;
    2797   readonly attribute USVString hash;
    2798 };
    2799 
    2800 interface Storage {
    2801   readonly attribute unsigned long length;
    2802   DOMString? key(unsigned long index);
    2803   getter DOMString? getItem(DOMString key);
    2804   setter creator void setItem(DOMString key, DOMString value);
    2805   deleter void removeItem(DOMString key);
    2806   void clear();
    2807 };
    2808 
    2809 [NoInterfaceObject]
    2810 interface WindowSessionStorage {
    2811   readonly attribute Storage sessionStorage;
    2812 };
    2813 Window implements WindowSessionStorage;
    2814 
    2815 [NoInterfaceObject]
    2816 interface WindowLocalStorage {
    2817   readonly attribute Storage localStorage;
    2818 };
    2819 Window implements WindowLocalStorage;
    2820 
    2821 [Constructor(DOMString type, optional StorageEventInit eventInitDict)]
    2822 interface StorageEvent : Event {
    2823   readonly attribute DOMString? key;
    2824   readonly attribute DOMString? oldValue;
    2825   readonly attribute DOMString? newValue;
    2826   readonly attribute DOMString url;
    2827   readonly attribute Storage? storageArea;
    2828 };
    2829 
    2830 dictionary StorageEventInit : EventInit {
    2831   DOMString? key;
    2832   DOMString? oldValue;
    2833   DOMString? newValue;
    2834   DOMString url;
    2835   Storage? storageArea;
    2836 };
    2837 
    2838 interface HTMLAppletElement : HTMLElement {
    2839            attribute DOMString align;
    2840            attribute DOMString alt;
    2841            attribute DOMString archive;
    2842            attribute DOMString code;
    2843            attribute DOMString codeBase;
    2844            attribute DOMString height;
    2845            attribute unsigned long hspace;
    2846            attribute DOMString name;
    2847            attribute DOMString _object; // the underscore is not part of the identifier
    2848            attribute unsigned long vspace;
    2849            attribute DOMString width;
    2850 };
    2851 
    2852 interface HTMLMarqueeElement : HTMLElement {
    2853            attribute DOMString behavior;
    2854            attribute DOMString bgColor;
    2855            attribute DOMString direction;
    2856            attribute DOMString height;
    2857            attribute unsigned long hspace;
    2858            attribute long loop;
    2859            attribute unsigned long scrollAmount;
    2860            attribute unsigned long scrollDelay;
    2861            attribute boolean trueSpeed;
    2862            attribute unsigned long vspace;
    2863            attribute DOMString width;
    2864 
    2865            attribute EventHandler onbounce;
    2866            attribute EventHandler onfinish;
    2867            attribute EventHandler onstart;
    2868 
    2869   void start();
    2870   void stop();
    2871 };
    2872 
    2873 interface HTMLFrameSetElement : HTMLElement {
    2874            attribute DOMString cols;
    2875            attribute DOMString rows;
    2876 };
    2877 HTMLFrameSetElement implements WindowEventHandlers;
    2878 
    2879 interface HTMLFrameElement : HTMLElement {
    2880            attribute DOMString name;
    2881            attribute DOMString scrolling;
    2882            attribute DOMString src;
    2883            attribute DOMString frameBorder;
    2884            attribute DOMString longDesc;
    2885            attribute boolean noResize;
    2886   readonly attribute Document? contentDocument;
    2887   readonly attribute WindowProxy? contentWindow;
    2888 
    2889   [TreatNullAs=EmptyString] attribute DOMString marginHeight;
    2890   [TreatNullAs=EmptyString] attribute DOMString marginWidth;
    2891 };
    2892 
    2893 partial interface HTMLAnchorElement {
    2894            attribute DOMString coords;
    2895            attribute DOMString charset;
    2896            attribute DOMString name;
    2897            attribute DOMString rev;
    2898            attribute DOMString shape;
    2899 };
    2900 
    2901 partial interface HTMLAreaElement {
    2902            attribute boolean noHref;
    2903 };
    2904 
    2905 partial interface HTMLBodyElement {
    2906   [TreatNullAs=EmptyString] attribute DOMString text;
    2907   [TreatNullAs=EmptyString] attribute DOMString link;
    2908   [TreatNullAs=EmptyString] attribute DOMString vLink;
    2909   [TreatNullAs=EmptyString] attribute DOMString aLink;
    2910   [TreatNullAs=EmptyString] attribute DOMString bgColor;
    2911                             attribute DOMString background;
    2912 };
    2913 
    2914 partial interface HTMLBRElement {
    2915            attribute DOMString clear;
    2916 };
    2917 
    2918 partial interface HTMLTableCaptionElement {
    2919            attribute DOMString align;
    2920 };
    2921 
    2922 partial interface HTMLTableColElement {
    2923            attribute DOMString align;
    2924            attribute DOMString ch;
    2925            attribute DOMString chOff;
    2926            attribute DOMString vAlign;
    2927            attribute DOMString width;
    2928 };
    2929 
    2930 interface HTMLDirectoryElement : HTMLElement {
    2931            attribute boolean compact;
    2932 };
    2933 
    2934 partial interface HTMLDivElement {
    2935            attribute DOMString align;
    2936 };
    2937 
    2938 partial interface HTMLDListElement {
    2939            attribute boolean compact;
    2940 };
    2941 
    2942 partial interface HTMLEmbedElement {
    2943            attribute DOMString align;
    2944            attribute DOMString name;
    2945 };
    2946 
    2947 interface HTMLFontElement : HTMLElement {
    2948   [TreatNullAs=EmptyString] attribute DOMString color;
    2949                             attribute DOMString face;
    2950                             attribute DOMString size;
    2951 };
    2952 
    2953 partial interface HTMLHeadingElement {
    2954            attribute DOMString align;
    2955 };
    2956 
    2957 partial interface HTMLHRElement {
    2958            attribute DOMString align;
    2959            attribute DOMString color;
    2960            attribute boolean noShade;
    2961            attribute DOMString size;
    2962            attribute DOMString width;
    2963 };
    2964 
    2965 partial interface HTMLHtmlElement {
    2966            attribute DOMString version;
    2967 };
    2968 
    2969 partial interface HTMLIFrameElement {
    2970   [CEReactions] attribute DOMString align;
    2971   [CEReactions] attribute DOMString scrolling;
    2972   [CEReactions] attribute DOMString frameBorder;
    2973   [CEReactions] attribute USVString longDesc;
    2974 
    2975   [CEReactions, TreatNullAs=EmptyString] attribute DOMString marginHeight;
    2976   [CEReactions, TreatNullAs=EmptyString] attribute DOMString marginWidth;
    2977 };
    2978 
    2979 partial interface HTMLImageElement {
    2980   [CEReactions] attribute DOMString name;
    2981   [CEReactions] attribute USVString lowsrc;
    2982   [CEReactions] attribute DOMString align;
    2983   [CEReactions] attribute unsigned long hspace;
    2984   [CEReactions] attribute unsigned long vspace;
    2985   [CEReactions] attribute USVString longDesc;
    2986 
    2987   [CEReactions, TreatNullAs=EmptyString] attribute DOMString border;
    2988 };
    2989 
    2990 partial interface HTMLInputElement {
    2991            attribute DOMString align;
    2992            attribute DOMString useMap;
    2993 };
    2994 
    2995 partial interface HTMLLegendElement {
    2996            attribute DOMString align;
    2997 };
    2998 
    2999 partial interface HTMLLIElement {
    3000            attribute DOMString type;
    3001 };
    3002 
    3003 partial interface HTMLLinkElement {
    3004   [CEReactions] attribute DOMString charset;
    3005   [CEReactions] attribute DOMString rev;
    3006   [CEReactions] attribute DOMString target;
    3007 };
    3008 
    3009 partial interface HTMLMenuElement {
    3010            attribute boolean compact;
    3011 };
    3012 
    3013 partial interface HTMLMetaElement {
    3014            attribute DOMString scheme;
    3015 };
    3016 
    3017 partial interface HTMLObjectElement {
    3018            attribute DOMString align;
    3019            attribute DOMString archive;
    3020            attribute DOMString code;
    3021            attribute boolean declare;
    3022            attribute unsigned long hspace;
    3023            attribute DOMString standby;
    3024            attribute unsigned long vspace;
    3025            attribute DOMString codeBase;
    3026            attribute DOMString codeType;
    3027 
    3028   [TreatNullAs=EmptyString] attribute DOMString border;
    3029 };
    3030 
    3031 partial interface HTMLOListElement {
    3032            attribute boolean compact;
    3033 };
    3034 
    3035 partial interface HTMLParagraphElement {
    3036            attribute DOMString align;
    3037 };
    3038 
    3039 partial interface HTMLParamElement {
    3040            attribute DOMString type;
    3041            attribute DOMString valueType;
    3042 };
    3043 
    3044 partial interface HTMLPreElement {
    3045            attribute long width;
    3046 };
    3047 
    3048 partial interface HTMLScriptElement {
    3049            attribute DOMString event;
    3050            attribute DOMString htmlFor;
    3051 };
    3052 
    3053 partial interface HTMLTableElement {
    3054            attribute DOMString align;
    3055            attribute DOMString border;
    3056            attribute DOMString frame;
    3057            attribute DOMString rules;
    3058            attribute DOMString summary;
    3059            attribute DOMString width;
    3060 
    3061   [TreatNullAs=EmptyString] attribute DOMString bgColor;
    3062   [TreatNullAs=EmptyString] attribute DOMString cellPadding;
    3063   [TreatNullAs=EmptyString] attribute DOMString cellSpacing;
    3064 };
    3065 
    3066 partial interface HTMLTableSectionElement {
    3067            attribute DOMString align;
    3068            attribute DOMString ch;
    3069            attribute DOMString chOff;
    3070            attribute DOMString vAlign;
    3071 };
    3072 
    3073 partial interface HTMLTableCellElement {
    3074            attribute DOMString align;
    3075            attribute DOMString axis;
    3076            attribute DOMString height;
    3077            attribute DOMString width;
    3078 
    3079            attribute DOMString ch;
    3080            attribute DOMString chOff;
    3081            attribute boolean noWrap;
    3082            attribute DOMString vAlign;
    3083 
    3084   [TreatNullAs=EmptyString] attribute DOMString bgColor;
    3085 };
    3086 
    3087 partial interface HTMLTableRowElement {
    3088            attribute DOMString align;
    3089            attribute DOMString ch;
    3090            attribute DOMString chOff;
    3091            attribute DOMString vAlign;
    3092 
    3093   [TreatNullAs=EmptyString] attribute DOMString bgColor;
    3094 };
    3095 
    3096 partial interface HTMLUListElement {
    3097            attribute boolean compact;
    3098            attribute DOMString type;
    3099 };
    3100 
    3101 partial interface Document {
    3102   [TreatNullAs=EmptyString] attribute DOMString fgColor;
    3103   [TreatNullAs=EmptyString] attribute DOMString linkColor;
    3104   [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
    3105   [TreatNullAs=EmptyString] attribute DOMString alinkColor;
    3106   [TreatNullAs=EmptyString] attribute DOMString bgColor;
    3107 
    3108   readonly attribute HTMLCollection anchors;
    3109   readonly attribute HTMLCollection applets;
    3110 
    3111   void clear();
    3112   void captureEvents();
    3113   void releaseEvents();
    3114 
    3115   readonly attribute HTMLAllCollection all;
    3116 };
    3117 
    3118 partial interface Window {
    3119   void captureEvents();
    3120   void releaseEvents();
    3121 };
    3122 
    3123 </script>
    312414<script>
    312515"use strict";
    3126 var idlArray;
    312716var errorVideo; // used to get a MediaError object
    312817var iframe; // used to get a Document object (can't use `document` because some test clears the page)
    312918setup(function() {
    3130   idlArray = new IdlArray();
    3131   [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) {
    3132     if (node.className == "untested") {
    3133       idlArray.add_untested_idls(node.textContent);
    3134     } else {
    3135       idlArray.add_idls(node.textContent);
    3136     }
    3137   });
    313819  errorVideo = document.createElement('video');
    313920  errorVideo.src = 'data:,';
     
    314223  iframe.hidden = true;
    314324  document.body.appendChild(iframe);
    3144 }, {explicit_done:true});
     25});
    314526
    314627function createInput(type) {
     
    315031}
    315132
    3152 window.onload = function() {
     33function doTest([untested, tested]) {
     34  var idlArray = new IdlArray();
     35  idlArray.add_untested_idls(untested);
     36  idlArray.add_idls(tested);
     37
    315338  idlArray.add_objects({
    315439    NodeList: ['document.getElementsByName("name")'],
     
    3317202    Worker: [],
    3318203    SharedWorker: [],
    3319     MessageEvent: [],
     204    MessageEvent: ['new MessageEvent("message", { data: 5 })'],
    3320205    MessageChannel: [],
    3321206    MessagePort: [],
     
    3329214  idlArray.prevent_multiple_testing("HTMLElement");
    3330215  idlArray.test();
    3331   done();
    3332216};
     217
     218function fetchData(url) {
     219  return fetch(url).then((response) => response.text());
     220}
     221
     222function waitForLoad() {
     223  return new Promise(function(resolve) {
     224    addEventListener("load", resolve);
     225  });
     226}
     227
     228promise_test(function() {
     229  // Have to wait for onload
     230  return Promise.all([fetchData("resources/untested-interfaces.idl"),
     231                      fetchData("resources/interfaces.idl"),
     232                      waitForLoad()])
     233                .then(doTest);
     234}, "Test driver");
     235
    3333236</script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/resources/interfaces.idl

    r213516 r213517  
    1 <!doctype html>
    2 <meta charset=utf-8>
    3 <!--  WARNING: These tests are preliminary and probably partly incorrect.   -->
    4 <title>HTML IDL tests</title>
    5 <meta name=timeout content=long>
    6 <script src=/resources/testharness.js></script>
    7 <script src=/resources/testharnessreport.js></script>
    8 <script src=/resources/WebIDLParser.js></script>
    9 <script src=/resources/idlharness.js></script>
    10 
    11 <h1>HTML IDL tests</h1>
    12 <div id=log></div>
    13 
    14 <script type=text/plain class=untested>
    15 [Constructor(DOMString type, optional EventInit eventInitDict)/*,
    16  Exposed=(Window,Worker)*/]
    17 interface Event {
    18   readonly attribute DOMString type;
    19   readonly attribute EventTarget? target;
    20   readonly attribute EventTarget? currentTarget;
    21 
    22   const unsigned short NONE = 0;
    23   const unsigned short CAPTURING_PHASE = 1;
    24   const unsigned short AT_TARGET = 2;
    25   const unsigned short BUBBLING_PHASE = 3;
    26   readonly attribute unsigned short eventPhase;
    27 
    28   void stopPropagation();
    29   void stopImmediatePropagation();
    30 
    31   readonly attribute boolean bubbles;
    32   readonly attribute boolean cancelable;
    33   void preventDefault();
    34   readonly attribute boolean defaultPrevented;
    35 
    36   [Unforgeable] readonly attribute boolean isTrusted;
    37   readonly attribute DOMTimeStamp timeStamp;
    38 
    39   void initEvent(DOMString type, boolean bubbles, boolean cancelable);
    40 };
    41 
    42 dictionary EventInit {
    43   boolean bubbles = false;
    44   boolean cancelable = false;
    45 };
    46 
    47 [Constructor(DOMString type, optional CustomEventInit eventInitDict)/*,
    48  Exposed=(Window,Worker)*/]
    49 interface CustomEvent : Event {
    50   readonly attribute any detail;
    51 
    52   void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
    53 };
    54 
    55 dictionary CustomEventInit : EventInit {
    56   any detail = null;
    57 };
    58 
    59 //[Exposed=(Window,Worker)]
    60 interface EventTarget {
    61   void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
    62   void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);
    63   boolean dispatchEvent(Event event);
    64 };
    65 
    66 callback interface EventListener {
    67   void handleEvent(Event event);
    68 };
    69 
    70 [NoInterfaceObject]
    71 interface NonElementParentNode {
    72   Element? getElementById(DOMString elementId);
    73 };
    74 Document implements NonElementParentNode;
    75 DocumentFragment implements NonElementParentNode;
    76 
    77 [NoInterfaceObject]
    78 interface ParentNode {
    79   [SameObject] readonly attribute HTMLCollection children;
    80   readonly attribute Element? firstElementChild;
    81   readonly attribute Element? lastElementChild;
    82   readonly attribute unsigned long childElementCount;
    83 
    84   [Unscopable] void prepend((Node or DOMString)... nodes);
    85   [Unscopable] void append((Node or DOMString)... nodes);
    86 
    87   Element? querySelector(DOMString selectors);
    88   [NewObject] NodeList querySelectorAll(DOMString selectors);
    89 };
    90 Document implements ParentNode;
    91 DocumentFragment implements ParentNode;
    92 Element implements ParentNode;
    93 
    94 [NoInterfaceObject]
    95 interface NonDocumentTypeChildNode {
    96   readonly attribute Element? previousElementSibling;
    97   readonly attribute Element? nextElementSibling;
    98 };
    99 Element implements NonDocumentTypeChildNode;
    100 CharacterData implements NonDocumentTypeChildNode;
    101 
    102 [NoInterfaceObject]
    103 interface ChildNode {
    104   [Unscopable] void before((Node or DOMString)... nodes);
    105   [Unscopable] void after((Node or DOMString)... nodes);
    106   [Unscopable] void replaceWith((Node or DOMString)... nodes);
    107   [Unscopable] void remove();
    108 };
    109 DocumentType implements ChildNode;
    110 Element implements ChildNode;
    111 CharacterData implements ChildNode;
    112 
    113 // XXX unrecognized tokens "class", "extends"
    114 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20020
    115 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=23225
    116 //class Elements extends Array {
    117 //  Element? query(DOMString relativeSelectors);
    118 //  Elements queryAll(DOMString relativeSelectors);
    119 //};
    120 
    121 interface NodeList {
    122   getter Node? item(unsigned long index);
    123   readonly attribute unsigned long length;
    124 //  iterable<Node>;
    125 };
    126 
    127 interface HTMLCollection {
    128   readonly attribute unsigned long length;
    129   getter Element? item(unsigned long index);
    130   getter Element? namedItem(DOMString name);
    131 };
    132 
    133 [Constructor(MutationCallback callback)]
    134 interface MutationObserver {
    135   void observe(Node target, MutationObserverInit options);
    136   void disconnect();
    137   sequence<MutationRecord> takeRecords();
    138 };
    139 
    140 callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
    141 
    142 dictionary MutationObserverInit {
    143   boolean childList = false;
    144   boolean attributes;
    145   boolean characterData;
    146   boolean subtree = false;
    147   boolean attributeOldValue;
    148   boolean characterDataOldValue;
    149   sequence<DOMString> attributeFilter;
    150 };
    151 
    152 interface MutationRecord {
    153   readonly attribute DOMString type;
    154   readonly attribute Node target;
    155   [SameObject] readonly attribute NodeList addedNodes;
    156   [SameObject] readonly attribute NodeList removedNodes;
    157   readonly attribute Node? previousSibling;
    158   readonly attribute Node? nextSibling;
    159   readonly attribute DOMString? attributeName;
    160   readonly attribute DOMString? attributeNamespace;
    161   readonly attribute DOMString? oldValue;
    162 };
    163 
    164 interface Node : EventTarget {
    165   const unsigned short ELEMENT_NODE = 1;
    166   const unsigned short ATTRIBUTE_NODE = 2; // historical
    167   const unsigned short TEXT_NODE = 3;
    168   const unsigned short CDATA_SECTION_NODE = 4;
    169   const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
    170   const unsigned short ENTITY_NODE = 6; // historical
    171   const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
    172   const unsigned short COMMENT_NODE = 8;
    173   const unsigned short DOCUMENT_NODE = 9;
    174   const unsigned short DOCUMENT_TYPE_NODE = 10;
    175   const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
    176   const unsigned short NOTATION_NODE = 12; // historical
    177   readonly attribute unsigned short nodeType;
    178   readonly attribute DOMString nodeName;
    179 
    180   readonly attribute DOMString? baseURI;
    181 
    182   readonly attribute Document? ownerDocument;
    183   readonly attribute Node? parentNode;
    184   readonly attribute Element? parentElement;
    185   boolean hasChildNodes();
    186   [SameObject] readonly attribute NodeList childNodes;
    187   readonly attribute Node? firstChild;
    188   readonly attribute Node? lastChild;
    189   readonly attribute Node? previousSibling;
    190   readonly attribute Node? nextSibling;
    191 
    192            attribute DOMString? nodeValue;
    193            attribute DOMString? textContent;
    194   void normalize();
    195 
    196   [NewObject] Node cloneNode(optional boolean deep = false);
    197   boolean isEqualNode(Node? node);
    198 
    199   const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
    200   const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
    201   const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
    202   const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
    203   const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
    204   const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
    205   unsigned short compareDocumentPosition(Node other);
    206   boolean contains(Node? other);
    207 
    208   DOMString? lookupPrefix(DOMString? namespace);
    209   DOMString? lookupNamespaceURI(DOMString? prefix);
    210   boolean isDefaultNamespace(DOMString? namespace);
    211 
    212   Node insertBefore(Node node, Node? child);
    213   Node appendChild(Node node);
    214   Node replaceChild(Node node, Node child);
    215   Node removeChild(Node child);
    216 };
    217 
    218 [Constructor]
    219 interface Document : Node {
    220   [SameObject] readonly attribute DOMImplementation implementation;
    221   readonly attribute DOMString URL;
    222   readonly attribute DOMString documentURI;
    223   readonly attribute DOMString origin;
    224   readonly attribute DOMString compatMode;
    225   readonly attribute DOMString characterSet;
    226   readonly attribute DOMString charset; // legacy alias of .characterSet
    227   readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
    228   readonly attribute DOMString contentType;
    229 
    230   readonly attribute DocumentType? doctype;
    231   readonly attribute Element? documentElement;
    232   HTMLCollection getElementsByTagName(DOMString localName);
    233   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
    234   HTMLCollection getElementsByClassName(DOMString classNames);
    235 
    236   [NewObject] Element createElement(DOMString localName);
    237   [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName);
    238   [NewObject] DocumentFragment createDocumentFragment();
    239   [NewObject] Text createTextNode(DOMString data);
    240   [NewObject] CDATASection createCDATASection(DOMString data);
    241   [NewObject] Comment createComment(DOMString data);
    242   [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
    243 
    244   [NewObject] Node importNode(Node node, optional boolean deep = false);
    245   Node adoptNode(Node node);
    246 
    247   [NewObject] Attr createAttribute(DOMString localName);
    248   [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString name);
    249 
    250   [NewObject] Event createEvent(DOMString interface);
    251 
    252   [NewObject] Range createRange();
    253 
    254   // NodeFilter.SHOW_ALL = 0xFFFFFFFF
    255   [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
    256   [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
    257 };
    258 
    259 interface XMLDocument : Document {};
    260 
    261 interface DOMImplementation {
    262   [NewObject] DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
    263   [NewObject] XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, optional DocumentType? doctype = null);
    264   [NewObject] Document createHTMLDocument(optional DOMString title);
    265 
    266   boolean hasFeature(); // useless; always returns true
    267 };
    268 
    269 [Constructor]
    270 interface DocumentFragment : Node {
    271 };
    272 
    273 interface DocumentType : Node {
    274   readonly attribute DOMString name;
    275   readonly attribute DOMString publicId;
    276   readonly attribute DOMString systemId;
    277 };
    278 
    279 interface Element : Node {
    280   readonly attribute DOMString? namespaceURI;
    281   readonly attribute DOMString? prefix;
    282   readonly attribute DOMString localName;
    283   readonly attribute DOMString tagName;
    284 
    285            attribute DOMString id;
    286            attribute DOMString className;
    287   [SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
    288 
    289   boolean hasAttributes();
    290   [SameObject] readonly attribute NamedNodeMap attributes;
    291   sequence<DOMString> getAttributeNames();
    292   DOMString? getAttribute(DOMString name);
    293   DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
    294   void setAttribute(DOMString name, DOMString value);
    295   void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
    296   void removeAttribute(DOMString name);
    297   void removeAttributeNS(DOMString? namespace, DOMString localName);
    298   boolean hasAttribute(DOMString name);
    299   boolean hasAttributeNS(DOMString? namespace, DOMString localName);
    300 
    301   Attr? getAttributeNode(DOMString name);
    302   Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName);
    303   Attr? setAttributeNode(Attr attr);
    304   Attr? setAttributeNodeNS(Attr attr);
    305   Attr removeAttributeNode(Attr attr);
    306 
    307   Element? closest(DOMString selectors);
    308   boolean matches(DOMString selectors);
    309 
    310   HTMLCollection getElementsByTagName(DOMString localName);
    311   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
    312   HTMLCollection getElementsByClassName(DOMString classNames);
    313 };
    314 
    315 interface NamedNodeMap {
    316   readonly attribute unsigned long length;
    317   getter Attr? item(unsigned long index);
    318   getter Attr? getNamedItem(DOMString name);
    319   Attr? getNamedItemNS(DOMString? namespace, DOMString localName);
    320   Attr? setNamedItem(Attr attr);
    321   Attr? setNamedItemNS(Attr attr);
    322   Attr removeNamedItem(DOMString name);
    323   Attr removeNamedItemNS(DOMString? namespace, DOMString localName);
    324 };
    325 
    326 interface Attr {
    327   readonly attribute DOMString? namespaceURI;
    328   readonly attribute DOMString? prefix;
    329   readonly attribute DOMString localName;
    330   readonly attribute DOMString name;
    331            attribute DOMString value;
    332            attribute DOMString nodeValue; // legacy alias of .value
    333            attribute DOMString textContent; // legacy alias of .value
    334 
    335   readonly attribute Element? ownerElement;
    336 
    337   readonly attribute boolean specified; // useless; always returns true
    338 };
    339 
    340 interface CharacterData : Node {
    341   [TreatNullAs=EmptyString] attribute DOMString data;
    342   readonly attribute unsigned long length;
    343   DOMString substringData(unsigned long offset, unsigned long count);
    344   void appendData(DOMString data);
    345   void insertData(unsigned long offset, DOMString data);
    346   void deleteData(unsigned long offset, unsigned long count);
    347   void replaceData(unsigned long offset, unsigned long count, DOMString data);
    348 };
    349 
    350 [Constructor(optional DOMString data = "")]
    351 interface Text : CharacterData {
    352   [NewObject] Text splitText(unsigned long offset);
    353   readonly attribute DOMString wholeText;
    354 };
    355 
    356 [Exposed=Window]
    357 interface CDATASection : Text {
    358 };
    359 
    360 interface ProcessingInstruction : CharacterData {
    361   readonly attribute DOMString target;
    362 };
    363 
    364 [Constructor(optional DOMString data = "")]
    365 interface Comment : CharacterData {
    366 };
    367 
    368 [Constructor]
    369 interface Range {
    370   readonly attribute Node startContainer;
    371   readonly attribute unsigned long startOffset;
    372   readonly attribute Node endContainer;
    373   readonly attribute unsigned long endOffset;
    374   readonly attribute boolean collapsed;
    375   readonly attribute Node commonAncestorContainer;
    376 
    377   void setStart(Node node, unsigned long offset);
    378   void setEnd(Node node, unsigned long offset);
    379   void setStartBefore(Node node);
    380   void setStartAfter(Node node);
    381   void setEndBefore(Node node);
    382   void setEndAfter(Node node);
    383   void collapse(optional boolean toStart = false);
    384   void selectNode(Node node);
    385   void selectNodeContents(Node node);
    386 
    387   const unsigned short START_TO_START = 0;
    388   const unsigned short START_TO_END = 1;
    389   const unsigned short END_TO_END = 2;
    390   const unsigned short END_TO_START = 3;
    391   short compareBoundaryPoints(unsigned short how, Range sourceRange);
    392 
    393   void deleteContents();
    394   [NewObject] DocumentFragment extractContents();
    395   [NewObject] DocumentFragment cloneContents();
    396   void insertNode(Node node);
    397   void surroundContents(Node newParent);
    398 
    399   [NewObject] Range cloneRange();
    400   void detach();
    401 
    402   boolean isPointInRange(Node node, unsigned long offset);
    403   short comparePoint(Node node, unsigned long offset);
    404 
    405   boolean intersectsNode(Node node);
    406 
    407   stringifier;
    408 };
    409 
    410 interface NodeIterator {
    411   [SameObject] readonly attribute Node root;
    412   readonly attribute Node referenceNode;
    413   readonly attribute boolean pointerBeforeReferenceNode;
    414   readonly attribute unsigned long whatToShow;
    415   readonly attribute NodeFilter? filter;
    416 
    417   Node? nextNode();
    418   Node? previousNode();
    419 
    420   void detach();
    421 };
    422 
    423 interface TreeWalker {
    424   [SameObject] readonly attribute Node root;
    425   readonly attribute unsigned long whatToShow;
    426   readonly attribute NodeFilter? filter;
    427            attribute Node currentNode;
    428 
    429   Node? parentNode();
    430   Node? firstChild();
    431   Node? lastChild();
    432   Node? previousSibling();
    433   Node? nextSibling();
    434   Node? previousNode();
    435   Node? nextNode();
    436 };
    437 
    438 callback interface NodeFilter {
    439   // Constants for acceptNode()
    440   const unsigned short FILTER_ACCEPT = 1;
    441   const unsigned short FILTER_REJECT = 2;
    442   const unsigned short FILTER_SKIP = 3;
    443 
    444   // Constants for whatToShow
    445   const unsigned long SHOW_ALL = 0xFFFFFFFF;
    446   const unsigned long SHOW_ELEMENT = 0x1;
    447   const unsigned long SHOW_ATTRIBUTE = 0x2; // historical
    448   const unsigned long SHOW_TEXT = 0x4;
    449   const unsigned long SHOW_CDATA_SECTION = 0x8;
    450   const unsigned long SHOW_ENTITY_REFERENCE = 0x10; // historical
    451   const unsigned long SHOW_ENTITY = 0x20; // historical
    452   const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40;
    453   const unsigned long SHOW_COMMENT = 0x80;
    454   const unsigned long SHOW_DOCUMENT = 0x100;
    455   const unsigned long SHOW_DOCUMENT_TYPE = 0x200;
    456   const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400;
    457   const unsigned long SHOW_NOTATION = 0x800; // historical
    458 
    459   unsigned short acceptNode(Node node);
    460 };
    461 
    462 interface DOMTokenList {
    463   readonly attribute unsigned long length;
    464   getter DOMString? item(unsigned long index);
    465   boolean contains(DOMString token);
    466   [CEReactions] void add(DOMString... tokens);
    467   [CEReactions] void remove(DOMString... tokens);
    468   [CEReactions] boolean toggle(DOMString token, optional boolean force);
    469   [CEReactions] void replace(DOMString token, DOMString newToken);
    470   boolean supports(DOMString token);
    471   [CEReactions] stringifier attribute DOMString value;
    472   //  iterable<DOMString>;
    473 };</script>
    474 <!--  UI Events IDLs  -->
    475 <script type=text/plain class=untested>
    476 [Constructor(DOMString type, optional UIEventInit eventInitDict)]
    477 interface UIEvent : Event {
    478     readonly    attribute WindowProxy? view;
    479     readonly    attribute long         detail;
    480 };
    481 
    482 dictionary UIEventInit : EventInit {
    483     WindowProxy? view = null;
    484     long         detail = 0;
    485 };
    486 
    487 [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
    488 interface MouseEvent : UIEvent {
    489     readonly    attribute long           screenX;
    490     readonly    attribute long           screenY;
    491     readonly    attribute long           clientX;
    492     readonly    attribute long           clientY;
    493     readonly    attribute boolean        ctrlKey;
    494     readonly    attribute boolean        shiftKey;
    495     readonly    attribute boolean        altKey;
    496     readonly    attribute boolean        metaKey;
    497     readonly    attribute short          button;
    498     readonly    attribute EventTarget?   relatedTarget;
    499     // Introduced in DOM Level 3
    500     readonly    attribute unsigned short buttons;
    501     boolean getModifierState (DOMString keyArg);
    502 };
    503 
    504 dictionary MouseEventInit : EventModifierInit {
    505     long           screenX = 0;
    506     long           screenY = 0;
    507     long           clientX = 0;
    508     long           clientY = 0;
    509     short          button = 0;
    510     unsigned short buttons = 0;
    511     EventTarget?   relatedTarget = null;
    512 };
    513 
    514 dictionary EventModifierInit : UIEventInit {
    515     boolean ctrlKey = false;
    516     boolean shiftKey = false;
    517     boolean altKey = false;
    518     boolean metaKey = false;
    519     boolean keyModifierStateAltGraph = false;
    520     boolean keyModifierStateCapsLock = false;
    521     boolean keyModifierStateFn = false;
    522     boolean keyModifierStateFnLock = false;
    523     boolean keyModifierStateHyper = false;
    524     boolean keyModifierStateNumLock = false;
    525     boolean keyModifierStateOS = false;
    526     boolean keyModifierStateScrollLock = false;
    527     boolean keyModifierStateSuper = false;
    528     boolean keyModifierStateSymbol = false;
    529     boolean keyModifierStateSymbolLock = false;
    530 };
    531 
    532 partial interface MouseEvent {
    533     // Deprecated in DOM Level 3
    534     void initMouseEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, boolean ctrlKeyArg, boolean altKeyArg, boolean shiftKeyArg, boolean metaKeyArg, short buttonArg, EventTarget? relatedTargetArg);
    535 };
    536 </script>
    537 <!--  Touch Events IDLs  -->
    538 <script type=text/plain class=untested>
    539 interface Touch {
    540     readonly    attribute long        identifier;
    541     readonly    attribute EventTarget target;
    542     readonly    attribute long        screenX;
    543     readonly    attribute long        screenY;
    544     readonly    attribute long        clientX;
    545     readonly    attribute long        clientY;
    546     readonly    attribute long        pageX;
    547     readonly    attribute long        pageY;
    548 };
    549 </script>
    550 <!--  CSSOM IDLs  -->
    551 <script type=text/plain class=untested>
    552 interface MediaList {
    553   stringifier attribute DOMString mediaText;
    554   readonly attribute unsigned long length;
    555   getter DOMString item(unsigned long index);
    556   void appendMedium(DOMString medium);
    557   void deleteMedium(DOMString medium);
    558 };
    559 
    560 interface StyleSheet {
    561   readonly attribute DOMString type;
    562   readonly attribute DOMString href;
    563   readonly attribute Node ownerNode;
    564   readonly attribute StyleSheet parentStyleSheet;
    565   readonly attribute DOMString title;
    566   [PutForwards=mediaText] readonly attribute MediaList media;
    567            attribute boolean disabled;
    568 };
    569 
    570 interface CSSStyleSheet : StyleSheet {
    571   readonly attribute CSSRule ownerRule;
    572   readonly attribute CSSRuleList cssRules;
    573   unsigned long insertRule(DOMString rule, unsigned long index);
    574   void deleteRule(unsigned long index);
    575 };
    576 
    577 typedef sequence<StyleSheet> StyleSheetList;
    578 
    579 partial interface Document {
    580   [SameObject] readonly attribute StyleSheetList styleSheets;
    581 };
    582 
    583 [NoInterfaceObject] interface LinkStyle {
    584   readonly attribute StyleSheet sheet;
    585 };
    586 
    587 ProcessingInstruction implements LinkStyle;
    588 
    589 typedef sequence<CSSRule> CSSRuleList;
    590 
    591 interface CSSRule {
    592   // Types
    593   const unsigned short STYLE_RULE = 1;
    594   const unsigned short IMPORT_RULE = 3;
    595   const unsigned short MEDIA_RULE = 4;
    596   const unsigned short FONT_FACE_RULE = 5;
    597   const unsigned short PAGE_RULE = 6;
    598   const unsigned short NAMESPACE_RULE = 10;
    599   readonly attribute unsigned short type;
    600 
    601   // Parsing and serialization
    602            attribute DOMString cssText;
    603 
    604   // Context
    605   readonly attribute CSSRule parentRule;
    606   readonly attribute CSSStyleSheet parentStyleSheet;
    607 };
    608 
    609 interface CSSStyleRule : CSSRule {
    610            attribute DOMString selectorText;
    611   readonly attribute CSSStyleDeclaration style;
    612 };
    613 
    614 interface CSSImportRule : CSSRule {
    615   readonly attribute DOMString href;
    616   [PutForwards=mediaText] readonly attribute MediaList media;
    617   readonly attribute CSSStyleSheet styleSheet;
    618 };
    619 
    620 interface CSSMediaRule : CSSRule {
    621   [PutForwards=mediaText] readonly attribute MediaList media;
    622   readonly attribute CSSRuleList cssRules;
    623   unsigned long insertRule(DOMString rule, unsigned long index);
    624   void deleteRule(unsigned long index);
    625 };
    626 
    627 interface CSSFontFaceRule : CSSRule {
    628   readonly attribute CSSStyleDeclaration style;
    629 };
    630 
    631 interface CSSPageRule : CSSRule {
    632            attribute DOMString selectorText;
    633   readonly attribute CSSStyleDeclaration style;
    634 };
    635 
    636 interface CSSNamespaceRule : CSSRule {
    637   readonly attribute DOMString namespaceURI;
    638   readonly attribute DOMString? prefix;
    639 };
    640 
    641 interface CSSStyleDeclaration {
    642            attribute DOMString cssText;
    643 
    644   readonly attribute unsigned long length;
    645   DOMString item(unsigned long index);
    646 
    647   DOMString getPropertyValue(DOMString property);
    648   DOMString getPropertyPriority(DOMString property);
    649   void setProperty(DOMString property, DOMString value, optional DOMString priority);
    650   DOMString removeProperty(DOMString property);
    651 
    652   readonly attribute CSSStyleDeclarationValue values;
    653 
    654   readonly attribute CSSRule parentRule;
    655 
    656   // CSS Properties
    657            attribute DOMString azimuth;
    658            attribute DOMString background;
    659            attribute DOMString backgroundAttachment;
    660            attribute DOMString backgroundColor;
    661            attribute DOMString backgroundImage;
    662            attribute DOMString backgroundPosition;
    663            attribute DOMString backgroundRepeat;
    664            attribute DOMString border;
    665            attribute DOMString borderCollapse;
    666            attribute DOMString borderColor;
    667            attribute DOMString borderSpacing;
    668            attribute DOMString borderStyle;
    669            attribute DOMString borderTop;
    670            attribute DOMString borderRight;
    671            attribute DOMString borderBottom;
    672            attribute DOMString borderLeft;
    673            attribute DOMString borderTopColor;
    674            attribute DOMString borderRightColor;
    675            attribute DOMString borderBottomColor;
    676            attribute DOMString borderLeftColor;
    677            attribute DOMString borderTopStyle;
    678            attribute DOMString borderRightStyle;
    679            attribute DOMString borderBottomStyle;
    680            attribute DOMString borderLeftStyle;
    681            attribute DOMString borderTopWidth;
    682            attribute DOMString borderRightWidth;
    683            attribute DOMString borderBottomWidth;
    684            attribute DOMString borderLeftWidth;
    685            attribute DOMString borderWidth;
    686            attribute DOMString bottom;
    687            attribute DOMString captionSide;
    688            attribute DOMString clear;
    689            attribute DOMString clip;
    690            attribute DOMString color;
    691            attribute DOMString content;
    692            attribute DOMString counterIncrement;
    693            attribute DOMString counterReset;
    694            attribute DOMString cue;
    695            attribute DOMString cueAfter;
    696            attribute DOMString cueBefore;
    697            attribute DOMString cursor;
    698            attribute DOMString direction;
    699            attribute DOMString display;
    700            attribute DOMString elevation;
    701            attribute DOMString emptyCells;
    702            attribute DOMString cssFloat;
    703            attribute DOMString font;
    704            attribute DOMString fontFamily;
    705            attribute DOMString fontSize;
    706            attribute DOMString fontSizeAdjust;
    707            attribute DOMString fontStretch;
    708            attribute DOMString fontStyle;
    709            attribute DOMString fontVariant;
    710            attribute DOMString fontWeight;
    711            attribute DOMString height;
    712            attribute DOMString left;
    713            attribute DOMString letterSpacing;
    714            attribute DOMString lineHeight;
    715            attribute DOMString listStyle;
    716            attribute DOMString listStyleImage;
    717            attribute DOMString listStylePosition;
    718            attribute DOMString listStyleType;
    719            attribute DOMString margin;
    720            attribute DOMString marginTop;
    721            attribute DOMString marginRight;
    722            attribute DOMString marginBottom;
    723            attribute DOMString marginLeft;
    724            attribute DOMString marks;
    725            attribute DOMString maxHeight;
    726            attribute DOMString maxWidth;
    727            attribute DOMString minHeight;
    728            attribute DOMString minWidth;
    729            attribute DOMString orphans;
    730            attribute DOMString outline;
    731            attribute DOMString outlineColor;
    732            attribute DOMString outlineStyle;
    733            attribute DOMString outlineWidth;
    734            attribute DOMString overflow;
    735            attribute DOMString padding;
    736            attribute DOMString paddingTop;
    737            attribute DOMString paddingRight;
    738            attribute DOMString paddingBottom;
    739            attribute DOMString paddingLeft;
    740            attribute DOMString page;
    741            attribute DOMString pageBreakAfter;
    742            attribute DOMString pageBreakBefore;
    743            attribute DOMString pageBreakInside;
    744            attribute DOMString pause;
    745            attribute DOMString pauseAfter;
    746            attribute DOMString pauseBefore;
    747            attribute DOMString pitch;
    748            attribute DOMString pitchRange;
    749            attribute DOMString playDuring;
    750            attribute DOMString position;
    751            attribute DOMString quotes;
    752            attribute DOMString richness;
    753            attribute DOMString right;
    754            attribute DOMString size;
    755            attribute DOMString speak;
    756            attribute DOMString speakHeader;
    757            attribute DOMString speakNumeral;
    758            attribute DOMString speakPunctuation;
    759            attribute DOMString speechRate;
    760            attribute DOMString stress;
    761            attribute DOMString tableLayout;
    762            attribute DOMString textAlign;
    763            attribute DOMString textDecoration;
    764            attribute DOMString textIndent;
    765            attribute DOMString textShadow;
    766            attribute DOMString textTransform;
    767            attribute DOMString top;
    768            attribute DOMString unicodeBidi;
    769            attribute DOMString verticalAlign;
    770            attribute DOMString visibility;
    771            attribute DOMString voiceFamily;
    772            attribute DOMString volume;
    773            attribute DOMString whiteSpace;
    774            attribute DOMString widows;
    775            attribute DOMString width;
    776            attribute DOMString wordSpacing;
    777            attribute DOMString zIndex;
    778 };
    779 
    780 interface CSSStyleDeclarationValue {
    781   // ...
    782 
    783   // CSS Properties
    784 
    785 };
    786 
    787 interface CSSPropertyValue {
    788            attribute DOMString cssText;
    789 };
    790 
    791 [NoInterfaceObject] interface CSSMapValue {
    792   getter CSSValue (DOMString name);
    793 };
    794 
    795 [NoInterfaceObject] interface CSSPropertyValueList {
    796   readonly attribute CSSValue[] list;
    797 };
    798 
    799 [NoInterfaceObject] interface CSSComponentValue {
    800   readonly attribute DOMString type;
    801            attribute any value;
    802 };
    803 
    804 [NoInterfaceObject] interface CSSStringComponentValue {
    805            attribute DOMString string;
    806 };
    807 
    808 [NoInterfaceObject] interface CSSKeywordComponentValue {
    809            attribute DOMString keyword;
    810 };
    811 
    812 [NoInterfaceObject] interface CSSIdentifierComponentValue {
    813            attribute DOMString identifier;
    814 };
    815 
    816 [NoInterfaceObject] interface CSSColorComponentValue {
    817            attribute short red;
    818            attribute short green;
    819            attribute short blue;
    820            attribute float alpha;
    821 };
    822 
    823 [NoInterfaceObject] interface CSSLengthComponentValue {
    824            attribute float em;
    825            attribute float ex;
    826            attribute float px;
    827            // figure out what to do with absolute lengths
    828 };
    829 
    830 [NoInterfaceObject] interface CSSPercentageComponentValue {
    831            attribute float percent;
    832 };
    833 
    834 [NoInterfaceObject] interface CSSURLComponentValue {
    835            attribute DOMString? url;
    836 };
    837 
    838 [NoInterfaceObject] interface ElementCSSInlineStyle {
    839   readonly attribute CSSStyleDeclaration style;
    840 };
    841 
    842 //partial interface Window {
    843 //  CSSStyleDeclaration getComputedStyle(Element elt);
    844 //  CSSStyleDeclaration getComputedStyle(Element elt, DOMString pseudoElt);
    845 //};
    846 </script>
    847 
    848 <!--  HTML IDLs  -->
    849 <script type=text/plain>
     1// HTML IDLs
    8502typedef (Int8Array or Uint8Array or Uint8ClampedArray or
    8513         Int16Array or Uint16Array or
     
    89648typedef sequence<any> PropertyValueArray;
    89749
    898 [OverrideBuiltins, Exposed=(Window,Worker)]
     50[OverrideBuiltins]
    89951interface DOMStringMap {
    90052  getter DOMString (DOMString name);
     
    985137  readonly attribute DOMString accessKeyLabel;
    986138  [CEReactions] attribute boolean draggable;
    987   [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList dropzone;
    988139  [CEReactions] attribute HTMLMenuElement? contextMenu;
    989140  [CEReactions] attribute boolean spellcheck;
     
    1531682};
    1532683
     684[HTMLConstructor]
    1533685interface HTMLInputElement : HTMLElement {
    1534           attribute DOMString accept;
    1535           attribute DOMString alt;
    1536           attribute DOMString autocomplete;
    1537           attribute boolean autofocus;
    1538           attribute boolean defaultChecked;
    1539            attribute boolean checked;
    1540           attribute DOMString dirName;
    1541           attribute boolean disabled;
     686  [CEReactions] attribute DOMString accept;
     687  [CEReactions] attribute DOMString alt;
     688  [CEReactions] attribute DOMString autocomplete;
     689  [CEReactions] attribute boolean autofocus;
     690  [CEReactions] attribute boolean defaultChecked;
     691  attribute boolean checked;
     692  [CEReactions] attribute DOMString dirName;
     693  [CEReactions] attribute boolean disabled;
    1542694  readonly attribute HTMLFormElement? form;
    1543695  readonly attribute FileList? files;
    1544            attribute DOMString formAction;
    1545           attribute DOMString formEnctype;
    1546           attribute DOMString formMethod;
    1547           attribute boolean formNoValidate;
    1548           attribute DOMString formTarget;
    1549           attribute unsigned long height;
    1550            attribute boolean indeterminate;
    1551           attribute DOMString inputMode;
     696  [CEReactions] attribute USVString formAction;
     697  [CEReactions] attribute DOMString formEnctype;
     698  [CEReactions] attribute DOMString formMethod;
     699  [CEReactions] attribute boolean formNoValidate;
     700  [CEReactions] attribute DOMString formTarget;
     701  [CEReactions] attribute unsigned long height;
     702  attribute boolean indeterminate;
     703  [CEReactions] attribute DOMString inputMode;
    1552704  readonly attribute HTMLElement? list;
    1553           attribute DOMString max;
    1554           attribute long maxLength;
    1555           attribute DOMString min;
    1556           attribute long minLength;
    1557           attribute boolean multiple;
    1558           attribute DOMString name;
    1559           attribute DOMString pattern;
    1560           attribute DOMString placeholder;
    1561           attribute boolean readOnly;
    1562           attribute boolean required;
    1563           attribute unsigned long size;
    1564            attribute DOMString src;
    1565           attribute DOMString step;
    1566           attribute DOMString type;
    1567           attribute DOMString defaultValue;
    1568   [TreatNullAs=EmptyString] attribute DOMString value;
    1569            attribute Date? valueAsDate;
    1570            attribute unrestricted double valueAsNumber;
    1571           attribute unsigned long width;
     705  [CEReactions] attribute DOMString max;
     706  [CEReactions] attribute long maxLength;
     707  [CEReactions] attribute DOMString min;
     708  [CEReactions] attribute long minLength;
     709  [CEReactions] attribute boolean multiple;
     710  [CEReactions] attribute DOMString name;
     711  [CEReactions] attribute DOMString pattern;
     712  [CEReactions] attribute DOMString placeholder;
     713  [CEReactions] attribute boolean readOnly;
     714  [CEReactions] attribute boolean required;
     715  [CEReactions] attribute unsigned long size;
     716  [CEReactions] attribute USVString src;
     717  [CEReactions] attribute DOMString step;
     718  [CEReactions] attribute DOMString type;
     719  [CEReactions] attribute DOMString defaultValue;
     720  [CEReactions, TreatNullAs=EmptyString] attribute DOMString value;
     721  attribute object? valueAsDate;
     722  attribute unrestricted double valueAsNumber;
     723  [CEReactions] attribute unsigned long width;
    1572724
    1573725  void stepUp(optional long n = 1);
     
    1581733  void setCustomValidity(DOMString error);
    1582734
    1583   readonly attribute NodeList labels;
     735  readonly attribute NodeList? labels;
    1584736
    1585737  void select();
    1586            attribute unsigned long? selectionStart;
    1587            attribute unsigned long? selectionEnd;
    1588            attribute DOMString? selectionDirection;
     738  attribute unsigned long? selectionStart;
     739  attribute unsigned long? selectionEnd;
     740  attribute DOMString? selectionDirection;
    1589741  void setRangeText(DOMString replacement);
    1590742  void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
     
    1594746};
    1595747
     748[HTMLConstructor]
    1596749interface HTMLButtonElement : HTMLElement {
    1597           attribute boolean autofocus;
    1598           attribute boolean disabled;
     750  [CEReactions] attribute boolean autofocus;
     751  [CEReactions] attribute boolean disabled;
    1599752  readonly attribute HTMLFormElement? form;
    1600            attribute DOMString formAction;
    1601           attribute DOMString formEnctype;
    1602           attribute DOMString formMethod;
    1603           attribute boolean formNoValidate;
    1604           attribute DOMString formTarget;
    1605           attribute DOMString name;
    1606           attribute DOMString type;
    1607           attribute DOMString value;
     753  [CEReactions] attribute USVString formAction;
     754  [CEReactions] attribute DOMString formEnctype;
     755  [CEReactions] attribute DOMString formMethod;
     756  [CEReactions] attribute boolean formNoValidate;
     757  [CEReactions] attribute DOMString formTarget;
     758  [CEReactions] attribute DOMString name;
     759  [CEReactions] attribute DOMString type;
     760  [CEReactions] attribute DOMString value;
    1608761
    1609762  readonly attribute boolean willValidate;
     
    1617770};
    1618771
     772[HTMLConstructor]
    1619773interface HTMLSelectElement : HTMLElement {
    1620           attribute DOMString autocomplete;
    1621           attribute boolean autofocus;
    1622           attribute boolean disabled;
     774  [CEReactions] attribute DOMString autocomplete;
     775  [CEReactions] attribute boolean autofocus;
     776  [CEReactions] attribute boolean disabled;
    1623777  readonly attribute HTMLFormElement? form;
    1624           attribute boolean multiple;
    1625           attribute DOMString name;
    1626           attribute boolean required;
    1627           attribute unsigned long size;
     778  [CEReactions] attribute boolean multiple;
     779  [CEReactions] attribute DOMString name;
     780  [CEReactions] attribute boolean required;
     781  [CEReactions] attribute unsigned long size;
    1628782
    1629783  readonly attribute DOMString type;
    1630784
    1631   readonly attribute HTMLOptionsCollection options;
    1632           attribute unsigned long length;
     785  [SameObject] readonly attribute HTMLOptionsCollection options;
     786  [CEReactions] attribute unsigned long length;
    1633787  getter Element? item(unsigned long index);
    1634788  HTMLOptionElement? namedItem(DOMString name);
    1635   void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
    1636   void remove(); // ChildNode overload
    1637   void remove(long index);
    1638   setter creator void (unsigned long index, HTMLOptionElement? option);
    1639 
    1640   readonly attribute HTMLCollection selectedOptions;
    1641            attribute long selectedIndex;
    1642            attribute DOMString value;
     789  [CEReactions] void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
     790  [CEReactions] void remove(); // ChildNode overload
     791  [CEReactions] void remove(long index);
     792  [CEReactions] setter void (unsigned long index, HTMLOptionElement? option);
     793
     794  [SameObject] readonly attribute HTMLCollection selectedOptions;
     795  attribute long selectedIndex;
     796  attribute DOMString value;
    1643797
    1644798  readonly attribute boolean willValidate;
     
    1674828};
    1675829
     830[HTMLConstructor]
    1676831interface HTMLTextAreaElement : HTMLElement {
    1677           attribute DOMString autocomplete;
    1678           attribute boolean autofocus;
    1679           attribute unsigned long cols;
    1680           attribute DOMString dirName;
    1681           attribute boolean disabled;
     832  [CEReactions] attribute DOMString autocomplete;
     833  [CEReactions] attribute boolean autofocus;
     834  [CEReactions] attribute unsigned long cols;
     835  [CEReactions] attribute DOMString dirName;
     836  [CEReactions] attribute boolean disabled;
    1682837  readonly attribute HTMLFormElement? form;
    1683           attribute DOMString inputMode;
    1684           attribute long maxLength;
    1685           attribute long minLength;
    1686           attribute DOMString name;
    1687           attribute DOMString placeholder;
    1688           attribute boolean readOnly;
    1689           attribute boolean required;
    1690           attribute unsigned long rows;
    1691           attribute DOMString wrap;
     838  [CEReactions] attribute DOMString inputMode;
     839  [CEReactions] attribute long maxLength;
     840  [CEReactions] attribute long minLength;
     841  [CEReactions] attribute DOMString name;
     842  [CEReactions] attribute DOMString placeholder;
     843  [CEReactions] attribute boolean readOnly;
     844  [CEReactions] attribute boolean required;
     845  [CEReactions] attribute unsigned long rows;
     846  [CEReactions] attribute DOMString wrap;
    1692847
    1693848  readonly attribute DOMString type;
    1694           attribute DOMString defaultValue;
    1695   [TreatNullAs=EmptyString] attribute DOMString value;
     849  [CEReactions] attribute DOMString defaultValue;
     850  [CEReactions, TreatNullAs=EmptyString] attribute DOMString value;
    1696851  readonly attribute unsigned long textLength;
    1697852
     
    1706861
    1707862  void select();
    1708            attribute unsigned long? selectionStart;
    1709            attribute unsigned long? selectionEnd;
    1710            attribute DOMString? selectionDirection;
     863  attribute unsigned long selectionStart;
     864  attribute unsigned long selectionEnd;
     865  attribute DOMString selectionDirection;
    1711866  void setRangeText(DOMString replacement);
    1712867  void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
     
    1714869};
    1715870
     871[HTMLConstructor]
    1716872interface HTMLOutputElement : HTMLElement {
    1717   [PutForwards=value] readonly attribute DOMTokenList htmlFor;
     873  [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor;
    1718874  readonly attribute HTMLFormElement? form;
    1719           attribute DOMString name;
     875  [CEReactions] attribute DOMString name;
    1720876
    1721877  readonly attribute DOMString type;
    1722           attribute DOMString defaultValue;
    1723           attribute DOMString value;
     878  [CEReactions] attribute DOMString defaultValue;
     879  [CEReactions] attribute DOMString value;
    1724880
    1725881  readonly attribute boolean willValidate;
     
    1733889};
    1734890
     891[HTMLConstructor]
    1735892interface HTMLProgressElement : HTMLElement {
    1736           attribute double value;
    1737           attribute double max;
     893  [CEReactions] attribute double value;
     894  [CEReactions] attribute double max;
    1738895  readonly attribute double position;
    1739896  readonly attribute NodeList labels;
    1740897};
    1741898
     899[HTMLConstructor]
    1742900interface HTMLMeterElement : HTMLElement {
    1743           attribute double value;
    1744           attribute double min;
    1745           attribute double max;
    1746           attribute double low;
    1747           attribute double high;
    1748           attribute double optimum;
     901  [CEReactions] attribute double value;
     902  [CEReactions] attribute double min;
     903  [CEReactions] attribute double max;
     904  [CEReactions] attribute double low;
     905  [CEReactions] attribute double high;
     906  [CEReactions] attribute double optimum;
    1749907  readonly attribute NodeList labels;
    1750908};
     
    22951453};
    22961454
    2297 [Constructor(DOMString type, optional PopStateEventInit eventInitDict), Exposed=(Window,Worker)]
     1455[Constructor(DOMString type, optional PopStateEventInit eventInitDict)]
    22981456interface PopStateEvent : Event {
    22991457  readonly attribute any state;
     
    23041462};
    23051463
    2306 [Constructor(DOMString type, optional HashChangeEventInit eventInitDict), Exposed=(Window,Worker)]
     1464[Constructor(DOMString type, optional HashChangeEventInit eventInitDict)]
    23071465interface HashChangeEvent : Event {
    23081466  readonly attribute DOMString oldURL;
     
    23151473};
    23161474
    2317 [Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), Exposed=(Window,Worker)]
     1475[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)]
    23181476interface PageTransitionEvent : Event {
    23191477  readonly attribute boolean persisted;
     
    24791637};
    24801638
     1639typedef (DOMString or Function) TimerHandler;
     1640
    24811641[NoInterfaceObject, Exposed=(Window,Worker)]
    2482 interface WindowBase64 {
     1642interface WindowOrWorkerGlobalScope {
     1643  [Replaceable] readonly attribute USVString origin;
     1644
     1645  // base64 utility methods
    24831646  DOMString btoa(DOMString btoa);
    24841647  DOMString atob(DOMString atob);
    2485 };
    2486 Window implements WindowBase64;
    2487 
    2488 [NoInterfaceObject, Exposed=(Window,Worker)]
    2489 interface WindowTimers {
    2490   long setTimeout(Function handler, optional long timeout = 0, any... arguments);
    2491   long setTimeout(DOMString handler, optional long timeout = 0, any... arguments);
     1648
     1649  // timers
     1650  long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
    24921651  void clearTimeout(optional long handle = 0);
    2493   long setInterval(Function handler, optional long timeout = 0, any... arguments);
    2494   long setInterval(DOMString handler, optional long timeout = 0, any... arguments);
     1652  long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
    24951653  void clearInterval(optional long handle = 0);
    2496 };
    2497 Window implements WindowTimers;
     1654
     1655  // ImageBitmap
     1656  Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, optional ImageBitmapOptions options);
     1657  Promise<ImageBitmap> createImageBitmap(ImageBitmapSource image, long sx, long sy, long sw, long sh, optional ImageBitmapOptions options);
     1658};
     1659
     1660Window implements WindowOrWorkerGlobalScope;
     1661WorkerGlobalScope implements WindowOrWorkerGlobalScope;
    24981662
    24991663[NoInterfaceObject]
     
    25161680[NoInterfaceObject, Exposed=(Window,Worker)]
    25171681interface NavigatorID {
    2518   [Exposed=Window] readonly attribute DOMString appCodeName; // constant "Mozilla"
     1682  readonly attribute DOMString appCodeName; // constant "Mozilla"
    25191683  readonly attribute DOMString appName; // constant "Netscape"
    25201684  readonly attribute DOMString appVersion;
    25211685  readonly attribute DOMString platform;
    2522   [Exposed=Window] readonly attribute DOMString product; // constant "Gecko"
     1686  readonly attribute DOMString product; // constant "Gecko"
    25231687  [Exposed=Window] readonly attribute DOMString productSub;
    25241688  readonly attribute DOMString userAgent;
     
    26091773         ImageBitmap) ImageBitmapSource;
    26101774
    2611 [NoInterfaceObject, Exposed=(Window,Worker)]
    2612 interface ImageBitmapFactories {
    2613   Promise createImageBitmap(ImageBitmapSource image, optional long sx, long sy, long sw, long sh);
    2614 };
    2615 Window implements ImageBitmapFactories;
    2616 WorkerGlobalScope implements ImageBitmapFactories;
     1775dictionary ImageBitmapOptions {
     1776  ImageOrientation imageOrientation = "none";
     1777  PremultiplyAlpha premultiplyAlpha = "default";
     1778  ColorSpaceConversion colorSpaceConversion = "default";
     1779  [EnforceRange] unsigned long resizeWidth;
     1780  [EnforceRange] unsigned long resizeHeight;
     1781  ResizeQuality resizeQuality = "low";
     1782};
    26171783
    26181784[Constructor(DOMString type, optional MessageEventInit eventInitDict), Exposed=(Window,Worker)]
     
    26241790  readonly attribute FrozenArray<MessagePort> ports;
    26251791
    2626   void initMessageEvent(DOMString type, boolean bubbles, boolean cancelable, any data, DOMString origin, DOMString lastEventId, (WindowProxy or MessagePort) source, sequence<MessagePort> ports);
     1792  void initMessageEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any data = null, optional DOMString origin = "", optional DOMString lastEventId = "", optional (WindowProxy or MessagePort)? source = null, optional sequence<MessagePort> ports = []);
    26271793};
    26281794
     
    27291895  readonly attribute WorkerGlobalScope self;
    27301896  readonly attribute WorkerLocation location;
    2731 
    2732   void close();
     1897  readonly attribute WorkerNavigator navigator;
     1898  void importScripts(USVString... urls);
     1899
    27331900           attribute OnErrorEventHandler onerror;
    27341901           attribute EventHandler onlanguagechange;
     
    27711938};
    27721939SharedWorker implements AbstractWorker;
    2773 
    2774 partial interface WorkerGlobalScope { // not obsolete
    2775   void importScripts(DOMString... urls);
    2776   readonly attribute WorkerNavigator navigator;
    2777 };
    2778 WorkerGlobalScope implements WindowTimers;
    2779 WorkerGlobalScope implements WindowBase64;
    27801940
    27811941[Exposed=Worker]
     
    31202280  void releaseEvents();
    31212281};
    3122 
    3123 </script>
    3124 <script>
    3125 "use strict";
    3126 var idlArray;
    3127 var errorVideo; // used to get a MediaError object
    3128 var iframe; // used to get a Document object (can't use `document` because some test clears the page)
    3129 setup(function() {
    3130   idlArray = new IdlArray();
    3131   [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) {
    3132     if (node.className == "untested") {
    3133       idlArray.add_untested_idls(node.textContent);
    3134     } else {
    3135       idlArray.add_idls(node.textContent);
    3136     }
    3137   });
    3138   errorVideo = document.createElement('video');
    3139   errorVideo.src = 'data:,';
    3140   errorVideo.preload = 'auto';
    3141   iframe = document.createElement('iframe');
    3142   iframe.hidden = true;
    3143   document.body.appendChild(iframe);
    3144 }, {explicit_done:true});
    3145 
    3146 function createInput(type) {
    3147   var input = document.createElement('input');
    3148   input.type = type;
    3149   return input;
    3150 }
    3151 
    3152 window.onload = function() {
    3153   idlArray.add_objects({
    3154     NodeList: ['document.getElementsByName("name")'],
    3155     HTMLAllCollection: ['document.all'],
    3156     HTMLFormControlsCollection: ['document.createElement("form").elements'],
    3157     RadioNodeList: [],
    3158     HTMLOptionsCollection: ['document.createElement("select").options'],
    3159     DOMStringMap: ['document.head.dataset'],
    3160     Transferable: [],
    3161     Document: ['iframe.contentDocument', 'new Document()'],
    3162     XMLDocument: ['document.implementation.createDocument(null, "", null)'],
    3163     HTMLElement: ['document.createElement("noscript")'], // more tests in html/semantics/interfaces.js
    3164     HTMLUnknownElement: ['document.createElement("bgsound")'], // more tests in html/semantics/interfaces.js
    3165     HTMLHtmlElement: ['document.createElement("html")'],
    3166     HTMLHeadElement: ['document.createElement("head")'],
    3167     HTMLTitleElement: ['document.createElement("title")'],
    3168     HTMLBaseElement: ['document.createElement("base")'],
    3169     HTMLLinkElement: ['document.createElement("link")'],
    3170     HTMLMetaElement: ['document.createElement("meta")'],
    3171     HTMLStyleElement: ['document.createElement("style")'],
    3172     HTMLScriptElement: ['document.createElement("script")'],
    3173     HTMLBodyElement: ['document.createElement("body")'],
    3174     HTMLHeadingElement: ['document.createElement("h1")'],
    3175     HTMLParagraphElement: ['document.createElement("p")'],
    3176     HTMLHRElement: ['document.createElement("hr")'],
    3177     HTMLPreElement: [
    3178       'document.createElement("pre")',
    3179       'document.createElement("listing")',
    3180       'document.createElement("xmp")',
    3181     ],
    3182     HTMLQuoteElement: [
    3183       'document.createElement("blockquote")',
    3184       'document.createElement("q")',
    3185     ],
    3186     HTMLOlistElement: ['document.createElement("ol")'],
    3187     HTMLUlistElement: ['document.createElement("ul")'],
    3188     HTMLLIElement: ['document.createElement("li")'],
    3189     HTMLDlistElement: ['document.createElement("dl")'],
    3190     HTMLDivElement: ['document.createElement("div")'],
    3191     HTMLAnchorElement: ['document.createElement("a")'],
    3192     HTMLDataElement: ['document.createElement("data")'],
    3193     HTMLTimeElement: ['document.createElement("time")'],
    3194     HTMLSpanElement: ['document.createElement("span")'],
    3195     HTMLBRElement: ['document.createElement("br")'],
    3196     HTMLModElement: [
    3197       'document.createElement("ins")',
    3198       'document.createElement("del")',
    3199     ],
    3200     HTMLPictureElement: ['document.createElement("picture")'],
    3201     HTMLImageElement: ['document.createElement("img")', 'new Image()'],
    3202     HTMLIframeElement: ['document.createElement("iframe")'],
    3203     HTMLEmbedElement: ['document.createElement("embed")'],
    3204     HTMLObjectElement: ['document.createElement("object")'],
    3205     HTMLParamElement: ['document.createElement("param")'],
    3206     HTMLVideoElement: ['document.createElement("video")'],
    3207     HTMLAudioElement: ['document.createElement("audio")', 'new Audio()'],
    3208     HTMLSourceElement: ['document.createElement("source")'],
    3209     HTMLTrackElement: ['document.createElement("track")'],
    3210     HTMLMediaElement: [],
    3211     MediaError: ['errorVideo.error'],
    3212     AudioTrackList: [],
    3213     AudioTrack: [],
    3214     VideoTrackList: [],
    3215     VideoTrack: [],
    3216     TextTrackList: ['document.createElement("video").textTracks'],
    3217     TextTrack: ['document.createElement("track").track'],
    3218     TextTrackCueList: ['document.createElement("video").addTextTrack("subtitles").cues'],
    3219     TextTrackCue: [],
    3220     DataCue: [],
    3221     TimeRanges: ['document.createElement("video").buffered'],
    3222     TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'],
    3223     HTMLTemplateElement: ['document.createElement("template")'],
    3224     HTMLSlotElement: ['document.createElement("slot")'],
    3225     HTMLCanvasElement: ['document.createElement("canvas")'],
    3226     CanvasRenderingContext2D: ['document.createElement("canvas").getContext("2d")'],
    3227     CanvasGradient: [],
    3228     CanvasPattern: [],
    3229     TextMetrics: [],
    3230     ImageData: [],
    3231     HTMLMapElement: ['document.createElement("map")'],
    3232     HTMLAreaElement: ['document.createElement("area")'],
    3233     HTMLTableElement: ['document.createElement("table")'],
    3234     HTMLTableCaptionElement: ['document.createElement("caption")'],
    3235     HTMLTableColElement: [
    3236       'document.createElement("colgroup")',
    3237       'document.createElement("col")',
    3238     ],
    3239     HTMLTableSectionElement: [
    3240       'document.createElement("tbody")',
    3241       'document.createElement("thead")',
    3242       'document.createElement("tfoot")',
    3243     ],
    3244     HTMLTableRowElement: ['document.createElement("tr")'],
    3245     HTMLTableCellElement: [
    3246       'document.createElement("td")',
    3247       'document.createElement("th")',
    3248     ],
    3249     HTMLFormElement: ['document.createElement("form")'],
    3250     HTMLFieldsetElement: ['document.createElement("fieldset")'],
    3251     HTMLLegendElement: ['document.createElement("legend")'],
    3252     HTMLLabelElement: ['document.createElement("label")'],
    3253     HTMLInputElement: [
    3254       'document.createElement("input")',
    3255       'createInput("text")',
    3256       'createInput("hidden")',
    3257       'createInput("search")',
    3258       'createInput("tel")',
    3259       'createInput("url")',
    3260       'createInput("email")',
    3261       'createInput("password")',
    3262       'createInput("date")',
    3263       'createInput("month")',
    3264       'createInput("week")',
    3265       'createInput("time")',
    3266       'createInput("datetime-local")',
    3267       'createInput("number")',
    3268       'createInput("range")',
    3269       'createInput("color")',
    3270       'createInput("checkbox")',
    3271       'createInput("radio")',
    3272       'createInput("file")',
    3273       'createInput("submit")',
    3274       'createInput("image")',
    3275       'createInput("reset")',
    3276       'createInput("button")'
    3277     ],
    3278     HTMLButtonElement: ['document.createElement("button")'],
    3279     HTMLSelectElement: ['document.createElement("select")'],
    3280     HTMLDataListElement: ['document.createElement("datalist")'],
    3281     HTMLOptGroupElement: ['document.createElement("optgroup")'],
    3282     HTMLOptionElement: ['document.createElement("option")', 'new Option()'],
    3283     HTMLTextAreaElement: ['document.createElement("textarea")'],
    3284     HTMLOutputElement: ['document.createElement("output")'],
    3285     HTMLProgressElement: ['document.createElement("progress")'],
    3286     HTMLMeterElement: ['document.createElement("meter")'],
    3287     ValidityState: ['document.createElement("input").validity'],
    3288     HTMLDetailsElement: ['document.createElement("details")'],
    3289     HTMLMenuElement: ['document.createElement("menu")'],
    3290     Window: ['window'],
    3291     BarProp: [],
    3292     History: ['window.history'],
    3293     Location: ['window.location'],
    3294     PopStateEvent: ['new PopStateEvent("popstate", { data: {} })'],
    3295     HashChangeEvent: [],
    3296     PageTransitionEvent: [],
    3297     BeforeUnloadEvent: [],
    3298     ApplicationCache: ['window.applicationCache'],
    3299     WindowModal: [],
    3300     Navigator: ['window.navigator'],
    3301     External: ['window.external'],
    3302     DataTransfer: [],
    3303     DataTransferItemList: [],
    3304     DataTransferItem: [],
    3305     DragEvent: [],
    3306     NavigatorUserMediaError: [],
    3307     MediaStream: [],
    3308     LocalMediaStream: [],
    3309     MediaStreamTrack: [],
    3310     MediaStreamRecorder: [],
    3311     PeerConnection: [],
    3312     MediaStreamEvent: [],
    3313     ErrorEvent: [],
    3314     WebSocket: ['new WebSocket("ws://foo")'],
    3315     CloseEvent: ['new CloseEvent("close")'],
    3316     AbstractWorker: [],
    3317     Worker: [],
    3318     SharedWorker: [],
    3319     MessageEvent: [],
    3320     MessageChannel: [],
    3321     MessagePort: [],
    3322     HTMLAppletElement: ['document.createElement("applet")'],
    3323     HTMLMarqueeElement: ['document.createElement("marquee")'],
    3324     HTMLFrameSetElement: ['document.createElement("frameset")'],
    3325     HTMLFrameElement: ['document.createElement("frame")'],
    3326     HTMLDirectoryElement: ['document.createElement("dir")'],
    3327     HTMLFontElement: ['document.createElement("font")'],
    3328   });
    3329   idlArray.prevent_multiple_testing("HTMLElement");
    3330   idlArray.test();
    3331   done();
    3332 };
    3333 </script>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https-expected.txt

    r211930 r213517  
    55FAIL ports attribute should be a FrozenArray assert_true: ev.ports should return the same object expected true got false
    66PASS initMessageEvent operation
    7 FAIL Passing null for ports parameter to initMessageEvent assert_throws: function "function () {
    8     ev.initMessageEvent("test", true, false, "testData", "testOrigin", "testId", window, null)
    9   }" did not throw
    10 FAIL All parameters to initMessageEvent should be mandatory assert_equals: MessageEvent.prototype.initMessageEvent.length should be 8 expected 8 but got 0
     7PASS Passing null for ports parameter to initMessageEvent
     8PASS initMessageEvent operation default parameter values
    119FAIL Passing ServiceWorker for source member undefined is not an object (evaluating 'navigator.serviceWorker.getRegistration')
    1210
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/messageevent-constructor.https.html

    r209861 r213517  
    7171test(function() {
    7272  var ev = document.createEvent("messageevent")
    73   assert_equals(MessageEvent.prototype.initMessageEvent.length, 8, "MessageEvent.prototype.initMessageEvent.length should be 8")
    74   assert_throws(new TypeError(), function() {
    75     ev.initMessageEvent("test", true, false, "testData", "testOrigin", "testId", window)
    76   }, "Calling initMessageEvent with only 7 parameters should throw a TypeError")
    77 }, "All parameters to initMessageEvent should be mandatory")
     73  assert_equals(MessageEvent.prototype.initMessageEvent.length, 1, "MessageEvent.prototype.initMessageEvent.length should be 1")
     74  ev.initMessageEvent("test")
     75  assert_equals(ev.type, "test", "type attribute")
     76  assert_equals(ev.bubbles, false, "bubbles attribute")
     77  assert_equals(ev.cancelable, false, "bubbles attribute")
     78  assert_equals(ev.data, null, "data attribute")
     79  assert_equals(ev.origin, "", "origin attribute")
     80  assert_equals(ev.lastEventId, "", "lastEventId attribute")
     81  assert_equals(ev.source, null, "source attribute")
     82  assert_array_equals(ev.ports, [], "ports attribute")
     83}, "initMessageEvent operation default parameter values")
    7884
    7985promise_test(function(t) {
  • trunk/Source/WebCore/ChangeLog

    r213515 r213517  
     12017-03-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
     4        https://bugs.webkit.org/show_bug.cgi?id=169176
     5
     6        Reviewed by Alex Christensen.
     7
     8        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
     9        after:
     10        - https://github.com/whatwg/dom/pull/417
     11        - https://github.com/whatwg/html/pull/2410
     12
     13        In particular, the following changes were made:
     14        - initEvent: The length property now properly returns 1 instead of 3 as only the
     15          first parameter is mandatory. We were already behaving correcting the the length
     16          property value was wrong because we forgot to drop a hack from the bindings
     17          generator.
     18        - initCustomEvent: Make all parameters except the first optional. Previously, all
     19          parameters were mandatory so this is safe.
     20        - initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
     21          A side effect of dropping the custom code is that null is no longer considered as
     22          valid input for the last parameter. The parameter is of type sequence<> and the
     23          new behavior is consistent with the specification and Firefox. If it turns out to
     24          break existing content, I'll make the parameter nullable in a follow-up.
     25
     26        No new tests, updated existing tests.
     27
     28        * bindings/js/JSMessageEventCustom.cpp:
     29        * bindings/scripts/CodeGeneratorJS.pm:
     30        (GeneratePropertiesHashTable):
     31        * dom/CustomEvent.idl:
     32        * dom/MessageEvent.idl:
     33
    1342017-03-07  Antti Koivisto  <antti@apple.com>
    235
  • trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp

    r212035 r213517  
    141141}
    142142
    143 JSC::JSValue JSMessageEvent::initMessageEvent(JSC::ExecState& state)
    144 {
    145     return handleInitMessageEvent(this, state);
    146 }
    147 
    148143JSC::JSValue JSMessageEvent::webkitInitMessageEvent(JSC::ExecState& state)
    149144{
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r213108 r213517  
    23492349
    23502350        my $functionLength = GetFunctionLength($function);
    2351 
    2352         # FIXME: Remove this once we can get rid of the quirk introduced in https://bugs.webkit.org/show_bug.cgi?id=163967.
    2353         $functionLength = 3 if $interfaceName eq "Event" and $function->name eq "initEvent";
    23542351
    23552352        if ($function->extendedAttributes->{DOMJIT}) {
  • trunk/Source/WebCore/dom/CustomEvent.idl

    r206964 r213517  
    3232    [CustomGetter] readonly attribute any detail;
    3333
    34     [CallWith=ScriptState] void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
     34    [CallWith=ScriptState] void initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null);
    3535};
    3636
  • trunk/Source/WebCore/dom/MessageEvent.idl

    r207505 r213517  
    3838    readonly attribute FrozenArray<MessagePort> ports;
    3939
    40     [Custom] void initMessageEvent(optional DOMString typeArg, optional boolean canBubbleArg, optional boolean cancelableArg,
    41         optional any dataArg, optional USVString originArg, optional DOMString lastEventIdArg, optional (DOMWindow or MessagePort)? sourceArg,
    42         optional sequence<MessagePort> messagePorts);
     40    [CallWith=ScriptState] void initMessageEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false,
     41        optional any data = null, optional USVString originArg = "", optional DOMString lastEventId = "", optional (DOMWindow or MessagePort)? source = null,
     42        optional sequence<MessagePort> messagePorts = []);
    4343    [Custom] void webkitInitMessageEvent(optional DOMString typeArg, optional boolean canBubbleArg, optional boolean cancelableArg,
    4444        optional any dataArg, optional USVString originArg, optional DOMString lastEventIdArg, optional (DOMWindow or MessagePort)? sourceArg,
Note: See TracChangeset for help on using the changeset viewer.