Skip to content

Commit 9088f29

Browse files
panvaaduh95
authored andcommitted
test: update WPT WebIDL interfaces
PR-URL: #53720 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 71f26e9 commit 9088f29

14 files changed

+163
-32
lines changed

test/fixtures/wpt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Last update:
2323
- html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing
2424
- html/webappapis/structured-clone: https://github.com/web-platform-tests/wpt/tree/47d3fb280c/html/webappapis/structured-clone
2525
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
26-
- interfaces: https://github.com/web-platform-tests/wpt/tree/727995f043/interfaces
26+
- interfaces: https://github.com/web-platform-tests/wpt/tree/e90ece61d6/interfaces
2727
- performance-timeline: https://github.com/web-platform-tests/wpt/tree/17ebc3aea0/performance-timeline
2828
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
2929
- resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources

test/fixtures/wpt/interfaces/FileAPI.idl

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ interface Blob {
2020
[NewObject] ReadableStream stream();
2121
[NewObject] Promise<USVString> text();
2222
[NewObject] Promise<ArrayBuffer> arrayBuffer();
23+
[NewObject] Promise<Uint8Array> bytes();
2324
};
2425

2526
enum EndingType { "transparent", "native" };

test/fixtures/wpt/interfaces/WebCryptoAPI.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ interface SubtleCrypto {
6868
sequence<KeyUsage> keyUsages );
6969
Promise<ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm,
7070
CryptoKey baseKey,
71-
unsigned long length);
71+
optional unsigned long? length = null);
7272

