Skip to content

Commit 9be01db

Browse files
saschanazsandersn
andauthored
General IDL updates (#865)
* General IDL updates * restore Option Co-authored-by: Nathan Shively-Sanders <[email protected]>
1 parent 908a260 commit 9be01db

11 files changed

+43
-35
lines changed

baselines/dom.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3926,7 +3926,7 @@ interface DOMParser {
39263926
/**
39273927
* Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be "text/html" (which will invoke the HTML parser), or any of "text/xml", "application/xml", "application/xhtml+xml", or "image/svg+xml" (which will invoke the XML parser).
39283928
*
3929-
* For the XML parser, if string can be parsed, then the returned Document will contain elements describing the resulting error.
3929+
* For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error.
39303930
*
39313931
* Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8.
39323932
*

inputfiles/idl/Clipboard.widl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ dictionary ClipboardEventInit : EventInit {
22
DataTransfer? clipboardData = null;
33
};
44

5-
[Constructor(DOMString type, optional ClipboardEventInit eventInitDict), Exposed=Window]
5+
[Exposed=Window]
66
interface ClipboardEvent : Event {
7+
constructor(DOMString type, optional ClipboardEventInit eventInitDict = {});
78
readonly attribute DataTransfer? clipboardData;
89
};
910

@@ -25,12 +26,12 @@ typedef Promise<ClipboardItemDataType> ClipboardItemData;
2526

2627
callback ClipboardItemDelayedCallback = ClipboardItemData ();
2728

28-
[Constructor(record<DOMString, ClipboardItemData> items,
29-
optional ClipboardItemOptions options),
30-
Exposed=Window] interface ClipboardItem {
29+
[Exposed=Window] interface ClipboardItem {
30+
constructor(record<DOMString, ClipboardItemData> items,
31+
optional ClipboardItemOptions options = {});
3132
static ClipboardItem createDelayed(
3233
record<DOMString, ClipboardItemDelayedCallback> items,
33-
optional ClipboardItemOptions options);
34+
optional ClipboardItemOptions options = {});
3435

3536
readonly attribute PresentationStyle presentationStyle;
3637
readonly attribute long long lastModified;

inputfiles/idl/Fullscreen.widl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ partial interface Element {
1616
};
1717

1818
partial interface Document {
19-
[LenientSetter] readonly attribute boolean fullscreenEnabled;
20-
[LenientSetter, Unscopable] readonly attribute boolean fullscreen; // historical
19+
[LegacyLenientSetter] readonly attribute boolean fullscreenEnabled;
20+
[LegacyLenientSetter, Unscopable] readonly attribute boolean fullscreen; // historical
2121

2222
Promise<void> exitFullscreen();
2323

@@ -26,5 +26,5 @@ partial interface Document {
2626
};
2727

2828
partial interface mixin DocumentOrShadowRoot {
29-
[LenientSetter] readonly attribute Element? fullscreenElement;
29+
[LegacyLenientSetter] readonly attribute Element? fullscreenElement;
3030
};

inputfiles/idl/Gamepad Extensions.widl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ enum GamepadHand {
44
"right"
55
};
66

7+
[Exposed=Window]
78
interface GamepadHapticActuator {
89
readonly attribute GamepadHapticActuatorType type;
910
Promise<boolean> pulse(double value, double duration);
@@ -13,6 +14,7 @@ enum GamepadHapticActuatorType {
1314
"vibration"
1415
};
1516

17+
[Exposed=Window]
1618
interface GamepadPose {
1719
readonly attribute boolean hasOrientation;
1820
readonly attribute boolean hasPosition;

inputfiles/idl/HTML - Browsing the Web.widl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
[Exposed=Window,
2-
Constructor(DOMString type, optional PopStateEventInit eventInitDict = {})]
1+
[Exposed=Window]
32
interface PopStateEvent : Event {
3+
constructor(DOMString type, optional PopStateEventInit eventInitDict = {});
4+
45
readonly attribute any state;
56
};
67

78
dictionary PopStateEventInit : EventInit {
89
any state = null;
910
};
1011

11-
[Exposed=Window,
12-
Constructor(DOMString type, optional HashChangeEventInit eventInitDict = {})]
12+
[Exposed=Window]
1313
interface HashChangeEvent : Event {
14+
constructor(DOMString type, optional HashChangeEventInit eventInitDict = {});
15+
1416
readonly attribute USVString oldURL;
1517
readonly attribute USVString newURL;
1618
};
@@ -20,9 +22,10 @@ dictionary HashChangeEventInit : EventInit {
2022
USVString newURL = "";
2123
};
2224

23-
[Exposed=Window,
24-
Constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {})]
25+
[Exposed=Window]
2526
interface PageTransitionEvent : Event {
27+
constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {});
28+
2629
readonly attribute boolean persisted;
2730
};
2831

inputfiles/idl/HTML - Drag and drop.widl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ interface DataTransferItem {
3636

3737
callback FunctionStringCallback = void (DOMString data);
3838

39-
[Exposed=Window,
40-
Constructor(DOMString type, optional DragEventInit eventInitDict = {})]
39+
[Exposed=Window]
4140
interface DragEvent : MouseEvent {
41+
constructor(DOMString type, optional DragEventInit eventInitDict = {});
42+
4243
readonly attribute DataTransfer? dataTransfer;
4344
};
4445

inputfiles/idl/HTML - Dynamic markup insertion.commentmap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"document-write": "In general, adds the given string(s) to the Document's input stream.\n\nThis method has very idiosyncratic behavior. In some cases, this method can affect the state of the HTML parser while the parser is running, resulting in a DOM that does not correspond to the source of the document (e.g. if the string written is the string \"<plaintext>\" or \"<!--\"). In other cases, the call can clear the current page first, as if document.open() had been called. In yet more cases, the method is simply ignored, or throws an exception. Users agents are explicitly allowed to avoid executing script elements inserted via this method. And to make matters even worse, the exact behavior of this method can in some cases be dependent on network latency, which can lead to failures that are very hard to debug. For all these reasons, use of this method is strongly discouraged.\n\nThrows an \"InvalidStateError\" DOMException when invoked on XML documents.\n\nThrows an \"InvalidStateError\" DOMException if the parser is currently executing a custom element constructor.",
55
"document-writeln": "Adds the given string(s) to the Document's input stream, followed by a newline character. If necessary, calls the open() method implicitly first.\n\nThrows an \"InvalidStateError\" DOMException when invoked on XML documents.\n\nThrows an \"InvalidStateError\" DOMException if the parser is currently executing a custom element constructor.",
66
"domparser-constructor": "Constructs a new DOMParser object.",
7-
"domparser-parsefromstring": "Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be \"text/html\" (which will invoke the HTML parser), or any of \"text/xml\", \"application/xml\", \"application/xhtml+xml\", or \"image/svg+xml\" (which will invoke the XML parser).\n\nFor the XML parser, if string can be parsed, then the returned Document will contain elements describing the resulting error.\n\nNote that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8.\n\nValues other than the above for type will cause a TypeError exception to be thrown."
7+
"domparser-parsefromstring": "Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be \"text/html\" (which will invoke the HTML parser), or any of \"text/xml\", \"application/xml\", \"application/xhtml+xml\", or \"image/svg+xml\" (which will invoke the XML parser).\n\nFor the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error.\n\nNote that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8.\n\nValues other than the above for type will cause a TypeError exception to be thrown."
88
}

inputfiles/idl/HTML - Forms.widl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Exposed=Window,
2-
OverrideBuiltins,
2+
LegacyOverrideBuiltIns,
33
LegacyUnenumerableNamedProperties]
44
interface HTMLFormElement : HTMLElement {
55
[HTMLConstructor] constructor();

inputfiles/idl/HTML - Session history and navigation.widl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ interface History {
1414

1515
[Exposed=Window]
1616
interface Location { // but see also additional creation steps and overridden internal methods
17-
[Unforgeable] stringifier attribute USVString href;
18-
[Unforgeable] readonly attribute USVString origin;
19-
[Unforgeable] attribute USVString protocol;
20-
[Unforgeable] attribute USVString host;
21-
[Unforgeable] attribute USVString hostname;
22-
[Unforgeable] attribute USVString port;
23-
[Unforgeable] attribute USVString pathname;
24-
[Unforgeable] attribute USVString search;
25-
[Unforgeable] attribute USVString hash;
17+
[LegacyUnforgeable] stringifier attribute USVString href;
18+
[LegacyUnforgeable] readonly attribute USVString origin;
19+
[LegacyUnforgeable] attribute USVString protocol;
20+
[LegacyUnforgeable] attribute USVString host;
21+
[LegacyUnforgeable] attribute USVString hostname;
22+
[LegacyUnforgeable] attribute USVString port;
23+
[LegacyUnforgeable] attribute USVString pathname;
24+
[LegacyUnforgeable] attribute USVString search;
25+
[LegacyUnforgeable] attribute USVString hash;
2626

27-
[Unforgeable] void assign(USVString url);
28-
[Unforgeable] void replace(USVString url);
29-
[Unforgeable] void reload();
27+
[LegacyUnforgeable] void assign(USVString url);
28+
[LegacyUnforgeable] void replace(USVString url);
29+
[LegacyUnforgeable] void reload();
3030

31-
[Unforgeable, SameObject] readonly attribute DOMStringList ancestorOrigins;
31+
[LegacyUnforgeable, SameObject] readonly attribute DOMStringList ancestorOrigins;
3232
};

inputfiles/idl/HTML - Web storage.widl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ interface mixin WindowLocalStorage {
1818
};
1919
Window includes WindowLocalStorage;
2020

21-
[Exposed=Window,
22-
Constructor(DOMString type, optional StorageEventInit eventInitDict = {})]
21+
[Exposed=Window]
2322
interface StorageEvent : Event {
23+
constructor(DOMString type, optional StorageEventInit eventInitDict = {});
24+
2425
readonly attribute DOMString? key;
2526
readonly attribute DOMString? oldValue;
2627
readonly attribute DOMString? newValue;

inputfiles/idl/High Resolution Time.widl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ typedef double DOMHighResTimeStamp;
22

33
[Exposed=(Window,Worker)]
44
interface Performance : EventTarget {
5-
DOMHighResTimeStamp now ();
5+
DOMHighResTimeStamp now();
66
readonly attribute DOMHighResTimeStamp timeOrigin;
77
[Default] object toJSON();
88
};

0 commit comments

Comments
 (0)