diff --git a/lib/internal/url.js b/lib/internal/url.js index 0615e38c8a761f..ed5644fe59515b 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1167,6 +1167,12 @@ ObjectDefineProperties(URL, { writable: true, enumerable: true, }, + parse: { + __proto__: null, + configurable: true, + writable: true, + enumerable: true, + }, }); function installObjectURLMethods() { diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index f3109ccee55855..5d68176d40b650 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -23,7 +23,7 @@ Last update: - html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing - html/webappapis/structured-clone: https://github.com/web-platform-tests/wpt/tree/47d3fb280c/html/webappapis/structured-clone - html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers -- interfaces: https://github.com/web-platform-tests/wpt/tree/727995f043/interfaces +- interfaces: https://github.com/web-platform-tests/wpt/tree/e90ece61d6/interfaces - performance-timeline: https://github.com/web-platform-tests/wpt/tree/17ebc3aea0/performance-timeline - resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing - resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources diff --git a/test/fixtures/wpt/interfaces/FileAPI.idl b/test/fixtures/wpt/interfaces/FileAPI.idl index aee0e65dcae267..49219fce277f23 100644 --- a/test/fixtures/wpt/interfaces/FileAPI.idl +++ b/test/fixtures/wpt/interfaces/FileAPI.idl @@ -20,6 +20,7 @@ interface Blob { [NewObject] ReadableStream stream(); [NewObject] Promise text(); [NewObject] Promise arrayBuffer(); + [NewObject] Promise bytes(); }; enum EndingType { "transparent", "native" }; diff --git a/test/fixtures/wpt/interfaces/WebCryptoAPI.idl b/test/fixtures/wpt/interfaces/WebCryptoAPI.idl index 0e68ea82f59443..ae85c1cfe4684f 100644 --- a/test/fixtures/wpt/interfaces/WebCryptoAPI.idl +++ b/test/fixtures/wpt/interfaces/WebCryptoAPI.idl @@ -68,7 +68,7 @@ interface SubtleCrypto { sequence keyUsages ); Promise deriveBits(AlgorithmIdentifier algorithm, CryptoKey baseKey, - unsigned long length); + optional unsigned long? length = null); Promise importKey(KeyFormat format, (BufferSource or JsonWebKey) keyData, diff --git a/test/fixtures/wpt/interfaces/compression.idl b/test/fixtures/wpt/interfaces/compression.idl index 7525d7c9847b74..defe4ba55cdfd4 100644 --- a/test/fixtures/wpt/interfaces/compression.idl +++ b/test/fixtures/wpt/interfaces/compression.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: Compression Streams (https://wicg.github.io/compression/) +// Source: Compression Standard (https://compression.spec.whatwg.org/) enum CompressionFormat { "deflate", diff --git a/test/fixtures/wpt/interfaces/dom.idl b/test/fixtures/wpt/interfaces/dom.idl index c2def872fa23eb..72d61f5cfd80ad 100644 --- a/test/fixtures/wpt/interfaces/dom.idl +++ b/test/fixtures/wpt/interfaces/dom.idl @@ -120,9 +120,9 @@ interface mixin ParentNode { readonly attribute Element? lastElementChild; readonly attribute unsigned long childElementCount; - [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes); - [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); - [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); + [CEReactions, Unscopable] undefined prepend((Node or TrustedScript or DOMString)... nodes); + [CEReactions, Unscopable] undefined append((Node or TrustedScript or DOMString)... nodes); + [CEReactions, Unscopable] undefined replaceChildren((Node or TrustedScript or DOMString)... nodes); Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); @@ -139,9 +139,9 @@ Element includes NonDocumentTypeChildNode; CharacterData includes NonDocumentTypeChildNode; interface mixin ChildNode { - [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes); - [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes); - [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes); + [CEReactions, Unscopable] undefined before((Node or TrustedScript or DOMString)... nodes); + [CEReactions, Unscopable] undefined after((Node or TrustedScript or DOMString)... nodes); + [CEReactions, Unscopable] undefined replaceWith((Node or TrustedScript or DOMString)... nodes); [CEReactions, Unscopable] undefined remove(); }; DocumentType includes ChildNode; @@ -339,6 +339,8 @@ interface ShadowRoot : DocumentFragment { readonly attribute ShadowRootMode mode; readonly attribute boolean delegatesFocus; readonly attribute SlotAssignmentMode slotAssignment; + readonly attribute boolean clonable; + readonly attribute boolean serializable; readonly attribute Element host; attribute EventHandler onslotchange; }; @@ -396,6 +398,8 @@ dictionary ShadowRootInit { required ShadowRootMode mode; boolean delegatesFocus = false; SlotAssignmentMode slotAssignment = "named"; + boolean clonable = false; + boolean serializable = false; }; [Exposed=Window, diff --git a/test/fixtures/wpt/interfaces/html.idl b/test/fixtures/wpt/interfaces/html.idl index c7f744ccbe601b..4d6c0229bc1392 100644 --- a/test/fixtures/wpt/interfaces/html.idl +++ b/test/fixtures/wpt/interfaces/html.idl @@ -48,6 +48,8 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; [LegacyOverrideBuiltIns] partial interface Document { + static Document parseHTMLUnsafe((TrustedHTML or DOMString) html); + // resource metadata management [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location; attribute USVString domain; @@ -75,8 +77,8 @@ partial interface Document { [CEReactions] Document open(optional DOMString unused1, optional DOMString unused2); // both arguments are ignored WindowProxy? open(USVString url, DOMString name, DOMString features); [CEReactions] undefined close(); - [CEReactions] undefined write(DOMString... text); - [CEReactions] undefined writeln(DOMString... text); + [CEReactions] undefined write((TrustedHTML or DOMString)... text); + [CEReactions] undefined writeln((TrustedHTML or DOMString)... text); // user interaction readonly attribute WindowProxy? defaultView; @@ -121,6 +123,7 @@ interface HTMLElement : Element { readonly attribute DOMString accessKeyLabel; [CEReactions] attribute boolean draggable; [CEReactions] attribute boolean spellcheck; + [CEReactions] attribute DOMString writingSuggestions; [CEReactions] attribute DOMString autocapitalize; [CEReactions] attribute [LegacyNullToEmptyString] DOMString innerText; @@ -449,7 +452,7 @@ interface HTMLIFrameElement : HTMLElement { [HTMLConstructor] constructor(); [CEReactions] attribute USVString src; - [CEReactions] attribute DOMString srcdoc; + [CEReactions] attribute (TrustedHTML or DOMString) srcdoc; [CEReactions] attribute DOMString name; [SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox; [CEReactions] attribute DOMString allow; @@ -999,6 +1002,8 @@ interface HTMLSelectElement : HTMLElement { boolean reportValidity(); undefined setCustomValidity(DOMString error); + undefined showPicker(); + readonly attribute NodeList labels; }; @@ -1196,6 +1201,7 @@ dictionary FormDataEventInit : EventInit { interface HTMLDetailsElement : HTMLElement { [HTMLConstructor] constructor(); + [CEReactions] attribute DOMString name; [CEReactions] attribute boolean open; }; @@ -1236,6 +1242,10 @@ interface HTMLTemplateElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute DocumentFragment content; + [CEReactions] attribute DOMString shadowRootMode; + [CEReactions] attribute boolean shadowRootDelegatesFocus; + [CEReactions] attribute boolean shadowRootClonable; + [CEReactions] attribute boolean shadowRootSerializable; }; [Exposed=Window] @@ -1570,7 +1580,6 @@ interface OffscreenCanvas : EventTarget { [Exposed=(Window,Worker)] interface OffscreenCanvasRenderingContext2D { - undefined commit(); readonly attribute OffscreenCanvas canvas; }; @@ -1626,6 +1635,9 @@ interface ElementInternals { boolean reportValidity(); readonly attribute NodeList labels; + + // Custom state pseudo-class + [SameObject] readonly attribute CustomStateSet states; }; // Accessibility semantics @@ -1644,6 +1656,11 @@ dictionary ValidityStateFlags { boolean customError = false; }; +[Exposed=Window] +interface CustomStateSet { + setlike; +}; + [Exposed=(Window)] interface VisibilityStateEntry : PerformanceEntry { readonly attribute DOMString name; // shadows inherited name @@ -1686,6 +1703,22 @@ interface mixin ElementContentEditable { [CEReactions] attribute DOMString inputMode; }; +[Exposed=Window] +interface CloseWatcher : EventTarget { + constructor(optional CloseWatcherOptions options = {}); + + undefined requestClose(); + undefined close(); + undefined destroy(); + + attribute EventHandler oncancel; + attribute EventHandler onclose; +}; + +dictionary CloseWatcherOptions { + AbortSignal signal; +}; + [Exposed=Window] interface DataTransfer { constructor(); @@ -1849,6 +1882,7 @@ interface Navigation : EventTarget { readonly attribute NavigationHistoryEntry? currentEntry; undefined updateCurrentEntry(NavigationUpdateCurrentEntryOptions options); readonly attribute NavigationTransition? transition; + readonly attribute NavigationActivation? activation; readonly attribute boolean canGoBack; readonly attribute boolean canGoForward; @@ -1921,6 +1955,13 @@ interface NavigationTransition { readonly attribute Promise finished; }; +[Exposed=Window] +interface NavigationActivation { + readonly attribute NavigationHistoryEntry? from; + readonly attribute NavigationHistoryEntry entry; + readonly attribute NavigationType navigationType; +}; + [Exposed=Window] interface NavigateEvent : Event { constructor(DOMString type, NavigateEventInit eventInitDict); @@ -2021,6 +2062,28 @@ dictionary HashChangeEventInit : EventInit { USVString newURL = ""; }; +[Exposed=Window] +interface PageSwapEvent : Event { + constructor(DOMString type, optional PageSwapEventInit eventInitDict = {}); + readonly attribute NavigationActivation? activation; + readonly attribute ViewTransition? viewTransition; +}; + +dictionary PageSwapEventInit : EventInit { + NavigationActivation? activation = null; + ViewTransition? viewTransition = null; +}; + +[Exposed=Window] +interface PageRevealEvent : Event { + constructor(DOMString type, optional PageRevealEventInit eventInitDict = {}); + readonly attribute ViewTransition? viewTransition; +}; + +dictionary PageRevealEventInit : EventInit { + ViewTransition? viewTransition = null; +}; + [Exposed=Window] interface PageTransitionEvent : Event { constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {}); @@ -2037,6 +2100,23 @@ interface BeforeUnloadEvent : Event { attribute DOMString returnValue; }; +[Exposed=Window] +interface NotRestoredReasonDetails { + readonly attribute DOMString reason; + [Default] object toJSON(); +}; + +[Exposed=Window] +interface NotRestoredReasons { + readonly attribute DOMString? src; + readonly attribute DOMString? id; + readonly attribute DOMString? name; + readonly attribute DOMString? url; + readonly attribute FrozenArray? reasons; + readonly attribute FrozenArray? children; + [Default] object toJSON(); +}; + [Exposed=*] interface ErrorEvent : Event { constructor(DOMString type, optional ErrorEventInit eventInitDict = {}); @@ -2060,12 +2140,12 @@ dictionary ErrorEventInit : EventInit { interface PromiseRejectionEvent : Event { constructor(DOMString type, PromiseRejectionEventInit eventInitDict); - readonly attribute Promise promise; + readonly attribute object promise; readonly attribute any reason; }; dictionary PromiseRejectionEventInit : EventInit { - required Promise promise; + required object promise; any reason; }; @@ -2170,7 +2250,9 @@ interface mixin WindowEventHandlers { attribute EventHandler onoffline; attribute EventHandler ononline; attribute EventHandler onpagehide; + attribute EventHandler onpagereveal; attribute EventHandler onpageshow; + attribute EventHandler onpageswap; attribute EventHandler onpopstate; attribute EventHandler onrejectionhandled; attribute EventHandler onstorage; @@ -2178,7 +2260,7 @@ interface mixin WindowEventHandlers { attribute EventHandler onunload; }; -typedef (DOMString or Function) TimerHandler; +typedef (DOMString or Function or TrustedScript) TimerHandler; interface mixin WindowOrWorkerGlobalScope { [Replaceable] readonly attribute USVString origin; @@ -2210,11 +2292,32 @@ interface mixin WindowOrWorkerGlobalScope { Window includes WindowOrWorkerGlobalScope; WorkerGlobalScope includes WindowOrWorkerGlobalScope; +partial interface Element { + [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html); + DOMString getHTML(optional GetHTMLOptions options = {}); + + [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML; + [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) outerHTML; + [CEReactions] undefined insertAdjacentHTML(DOMString position, (TrustedHTML or DOMString) string); +}; + +partial interface ShadowRoot { + [CEReactions] undefined setHTMLUnsafe((TrustedHTML or DOMString) html); + DOMString getHTML(optional GetHTMLOptions options = {}); + + [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML; +}; + +dictionary GetHTMLOptions { + boolean serializableShadowRoots = false; + sequence shadowRoots = []; +}; + [Exposed=Window] interface DOMParser { constructor(); - [NewObject] Document parseFromString(DOMString string, DOMParserSupportedType type); + [NewObject] Document parseFromString((TrustedHTML or DOMString) string, DOMParserSupportedType type); }; enum DOMParserSupportedType { @@ -2225,6 +2328,10 @@ enum DOMParserSupportedType { "image/svg+xml" }; +partial interface Range { + [CEReactions, NewObject] DocumentFragment createContextualFragment((TrustedHTML or DOMString) string); +}; + [Exposed=Window] interface Navigator { // objects implementing this interface also implement the interfaces given below @@ -2414,6 +2521,7 @@ interface MessagePort : EventTarget { // event handlers attribute EventHandler onmessage; attribute EventHandler onmessageerror; + attribute EventHandler onclose; }; dictionary StructuredSerializeOptions { @@ -2436,7 +2544,7 @@ interface WorkerGlobalScope : EventTarget { readonly attribute WorkerGlobalScope self; readonly attribute WorkerLocation location; readonly attribute WorkerNavigator navigator; - undefined importScripts(USVString... urls); + undefined importScripts((TrustedScriptURL or USVString)... urls); attribute OnErrorEventHandler onerror; attribute EventHandler onlanguagechange; @@ -2474,7 +2582,7 @@ interface mixin AbstractWorker { [Exposed=(Window,DedicatedWorker,SharedWorker)] interface Worker : EventTarget { - constructor(USVString scriptURL, optional WorkerOptions options = {}); + constructor((TrustedScriptURL or USVString) scriptURL, optional WorkerOptions options = {}); undefined terminate(); @@ -2496,7 +2604,7 @@ Worker includes AbstractWorker; [Exposed=Window] interface SharedWorker : EventTarget { - constructor(USVString scriptURL, optional (DOMString or WorkerOptions) options = {}); + constructor((TrustedScriptURL or USVString) scriptURL, optional (DOMString or WorkerOptions) options = {}); readonly attribute MessagePort port; }; diff --git a/test/fixtures/wpt/interfaces/performance-timeline.idl b/test/fixtures/wpt/interfaces/performance-timeline.idl index cdd8fafd8c64e6..6ef84b6cbb8e60 100644 --- a/test/fixtures/wpt/interfaces/performance-timeline.idl +++ b/test/fixtures/wpt/interfaces/performance-timeline.idl @@ -12,10 +12,12 @@ typedef sequence PerformanceEntryList; [Exposed=(Window,Worker)] interface PerformanceEntry { + readonly attribute unsigned long long id; readonly attribute DOMString name; readonly attribute DOMString entryType; readonly attribute DOMHighResTimeStamp startTime; readonly attribute DOMHighResTimeStamp duration; + readonly attribute unsigned long long navigationId; [Default] object toJSON(); }; diff --git a/test/fixtures/wpt/interfaces/streams.idl b/test/fixtures/wpt/interfaces/streams.idl index 838bf39c6d6df5..ab9be033e43ba0 100644 --- a/test/fixtures/wpt/interfaces/streams.idl +++ b/test/fixtures/wpt/interfaces/streams.idl @@ -84,11 +84,15 @@ dictionary ReadableStreamReadResult { interface ReadableStreamBYOBReader { constructor(ReadableStream stream); - Promise read(ArrayBufferView view); + Promise read(ArrayBufferView view, optional ReadableStreamBYOBReaderReadOptions options = {}); undefined releaseLock(); }; ReadableStreamBYOBReader includes ReadableStreamGenericReader; +dictionary ReadableStreamBYOBReaderReadOptions { + [EnforceRange] unsigned long long min = 1; +}; + [Exposed=*] interface ReadableStreamDefaultController { readonly attribute unrestricted double? desiredSize; @@ -174,6 +178,7 @@ dictionary Transformer { TransformerStartCallback start; TransformerTransformCallback transform; TransformerFlushCallback flush; + TransformerCancelCallback cancel; any readableType; any writableType; }; @@ -181,6 +186,7 @@ dictionary Transformer { callback TransformerStartCallback = any (TransformStreamDefaultController controller); callback TransformerFlushCallback = Promise (TransformStreamDefaultController controller); callback TransformerTransformCallback = Promise (any chunk, TransformStreamDefaultController controller); +callback TransformerCancelCallback = Promise (any reason); [Exposed=*] interface TransformStreamDefaultController { diff --git a/test/fixtures/wpt/interfaces/url.idl b/test/fixtures/wpt/interfaces/url.idl index a5e4d1eb492e82..cd18a66e31b339 100644 --- a/test/fixtures/wpt/interfaces/url.idl +++ b/test/fixtures/wpt/interfaces/url.idl @@ -8,6 +8,7 @@ interface URL { constructor(USVString url, optional USVString base); + static URL? parse(USVString url, optional USVString base); static boolean canParse(USVString url, optional USVString base); stringifier attribute USVString href; diff --git a/test/fixtures/wpt/interfaces/webidl.idl b/test/fixtures/wpt/interfaces/webidl.idl index 4d0dfaa106275f..f3db91096ac1be 100644 --- a/test/fixtures/wpt/interfaces/webidl.idl +++ b/test/fixtures/wpt/interfaces/webidl.idl @@ -6,13 +6,13 @@ typedef (Int8Array or Int16Array or Int32Array or Uint8Array or Uint16Array or Uint32Array or Uint8ClampedArray or BigInt64Array or BigUint64Array or - Float32Array or Float64Array or DataView) ArrayBufferView; + Float16Array or Float32Array or Float64Array or DataView) ArrayBufferView; typedef (ArrayBufferView or ArrayBuffer) BufferSource; typedef (ArrayBuffer or SharedArrayBuffer or [AllowShared] ArrayBufferView) AllowSharedBufferSource; [Exposed=*, Serializable] -interface DOMException { // but see below note about ECMAScript binding +interface DOMException { // but see below note about JavaScript binding constructor(optional DOMString message = "", optional DOMString name = "Error"); readonly attribute DOMString name; readonly attribute DOMString message; diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 0980ca616930ad..bd8dd4f7672573 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -52,7 +52,7 @@ "path": "html/webappapis/timers" }, "interfaces": { - "commit": "727995f0432f7ab2ea35c8679412edc28d87ec08", + "commit": "e90ece61d6e7ff84a0dc9c496588690e6a61cb17", "path": "interfaces" }, "performance-timeline": { diff --git a/test/wpt/status/WebCryptoAPI.json b/test/wpt/status/WebCryptoAPI.json index 69f86168f5a9df..9f9ba93240be25 100644 --- a/test/wpt/status/WebCryptoAPI.json +++ b/test/wpt/status/WebCryptoAPI.json @@ -4,13 +4,5 @@ }, "historical.any.js": { "skip": "Not relevant in Node.js context" - }, - "idlharness.https.any.js": { - "fail": { - "note": "WPT not updated for https://github.com/w3c/webcrypto/pull/345 yet", - "expected": [ - "SubtleCrypto interface: operation deriveBits(AlgorithmIdentifier, CryptoKey, unsigned long)" - ] - } } } diff --git a/test/wpt/status/performance-timeline.json b/test/wpt/status/performance-timeline.json index 36eeb36782c9aa..73e1aad56cf707 100644 --- a/test/wpt/status/performance-timeline.json +++ b/test/wpt/status/performance-timeline.json @@ -7,6 +7,15 @@ ] } }, + "idlharness.any.js": { + "fail": { + "note": "not implemented", + "expected": [ + "PerformanceEntry interface: attribute id", + "PerformanceEntry interface: attribute navigationId" + ] + } + }, "navigation-id.helper.js": { "skip": "This is not a test file." },