7373
Promise<CryptoKey> importKey(KeyFormat format,
7474
(BufferSource or JsonWebKey) keyData,

test/fixtures/wpt/interfaces/compression.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// GENERATED CONTENT - DO NOT EDIT
22
// Content was automatically extracted by Reffy into webref
33
// (https://github.com/w3c/webref)
4-
// Source: Compression Streams (https://wicg.github.io/compression/)
4+
// Source: Compression Standard (https://compression.spec.whatwg.org/)
55

66
enum CompressionFormat {
77
"deflate",

test/fixtures/wpt/interfaces/dom.idl

+10-6
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ interface mixin ParentNode {
120120
readonly attribute Element? lastElementChild;
121121
readonly attribute unsigned long childElementCount;
122122

123-
[CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes);
124-
[CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
125-
[CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);
123+
[CEReactions, Unscopable] undefined prepend((Node or TrustedScript or DOMString)... nodes);
124+
[CEReactions, Unscopable] undefined append((Node or TrustedScript or DOMString)... nodes);
125+
[CEReactions, Unscopable] undefined replaceChildren((Node or TrustedScript or DOMString)... nodes);
126126

127127
Element? querySelector(DOMString selectors);
128128
[NewObject] NodeList querySelectorAll(DOMString selectors);
@@ -139,9 +139,9 @@ Element includes NonDocumentTypeChildNode;
139139
CharacterData includes NonDocumentTypeChildNode;
140140

141141
interface mixin ChildNode {
142-
[CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
143-
[CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
144-
[CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
142+
[CEReactions, Unscopable] undefined before((Node or TrustedScript or DOMString)... nodes);
143+
[CEReactions, Unscopable] undefined after((Node or TrustedScript or DOMString)... nodes);
144+
[CEReactions, Unscopable] undefined replaceWith((Node or TrustedScript or DOMString)... nodes);
145145
[CEReactions, Unscopable] undefined remove();
146146
};
147147
DocumentType includes ChildNode;
@@ -339,6 +339,8 @@ interface ShadowRoot : DocumentFragment {
339339
readonly attribute ShadowRootMode mode;
340340
readonly attribute boolean delegatesFocus;
341341
readonly attribute SlotAssignmentMode slotAssignment;
342+
readonly attribute boolean clonable;
343+
readonly attribute boolean serializable;
342344
readonly attribute Element host;
343345
attribute EventHandler onslotchange;
344346
};
@@ -396,6 +398,8 @@ dictionary ShadowRootInit {
396398
required ShadowRootMode mode;
397399
boolean delegatesFocus = false;
398400
SlotAssignmentMode slotAssignment = "named";
401+
boolean clonable = false;
402+
boolean serializable = false;
399403
};
400404

401405
[Exposed=Window,

test/fixtures/wpt/interfaces/html.idl

+119-11
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
4848

4949
[LegacyOverrideBuiltIns]
5050
partial interface Document {
51+
static Document parseHTMLUnsafe((TrustedHTML or DOMString) html);
52+
5153
// resource metadata management
5254
[PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
5355
attribute USVString domain;
@@ -75,8 +77,8 @@ partial interface Document {
7577
[CEReactions] Document open(optional DOMString unused1, optional DOMString unused2); // both arguments are ignored
7678
WindowProxy? open(USVString url, DOMString name, DOMString features);
7779
[CEReactions] undefined close();
78-
[CEReactions] undefined write(DOMString... text);
79-
[CEReactions] undefined writeln(DOMString... text);
80+
[CEReactions] undefined write((TrustedHTML or DOMString)... text);
81+
[CEReactions] undefined writeln((TrustedHTML or DOMString)... text);
8082

8183
// user interaction
8284
readonly attribute WindowProxy? defaultView;
@@ -121,6 +123,7 @@ interface HTMLElement : Element {
121123
readonly attribute DOMString accessKeyLabel;
122124
[CEReactions] attribute boolean draggable;
123125
[CEReactions] attribute boolean spellcheck;
126+
[CEReactions] attribute DOMString writingSuggestions;
124127
[CEReactions] attribute DOMString autocapitalize;
125128

126129
[CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText;
@@ -449,7 +452,7 @@ interface HTMLIFrameElement : HTMLElement {
449452
[HTMLConstructor] constructor();
450453

451454
[CEReactions] attribute USVString src;
452-
[CEReactions] attribute DOMString srcdoc;
455+
[CEReactions] attribute (TrustedHTML or DOMString) srcdoc;
453456
[CEReactions] attribute DOMString name;
454457
[SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox;
455458
[CEReactions] attribute DOMString allow;
@@ -999,6 +1002,8 @@ interface HTMLSelectElement : HTMLElement {
9991002
boolean reportValidity();
10001003
undefined setCustomValidity(DOMString error);
10011004

1005+
undefined showPicker();
1006+
10021007
readonly attribute NodeList labels;
10031008
};
10041009

@@ -1196,6 +1201,7 @@ dictionary FormDataEventInit : EventInit {
11961201
interface HTMLDetailsElement : HTMLElement {
11971202
[HTMLConstructor] constructor();
11981203

1204+
[CEReactions] attribute DOMString name;
11991205
[CEReactions] attribute boolean open;
12001206
};
12011207

@@ -1236,6 +1242,10 @@ interface HTMLTemplateElement : HTMLElement {
12361242
[HTMLConstructor] constructor();
12371243

12381244
readonly attribute DocumentFragment content;
1245+
[CEReactions] attribute DOMString shadowRootMode;
1246+
[CEReactions] attribute boolean shadowRootDelegatesFocus;
1247+
[CEReactions] attribute boolean shadowRootClonable;
1248+
[CEReactions] attribute boolean shadowRootSerializable;
12391249
};
12401250

12411251
[Exposed=Window]
@@ -1570,7 +1580,6 @@ interface OffscreenCanvas : EventTarget {
15701580

15711581
[Exposed=(Window,Worker)]
15721582
interface OffscreenCanvasRenderingContext2D {
1573-
undefined commit();
15741583
readonly attribute OffscreenCanvas canvas;
15751584
};
15761585

@@ -1626,6 +1635,9 @@ interface ElementInternals {
16261635
boolean reportValidity();
16271636

16281637
readonly attribute NodeList labels;
1638+
1639+
// Custom state pseudo-class
1640+
[SameObject] readonly attribute CustomStateSet states;
16291641
};
16301642

16311643
// Accessibility semantics
@@ -1644,6 +1656,11 @@ dictionary ValidityStateFlags {
16441656
boolean customError = false;
16451657
};
16461658

1659+
[Exposed=Window]
1660+
interface CustomStateSet {
1661+
setlike<DOMString>;
1662+
};
1663+
16471664
[Exposed=(Window)]
16481665
interface VisibilityStateEntry : PerformanceEntry {
16491666
readonly attribute DOMString name; // shadows inherited name
@@ -1686,6 +1703,22 @@ interface mixin ElementContentEditable {
16861703
[CEReactions] attribute DOMString inputMode;
16871704
};
16881705

1706+
[Exposed=Window]
1707+
interface CloseWatcher : EventTarget {
1708+
constructor(optional CloseWatcherOptions options = {});
1709+
1710+
undefined requestClose();
1711+
undefined close();
1712+
undefined destroy();
1713+
1714+
attribute EventHandler oncancel;
1715+
attribute EventHandler onclose;
1716+
};
1717+
1718+
dictionary CloseWatcherOptions {
1719+
AbortSignal signal;
1720+
};
1721+
16891722
[Exposed=Window]
16901723
interface DataTransfer {
16911724
constructor();
@@ -1849,6 +1882,7 @@ interface Navigation : EventTarget {
18491882
readonly attribute NavigationHistoryEntry? currentEntry;
18501883
undefined updateCurrentEntry(NavigationUpdateCurrentEntryOptions options);
18511884
readonly attribute NavigationTransition? transition;
1885+
readonly attribute NavigationActivation? activation;
18521886

18531887
readonly attribute boolean canGoBack;
18541888
readonly attribute boolean canGoForward;
@@ -1921,6 +1955,13 @@ interface NavigationTransition {
19211955
readonly attribute Promise<undefined> finished;
19221956
};
19231957

1958+
[Exposed=Window]
1959+
interface NavigationActivation {
1960+
readonly attribute NavigationHistoryEntry? from;
1961+
readonly attribute NavigationHistoryEntry entry;
1962+
readonly attribute NavigationType navigationType;
1963+
};
1964+
19241965
[Exposed=Window]
19251966
interface NavigateEvent : Event {
19261967
constructor(DOMString type, NavigateEventInit eventInitDict);
@@ -2021,6 +2062,28 @@ dictionary HashChangeEventInit : EventInit {
20212062
USVString newURL = "";
20222063
};
20232064

2065+
[Exposed=Window]
2066+
interface PageSwapEvent : Event {
2067+
constructor(DOMString type, optional PageSwapEventInit eventInitDict = {});
2068+
readonly attribute NavigationActivation? activation;
2069+
readonly attribute ViewTransition? viewTransition;
2070+
};
2071+
2072+
dictionary PageSwapEventInit : EventInit {
2073+
NavigationActivation? activation = null;
2074+
ViewTransition? viewTransition = null;
2075+
};
2076+
2077+
[Exposed=Window]
2078+
interface PageRevealEvent : Event {
2079+
constructor(DOMString type, optional PageRevealEventInit eventInitDict = {});
2080+
readonly attribute ViewTransition? viewTransition;
2081+
};
2082+
2083+
dictionary PageRevealEventInit : EventInit {
2084+
ViewTransition? viewTransition = null;
2085+
};
2086+
20242087
[Exposed=Window]
20252088
interface PageTransitionEvent : Event {
20262089
constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {});
@@ -2037,6 +2100,23 @@ interface BeforeUnloadEvent : Event {
20372100
attribute DOMString returnValue;
20382101
};
20392102

2103+
[Exposed=Window]
2104+
interface NotRestoredReasonDetails {
2105+
readonly attribute DOMString reason;
2106+
[Default] object toJSON();
2107+
};
2108+
2109+
[Exposed=Window]
2110+
interface NotRestoredReasons {
2111+
readonly attribute DOMString? src;
2112+
readonly attribute DOMString? id;
2113+
readonly attribute DOMString? name;
2114+
readonly attribute DOMString? url;
2115+
readonly attribute FrozenArray<NotRestoredReasonDetails>? reasons;
2116+
readonly attribute FrozenArray<NotRestoredReasons>? children;
2117+
[Default] object toJSON();
2118+
};
2119+
20402120
[Exposed=*]
20412121
interface ErrorEvent : Event {
20422122
constructor(DOMString type, optional ErrorEventInit eventInitDict = {});
@@ -2060,12 +2140,12 @@ dictionary ErrorEventInit : EventInit {
20602140
interface PromiseRejectionEvent : Event {
20612141
constructor(DOMString type, PromiseRejectionEventInit eventInitDict);
20622142

2063-
readonly attribute Promise<any> promise;
2143+
readonly attribute object promise;
20642144
readonly attribute any reason;
20652145
};
20662146

20672147
dictionary PromiseRejectionEventInit : EventInit {
2068-
required Promise<any> promise;
2148+
required object promise;
20692149
any reason;
20702150
};
20712151

@@ -2170,15 +2250,17 @@ interface mixin WindowEventHandlers {
21702250
attribute EventHandler onoffline;
21712251
attribute EventHandler ononline;
21722252
attribute EventHandler onpagehide;
2253+
attribute EventHandler onpagereveal;
21732254
attribute EventHandler onpageshow;
2255+
attribute EventHandler onpageswap;
21742256
attribute EventHandler onpopstate;
21752257
attribute EventHandler onrejectionhandled;
21762258
attribute EventHandler onstorage;
21772259
attribute EventHandler onunhandledrejection;
21782260
attribute EventHandler onunload;
21792261
};
21802262

2181-
typedef (DOMString or Function) TimerHandler;
2263+
typedef (DOMString or Function or TrustedScript) TimerHandler;
21822264

21832265
interface mixin WindowOrWorkerGlobalScope {
21842266
[Replaceable] readonly attribute USVString origin;
@@ -2210,11 +2292,32 @@ interface mixin WindowOrWorkerGlobalScope {
22102292
Window includes WindowOrWorkerGlobalScope;
22112293
WorkerGlobalScope includes WindowOrWorkerGlobalScope;
22122294

2295+
partial interface Element {
2296+
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
2297+
DOMString getHTML(optional GetHTMLOptions options = {});
2298+
2299+
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
2300+
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) outerHTML;
2301+
[CEReactions] undefined insertAdjacentHTML(DOMString position, (TrustedHTML or DOMString) string);
2302+
};
2303+
2304+
partial interface ShadowRoot {
2305+
[CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
2306+
DOMString getHTML(optional GetHTMLOptions options = {});
2307+
2308+
[CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
2309+
};
2310+
2311+
dictionary GetHTMLOptions {
2312+
boolean serializableShadowRoots = false;
2313+
sequence<ShadowRoot> shadowRoots = [];
2314+
};
2315+
22132316
[Exposed=Window]
22142317
interface DOMParser {
22152318
constructor();
22162319

2217-
[NewObject] Document parseFromString(DOMString string, DOMParserSupportedType type);
2320+
[NewObject] Document parseFromString((TrustedHTML or DOMString) string, DOMParserSupportedType type);
22182321
};
22192322

22202323
enum DOMParserSupportedType {
@@ -2225,6 +2328,10 @@ enum DOMParserSupportedType {
22252328
"image/svg+xml"
22262329
};
22272330

2331+
partial interface Range {
2332+
[CEReactions, NewObject] DocumentFragment createContextualFragment((TrustedHTML or DOMString) string);
2333+
};
2334+
22282335
[Exposed=Window]
22292336
interface Navigator {
22302337
// objects implementing this interface also implement the interfaces given below
@@ -2414,6 +2521,7 @@ interface MessagePort : EventTarget {
24142521
// event handlers
24152522
attribute EventHandler onmessage;
24162523
attribute EventHandler onmessageerror;
2524+
attribute EventHandler onclose;
24172525
};
24182526

24192527
dictionary StructuredSerializeOptions {
@@ -2436,7 +2544,7 @@ interface WorkerGlobalScope : EventTarget {
24362544
readonly attribute WorkerGlobalScope self;
24372545
readonly attribute WorkerLocation location;
24382546
readonly attribute WorkerNavigator navigator;
2439-
undefined importScripts(USVString... urls);
2547+
undefined importScripts((TrustedScriptURL or USVString)... urls);
24402548

24412549
attribute OnErrorEventHandler onerror;
24422550
attribute EventHandler onlanguagechange;
@@ -2474,7 +2582,7 @@ interface mixin AbstractWorker {
24742582

24752583
[Exposed=(Window,DedicatedWorker,SharedWorker)]
24762584
interface Worker : EventTarget {
2477-
constructor(USVString scriptURL, optional WorkerOptions options = {});
2585+
constructor((TrustedScriptURL or USVString) scriptURL, optional WorkerOptions options = {});
24782586

24792587
undefined terminate();
24802588

@@ -2496,7 +2604,7 @@ Worker includes AbstractWorker;
24962604

24972605
[Exposed=Window]
24982606
interface SharedWorker : EventTarget {
2499-
constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {});
2607+
constructor((TrustedScriptURL or USVString) scriptURL, optional (DOMString or WorkerOptions) options = {});
25002608

25012609
readonly attribute MessagePort port;
25022610
};

test/fixtures/wpt/interfaces/performance-timeline.idl

+2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ typedef sequence<PerformanceEntry> PerformanceEntryList;
1212

1313
[Exposed=(Window,Worker)]
1414
interface PerformanceEntry {
15+
readonly attribute unsigned long long id;
1516
readonly attribute DOMString name;
1617
readonly attribute DOMString entryType;
1718
readonly attribute DOMHighResTimeStamp startTime;
1819
readonly attribute DOMHighResTimeStamp duration;
20+
readonly attribute unsigned long long navigationId;
1921
[Default] object toJSON();
2022
};
2123

0 commit comments

Comments
 (0)