Skip to content

Commit

Permalink
Align with IDL constructor changes
Browse files Browse the repository at this point in the history
Fixes whatwg#780. Closes whatwg#782.
  • Loading branch information
autokagami authored and annevk committed Sep 24, 2019
1 parent 4cf85ef commit 57512fa
Showing 1 changed file with 38 additions and 26 deletions.
64 changes: 38 additions & 26 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,10 @@ would have been {{Event/AT_TARGET}}.
<h3 id=interface-event>Interface {{Event}}</h3>

<pre class="idl">
[Constructor(DOMString type, optional EventInit eventInitDict = {}),
Exposed=(Window,Worker,AudioWorklet)]
[Exposed=(Window,Worker,AudioWorklet)]
interface Event {
constructor(DOMString type, optional EventInit eventInitDict = {});

readonly attribute DOMString type;
readonly attribute EventTarget? target;
readonly attribute EventTarget? srcElement; // historical
Expand Down Expand Up @@ -840,9 +841,10 @@ workers or worklets, and is inaccurate for events dispatched in <a>shadow trees<
<h3 id=interface-customevent>Interface {{CustomEvent}}</h3>

<pre class=idl>
[Constructor(DOMString type, optional CustomEventInit eventInitDict = {}),
Exposed=(Window,Worker)]
[Exposed=(Window,Worker)]
interface CustomEvent : Event {
constructor(DOMString type, optional CustomEventInit eventInitDict = {});

readonly attribute any detail;

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

<pre class=idl>
[Constructor,
Exposed=(Window,Worker,AudioWorklet)]
[Exposed=(Window,Worker,AudioWorklet)]
interface EventTarget {
constructor();

void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = {});
void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options = {});
boolean dispatchEvent(Event event);
Expand Down Expand Up @@ -1746,13 +1749,15 @@ function doAmazingness({signal}) {
<h3 id=interface-abortcontroller>Interface {{AbortController}}</h3>

<pre class="idl">
[Constructor,
Exposed=(Window,Worker)]
[Exposed=(Window,Worker)]
interface AbortController {
constructor();

[SameObject] readonly attribute AbortSignal signal;

void abort();
};</pre>
};
</pre>

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

<pre class="idl">
[Constructor(MutationCallback callback),
Exposed=Window]
[Exposed=Window]
interface MutationObserver {
constructor(MutationCallback callback);

void observe(Node target, optional MutationObserverInit options = {});
void disconnect();
sequence&lt;MutationRecord> takeRecords();
Expand Down Expand Up @@ -4802,9 +4808,10 @@ object may be returned as returned by an earlier call.
<h3 id=interface-document>Interface {{Document}}</h3>

<pre class=idl force="Document">
[Constructor,
Exposed=Window]
[Exposed=Window]
interface Document : Node {
constructor();

[SameObject] readonly attribute DOMImplementation implementation;
readonly attribute USVString URL;
readonly attribute USVString documentURI;
Expand Down Expand Up @@ -5714,9 +5721,9 @@ the <a>context object</a>'s <a>system ID</a>.
<h3 id=interface-documentfragment>Interface {{DocumentFragment}}</h3>

<pre class=idl>
[Constructor,
Exposed=Window]
[Exposed=Window]
interface DocumentFragment : Node {
constructor();
};
</pre>

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

<pre class=idl>
[Constructor(optional DOMString data = ""),
Exposed=Window]
[Exposed=Window]
interface Text : CharacterData {
constructor(optional DOMString data = "");

[NewObject] Text splitText(unsigned long offset);
readonly attribute DOMString wholeText;
};</pre>
};
</pre>

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

<pre class=idl>
[Constructor(optional DOMString data = ""),
Exposed=Window]
[Exposed=Window]
interface Comment : CharacterData {
constructor(optional DOMString data = "");
};
</pre>

Expand Down Expand Up @@ -7707,9 +7716,9 @@ dictionary StaticRangeInit {
required unsigned long endOffset;
};

[Constructor(StaticRangeInit init),
Exposed=Window]
[Exposed=Window]
interface StaticRange : AbstractRange {
constructor(StaticRangeInit init);
};
</pre>

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

<pre class=idl>
[Constructor,
Exposed=Window]
[Exposed=Window]
interface Range : AbstractRange {
constructor();

readonly attribute Node commonAncestorContainer;

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

<pre class=idl>
[Exposed=Window, Constructor]
interface XPathEvaluator {};
[Exposed=Window]
interface XPathEvaluator {
constructor();
};

XPathEvaluator includes XPathEvaluatorBase;
</pre>
Expand Down

0 comments on commit 57512fa

Please sign in to comment.