Skip to content

Commit 57512fa

Browse files
autokagamiannevk
authored andcommitted
Align with IDL constructor changes
Fixes #780. Closes #782.
1 parent 4cf85ef commit 57512fa

File tree

1 file changed

+38
-26
lines changed

1 file changed

+38
-26
lines changed

dom.bs

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,10 @@ would have been {{Event/AT_TARGET}}.
422422
<h3 id=interface-event>Interface {{Event}}</h3>
423423

424424
<pre class="idl">
425-
[Constructor(DOMString type, optional EventInit eventInitDict = {}),
426-
Exposed=(Window,Worker,AudioWorklet)]
425+
[Exposed=(Window,Worker,AudioWorklet)]
427426
interface Event {
427+
constructor(DOMString type, optional EventInit eventInitDict = {});
428+
428429
readonly attribute DOMString type;
429430
readonly attribute EventTarget? target;
430431
readonly attribute EventTarget? srcElement; // historical
@@ -840,9 +841,10 @@ workers or worklets, and is inaccurate for events dispatched in <a>shadow trees<
840841
<h3 id=interface-customevent>Interface {{CustomEvent}}</h3>
841842

842843
<pre class=idl>
843-
[Constructor(DOMString type, optional CustomEventInit eventInitDict = {}),
844-
Exposed=(Window,Worker)]
844+
[Exposed=(Window,Worker)]
845845
interface CustomEvent : Event {
846+
constructor(DOMString type, optional CustomEventInit eventInitDict = {});
847+
846848
readonly attribute any detail;
847849

848850
void initCustomEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any detail = null);
@@ -993,9 +995,10 @@ for historical reasons.
993995
<h3 id=interface-eventtarget>Interface {{EventTarget}}</h3>
994996

995997
<pre class=idl>
996-
[Constructor,
997-
Exposed=(Window,Worker,AudioWorklet)]
998+
[Exposed=(Window,Worker,AudioWorklet)]
998999
interface EventTarget {
1000+
constructor();
1001+
9991002
void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = {});
10001003
void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options = {});
10011004
boolean dispatchEvent(Event event);
@@ -1746,13 +1749,15 @@ function doAmazingness({signal}) {
17461749
<h3 id=interface-abortcontroller>Interface {{AbortController}}</h3>
17471750

17481751
<pre class="idl">
1749-
[Constructor,
1750-
Exposed=(Window,Worker)]
1752+
[Exposed=(Window,Worker)]
17511753
interface AbortController {
1754+
constructor();
1755+
17521756
[SameObject] readonly attribute AbortSignal signal;
17531757

17541758
void abort();
1755-
};</pre>
1759+
};
1760+
</pre>
17561761

17571762
<dl class=domintro>
17581763
<dt><code><var>controller</var> = new <a constructor lt=AbortController()>AbortController</a>()</code>
@@ -3353,9 +3358,10 @@ they do not get lost when {{MutationObserverInit/subtree}} is set to true on <a
33533358
<h4 id=interface-mutationobserver>Interface {{MutationObserver}}</h4>
33543359

33553360
<pre class="idl">
3356-
[Constructor(MutationCallback callback),
3357-
Exposed=Window]
3361+
[Exposed=Window]
33583362
interface MutationObserver {
3363+
constructor(MutationCallback callback);
3364+
33593365
void observe(Node target, optional MutationObserverInit options = {});
33603366
void disconnect();
33613367
sequence&lt;MutationRecord> takeRecords();
@@ -4802,9 +4808,10 @@ object may be returned as returned by an earlier call.
48024808
<h3 id=interface-document>Interface {{Document}}</h3>
48034809

48044810
<pre class=idl force="Document">
4805-
[Constructor,
4806-
Exposed=Window]
4811+
[Exposed=Window]
48074812
interface Document : Node {
4813+
constructor();
4814+
48084815
[SameObject] readonly attribute DOMImplementation implementation;
48094816
readonly attribute USVString URL;
48104817
readonly attribute USVString documentURI;
@@ -5714,9 +5721,9 @@ the <a>context object</a>'s <a>system ID</a>.
57145721
<h3 id=interface-documentfragment>Interface {{DocumentFragment}}</h3>
57155722

57165723
<pre class=idl>
5717-
[Constructor,
5718-
Exposed=Window]
5724+
[Exposed=Window]
57195725
interface DocumentFragment : Node {
5726+
constructor();
57205727
};
57215728
</pre>
57225729

@@ -7336,12 +7343,14 @@ method, when invoked, must <a>replace data</a> with node <a>context object</a>,
73367343
<h3 id=interface-text>Interface {{Text}}</h3>
73377344

73387345
<pre class=idl>
7339-
[Constructor(optional DOMString data = ""),
7340-
Exposed=Window]
7346+
[Exposed=Window]
73417347
interface Text : CharacterData {
7348+
constructor(optional DOMString data = "");
7349+
73427350
[NewObject] Text splitText(unsigned long offset);
73437351
readonly attribute DOMString wholeText;
7344-
};</pre>
7352+
};
7353+
</pre>
73457354

73467355
<dl class=domintro>
73477356
<dt><code><var>text</var> = new <a constructor lt=Text()>Text([<var>data</var> = ""])</a></code>
@@ -7494,9 +7503,9 @@ attribute must return the <a for=ProcessingInstruction>target</a>.
74947503
<h3 id=interface-comment>Interface {{Comment}}</h3>
74957504

74967505
<pre class=idl>
7497-
[Constructor(optional DOMString data = ""),
7498-
Exposed=Window]
7506+
[Exposed=Window]
74997507
interface Comment : CharacterData {
7508+
constructor(optional DOMString data = "");
75007509
};
75017510
</pre>
75027511

@@ -7707,9 +7716,9 @@ dictionary StaticRangeInit {
77077716
required unsigned long endOffset;
77087717
};
77097718

7710-
[Constructor(StaticRangeInit init),
7711-
Exposed=Window]
7719+
[Exposed=Window]
77127720
interface StaticRange : AbstractRange {
7721+
constructor(StaticRangeInit init);
77137722
};
77147723
</pre>
77157724

@@ -7740,9 +7749,10 @@ when invoked, must run these steps:
77407749
<h3 id=interface-range>Interface {{Range}}</h3>
77417750

77427751
<pre class=idl>
7743-
[Constructor,
7744-
Exposed=Window]
7752+
[Exposed=Window]
77457753
interface Range : AbstractRange {
7754+
constructor();
7755+
77467756
readonly attribute Node commonAncestorContainer;
77477757

77487758
void setStart(Node node, unsigned long offset);
@@ -9944,8 +9954,10 @@ Document includes XPathEvaluatorBase;
99449954
<h3 id=interface-xpathevaluator>Interface {{XPathEvaluator}}</h3>
99459955

99469956
<pre class=idl>
9947-
[Exposed=Window, Constructor]
9948-
interface XPathEvaluator {};
9957+
[Exposed=Window]
9958+
interface XPathEvaluator {
9959+
constructor();
9960+
};
99499961

99509962
XPathEvaluator includes XPathEvaluatorBase;
99519963
</pre>

0 commit comments

Comments
 (0)