Skip to content

Commit af75df4

Browse files
saschanazsandersn
andcommitted
Apply insignificant IDL updates (#800)
* Support new constructor() syntax * Apply insignificant IDL updates * Fix bad merge * fix further typo * Minor fixes 1. Fix recurring formatting cut-paste error. 2. Update baseline from bad merge (I think?). Co-authored-by: Nathan Shively-Sanders <[email protected]>
1 parent 9288b15 commit af75df4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+545
-363
lines changed

baselines/dom.generated.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4345,7 +4345,7 @@ interface DataTransferItem {
43454345
*/
43464346
getAsFile(): File | null;
43474347
/**
4348-
* Invokes the callback with the string data as the argument, if the drag data item kind is Plain Unicode string.
4348+
* Invokes the callback with the string data as the argument, if the drag data item kind is text.
43494349
*/
43504350
getAsString(callback: FunctionStringCallback | null): void;
43514351
webkitGetAsEntry(): any;
@@ -5756,7 +5756,7 @@ interface GenericTransformStream {
57565756
*/
57575757
readonly readable: ReadableStream;
57585758
/**
5759-
* Returns a writable stream which accepts BufferSource chunks and runs them through encoding's decoder before making them available to readable.
5759+
* Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable.
57605760
*
57615761
* Typically this will be used via the pipeThrough() method on a ReadableStream source.
57625762
*
@@ -19199,7 +19199,7 @@ interface BlobCallback {
1919919199
}
1920019200

1920119201
interface CustomElementConstructor {
19202-
(): any;
19202+
(): HTMLElement;
1920319203
}
1920419204

1920519205
interface DecodeErrorCallback {

baselines/webworker.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ interface GenericTransformStream {
16291629
*/
16301630
readonly readable: ReadableStream;
16311631
/**
1632-
* Returns a writable stream which accepts BufferSource chunks and runs them through encoding's decoder before making them available to readable.
1632+
* Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable.
16331633
*
16341634
* Typically this will be used via the pipeThrough() method on a ReadableStream source.
16351635
*

inputfiles/idl/CSS Masking.widl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
[Exposed=Window]
12
interface SVGClipPathElement : SVGElement {
23
readonly attribute SVGAnimatedEnumeration clipPathUnits;
34
readonly attribute SVGAnimatedTransformList transform;
45
};
56

7+
[Exposed=Window]
68
interface SVGMaskElement : SVGElement {
79
readonly attribute SVGAnimatedEnumeration maskUnits;
810
readonly attribute SVGAnimatedEnumeration maskContentUnits;

inputfiles/idl/CSS Multi-column Layout.widl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ partial interface CSSStyleDeclaration {
22
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columnWidth;
33
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columnCount;
44
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columns;
5-
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columnGap;
65
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columnRuleColor;
76
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columnRuleStyle;
87
[CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString columnRuleWidth;

inputfiles/idl/CSSOM View.widl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ partial interface Window {
2727
[Replaceable] readonly attribute double pageXOffset;
2828
[Replaceable] readonly attribute double scrollY;
2929
[Replaceable] readonly attribute double pageYOffset;
30-
void scroll(optional ScrollToOptions options);
30+
void scroll(optional ScrollToOptions options = {});
3131
void scroll(unrestricted double x, unrestricted double y);
32-
void scrollTo(optional ScrollToOptions options);
32+
void scrollTo(optional ScrollToOptions options = {});
3333
void scrollTo(unrestricted double x, unrestricted double y);
34-
void scrollBy(optional ScrollToOptions options);
34+
void scrollBy(optional ScrollToOptions options = {});
3535
void scrollBy(unrestricted double x, unrestricted double y);
3636

3737
// client
@@ -48,13 +48,13 @@ partial interface Window {
4848
interface MediaQueryList : EventTarget {
4949
readonly attribute CSSOMString media;
5050
readonly attribute boolean matches;
51-
void addListener(EventListener? listener);
52-
void removeListener(EventListener? listener);
51+
void addListener(EventListener? callback);
52+
void removeListener(EventListener? callback);
5353
attribute EventHandler onchange;
5454
};
5555

5656
[Exposed=Window,
57-
Constructor(CSSOMString type, optional MediaQueryListEventInit eventInitDict)]
57+
Constructor(CSSOMString type, optional MediaQueryListEventInit eventInitDict = {})]
5858
interface MediaQueryListEvent : Event {
5959
readonly attribute CSSOMString media;
6060
readonly attribute boolean matches;
@@ -98,12 +98,12 @@ dictionary ScrollIntoViewOptions : ScrollOptions {
9898
partial interface Element {
9999
DOMRectList getClientRects();
100100
[NewObject] DOMRect getBoundingClientRect();
101-
void scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg);
102-
void scroll(optional ScrollToOptions options);
101+
void scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
102+
void scroll(optional ScrollToOptions options = {});
103103
void scroll(unrestricted double x, unrestricted double y);
104-
void scrollTo(optional ScrollToOptions options);
104+
void scrollTo(optional ScrollToOptions options = {});
105105
void scrollTo(unrestricted double x, unrestricted double y);
106-
void scrollBy(optional ScrollToOptions options);
106+
void scrollBy(optional ScrollToOptions options = {});
107107
void scrollBy(unrestricted double x, unrestricted double y);
108108
attribute unrestricted double scrollTop;
109109
attribute unrestricted double scrollLeft;

inputfiles/idl/Clipboard.widl

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,42 @@ partial interface Navigator {
1111
[SecureContext, SameObject] readonly attribute Clipboard clipboard;
1212
};
1313

14+
typedef sequence<ClipboardItem> ClipboardItems;
15+
1416
[SecureContext, Exposed=Window] interface Clipboard : EventTarget {
15-
Promise<DataTransfer> read();
17+
Promise<ClipboardItems> read();
1618
Promise<DOMString> readText();
17-
Promise<void> write(DataTransfer data);
19+
Promise<void> write(ClipboardItems data);
1820
Promise<void> writeText(DOMString data);
1921
};
2022

23+
typedef (DOMString or Blob) ClipboardItemDataType;
24+
typedef Promise<ClipboardItemDataType> ClipboardItemData;
25+
26+
callback ClipboardItemDelayedCallback = ClipboardItemData ();
27+
28+
[Constructor(record<DOMString, ClipboardItemData> items,
29+
optional ClipboardItemOptions options),
30+
Exposed=Window] interface ClipboardItem {
31+
static ClipboardItem createDelayed(
32+
record<DOMString, ClipboardItemDelayedCallback> items,
33+
optional ClipboardItemOptions options);
34+
35+
readonly attribute PresentationStyle presentationStyle;
36+
readonly attribute long long lastModified;
37+
readonly attribute boolean delayed;
38+
39+
readonly attribute FrozenArray<DOMString> types;
40+
41+
Promise<Blob> getType(DOMString type);
42+
};
43+
44+
enum PresentationStyle { "unspecified", "inline", "attachment" };
45+
46+
dictionary ClipboardItemOptions {
47+
PresentationStyle presentationStyle = "unspecified";
48+
};
49+
2150
dictionary ClipboardPermissionDescriptor : PermissionDescriptor {
2251
boolean allowWithoutGesture = false;
2352
};

inputfiles/idl/DOM Parsing and Serialization.widl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
[Constructor, Exposed=Window]
1+
[Exposed=Window]
22
interface DOMParser {
3+
constructor();
34
[NewObject] Document parseFromString(DOMString str, SupportedType type);
45
};
56

@@ -11,20 +12,21 @@ enum SupportedType {
1112
"image/svg+xml"
1213
};
1314

14-
[Constructor, Exposed=Window]
15+
[Exposed=Window]
1516
interface XMLSerializer {
17+
constructor();
1618
DOMString serializeToString(Node root);
1719
};
1820

1921
interface mixin InnerHTML {
20-
[CEReactions, TreatNullAs=EmptyString] attribute DOMString innerHTML;
22+
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerHTML;
2123
};
2224

2325
Element includes InnerHTML;
2426
ShadowRoot includes InnerHTML;
2527

2628
partial interface Element {
27-
[CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML;
29+
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString outerHTML;
2830
[CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
2931
};
3032

inputfiles/idl/DeviceOrientation Event.widl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ partial interface Window {
22
[SecureContext] attribute EventHandler ondeviceorientation;
33
};
44

5-
[Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict), Exposed=Window, SecureContext]
5+
[Exposed=Window, SecureContext]
66
interface DeviceOrientationEvent : Event {
7+
constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict = {});
78
readonly attribute double? alpha;
89
readonly attribute double? beta;
910
readonly attribute double? gamma;
@@ -36,22 +37,23 @@ partial interface Window {
3637
[SecureContext] attribute EventHandler ondevicemotion;
3738
};
3839

39-
[SecureContext]
40+
[Exposed=Window, SecureContext]
4041
interface DeviceMotionEventAcceleration {
4142
readonly attribute double? x;
4243
readonly attribute double? y;
4344
readonly attribute double? z;
4445
};
4546

46-
[SecureContext]
47+
[Exposed=Window, SecureContext]
4748
interface DeviceMotionEventRotationRate {
4849
readonly attribute double? alpha;
4950
readonly attribute double? beta;
5051
readonly attribute double? gamma;
5152
};
5253

53-
[Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict), Exposed=Window, SecureContext]
54+
[Exposed=Window, SecureContext]
5455
interface DeviceMotionEvent : Event {
56+
constructor(DOMString type, optional DeviceMotionEventInit eventInitDict = {});
5557
readonly attribute DeviceMotionEventAcceleration? acceleration;
5658
readonly attribute DeviceMotionEventAcceleration? accelerationIncludingGravity;
5759
readonly attribute DeviceMotionEventRotationRate? rotationRate;

inputfiles/idl/Encoding.commentmap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"textencoder-encodeinto": "Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as a dictionary whereby read is the number of converted code units of source and written is the number of bytes modified in destination.",
1111
"textdecoderstream": "Returns a new TextDecoderStream object.\n\nIf label is either not a label or is a label for replacement, throws a RangeError.",
1212
"generictransformstream-readable": "Returns a readable stream whose chunks are strings resulting from running encoding's decoder on the chunks written to writable.",
13-
"generictransformstream-writable": "Returns a writable stream which accepts BufferSource chunks and runs them through encoding's decoder before making them available to readable.\n\nTypically this will be used via the pipeThrough() method on a ReadableStream source.\n\n```\nvar decoder = new TextDecoderStream(encoding);\nbyteReadable\n .pipeThrough(decoder)\n .pipeTo(textWritable);\n```\n\nIf the error mode is \"fatal\" and encoding's decoder returns error, both readable and writable will be errored with a TypeError.",
13+
"generictransformstream-writable": "Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable.\n\nTypically this will be used via the pipeThrough() method on a ReadableStream source.\n\n```\nvar decoder = new TextDecoderStream(encoding);\nbyteReadable\n .pipeThrough(decoder)\n .pipeTo(textWritable);\n```\n\nIf the error mode is \"fatal\" and encoding's decoder returns error, both readable and writable will be errored with a TypeError.",
1414
"textencoderstream": "Returns a new TextEncoderStream object."
1515
}

inputfiles/idl/Encoding.widl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ dictionary TextDecodeOptions {
1313
boolean stream = false;
1414
};
1515

16-
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
17-
Exposed=(Window,Worker)]
16+
[Exposed=(Window,Worker)]
1817
interface TextDecoder {
19-
USVString decode(optional BufferSource input, optional TextDecodeOptions options);
18+
constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
19+
20+
USVString decode(optional [AllowShared] BufferSource input, optional TextDecodeOptions options = {});
2021
};
2122
TextDecoder includes TextDecoderCommon;
2223

@@ -29,11 +30,12 @@ dictionary TextEncoderEncodeIntoResult {
2930
unsigned long long written;
3031
};
3132

32-
[Constructor,
33-
Exposed=(Window,Worker)]
33+
[Exposed=(Window,Worker)]
3434
interface TextEncoder {
35+
constructor();
36+
3537
[NewObject] Uint8Array encode(optional USVString input = "");
36-
TextEncoderEncodeIntoResult encodeInto(USVString source, Uint8Array destination);
38+
TextEncoderEncodeIntoResult encodeInto(USVString source, [AllowShared] Uint8Array destination);
3739
};
3840
TextEncoder includes TextEncoderCommon;
3941

@@ -42,16 +44,16 @@ interface mixin GenericTransformStream {
4244
readonly attribute WritableStream writable;
4345
};
4446

45-
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
46-
Exposed=(Window,Worker)]
47+
[Exposed=(Window,Worker)]
4748
interface TextDecoderStream {
49+
constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
4850
};
4951
TextDecoderStream includes TextDecoderCommon;
5052
TextDecoderStream includes GenericTransformStream;
5153

52-
[Constructor,
53-
Exposed=(Window,Worker)]
54+
[Exposed=(Window,Worker)]
5455
interface TextEncoderStream {
56+
constructor();
5557
};
5658
TextEncoderStream includes TextEncoderCommon;
5759
TextEncoderStream includes GenericTransformStream;

0 commit comments

Comments
 (0)