From 94dca79feb75b47e656112c2007d73064c6be66f Mon Sep 17 00:00:00 2001 From: Uzlopak <5059100+Uzlopak@users.noreply.github.com> Date: Tue, 21 Jan 2025 00:17:00 +0000 Subject: [PATCH] chore: update WPT --- test/fixtures/wpt/fetch/api/basic/gc.any.js | 19 ++++ test/fixtures/wpt/interfaces/css-fonts-5.idl | 54 +++++++++++ test/fixtures/wpt/interfaces/css-fonts.idl | 38 -------- test/fixtures/wpt/interfaces/css-mixins.idl | 10 ++ .../wpt/interfaces/digital-credentials.idl | 2 +- test/fixtures/wpt/interfaces/fedcm.idl | 1 + test/fixtures/wpt/interfaces/html.idl | 2 + .../mediacapture-surface-control.idl | 2 +- .../wpt/interfaces/permissions-policy.idl | 1 + .../wpt/interfaces/shared-storage.idl | 44 +++++++-- test/fixtures/wpt/interfaces/webnn.idl | 12 ++- .../resources/srcdoc-iframe-worker.js | 11 +++ .../resources/srcdoc-iframe.html | 92 +++++++++++++++++++ .../service-worker/srcdoc-iframe.https.html | 66 +++++++++++++ 14 files changed, 306 insertions(+), 48 deletions(-) create mode 100644 test/fixtures/wpt/fetch/api/basic/gc.any.js create mode 100644 test/fixtures/wpt/interfaces/css-fonts-5.idl create mode 100644 test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe-worker.js create mode 100644 test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe.html create mode 100644 test/fixtures/wpt/service-workers/service-worker/srcdoc-iframe.https.html diff --git a/test/fixtures/wpt/fetch/api/basic/gc.any.js b/test/fixtures/wpt/fetch/api/basic/gc.any.js new file mode 100644 index 00000000000..70362ff39ce --- /dev/null +++ b/test/fixtures/wpt/fetch/api/basic/gc.any.js @@ -0,0 +1,19 @@ +// META: global=window,worker +// META: script=/common/gc.js + +promise_test(async () => { + let i = 0; + const repeat = 5; + const buffer = await new Response(new ReadableStream({ + pull(c) { + if (i >= repeat) { + c.close(); + return; + } + ++i; + c.enqueue(new Uint8Array([0])) + garbageCollect(); + } + })).arrayBuffer(); + assert_equals(buffer.byteLength, repeat, `The buffer should be ${repeat}-byte long`); +}, "GC/CC should not abruptly close the stream while being consumed by Response"); diff --git a/test/fixtures/wpt/interfaces/css-fonts-5.idl b/test/fixtures/wpt/interfaces/css-fonts-5.idl new file mode 100644 index 00000000000..06461b0366c --- /dev/null +++ b/test/fixtures/wpt/interfaces/css-fonts-5.idl @@ -0,0 +1,54 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: CSS Fonts Module Level 5 (https://drafts.csswg.org/css-fonts-5/) + +[Exposed=Window] +interface CSSFontFaceDescriptors : CSSStyleDeclaration { + attribute [LegacyNullToEmptyString] CSSOMString src; + attribute [LegacyNullToEmptyString] CSSOMString fontFamily; + attribute [LegacyNullToEmptyString] CSSOMString font-family; + attribute [LegacyNullToEmptyString] CSSOMString fontStyle; + attribute [LegacyNullToEmptyString] CSSOMString font-style; + attribute [LegacyNullToEmptyString] CSSOMString fontWeight; + attribute [LegacyNullToEmptyString] CSSOMString font-weight; + attribute [LegacyNullToEmptyString] CSSOMString fontStretch; + attribute [LegacyNullToEmptyString] CSSOMString font-stretch; + attribute [LegacyNullToEmptyString] CSSOMString fontWidth; + attribute [LegacyNullToEmptyString] CSSOMString font-width; + attribute [LegacyNullToEmptyString] CSSOMString fontSize; + attribute [LegacyNullToEmptyString] CSSOMString font-size; + attribute [LegacyNullToEmptyString] CSSOMString sizeAdjust; + attribute [LegacyNullToEmptyString] CSSOMString size-adjust; + attribute [LegacyNullToEmptyString] CSSOMString unicodeRange; + attribute [LegacyNullToEmptyString] CSSOMString unicode-range; + attribute [LegacyNullToEmptyString] CSSOMString fontFeatureSettings; + attribute [LegacyNullToEmptyString] CSSOMString font-feature-settings; + attribute [LegacyNullToEmptyString] CSSOMString fontVariationSettings; + attribute [LegacyNullToEmptyString] CSSOMString font-variation-settings; + attribute [LegacyNullToEmptyString] CSSOMString fontNamedInstance; + attribute [LegacyNullToEmptyString] CSSOMString font-named-instance; + attribute [LegacyNullToEmptyString] CSSOMString fontDisplay; + attribute [LegacyNullToEmptyString] CSSOMString font-display; + attribute [LegacyNullToEmptyString] CSSOMString fontLanguageOverride; + attribute [LegacyNullToEmptyString] CSSOMString font-language-override; + attribute [LegacyNullToEmptyString] CSSOMString ascentOverride; + attribute [LegacyNullToEmptyString] CSSOMString ascent-override; + attribute [LegacyNullToEmptyString] CSSOMString descentOverride; + attribute [LegacyNullToEmptyString] CSSOMString descent-override; + attribute [LegacyNullToEmptyString] CSSOMString lineGapOverride; + attribute [LegacyNullToEmptyString] CSSOMString line-gap-override; + attribute [LegacyNullToEmptyString] CSSOMString superscriptPositionOverride; + attribute [LegacyNullToEmptyString] CSSOMString superscript-position-override; + attribute [LegacyNullToEmptyString] CSSOMString subscriptPositionOverride; + attribute [LegacyNullToEmptyString] CSSOMString subscript-position-override; + attribute [LegacyNullToEmptyString] CSSOMString superscriptSizeOverride; + attribute [LegacyNullToEmptyString] CSSOMString superscript-size-override; + attribute [LegacyNullToEmptyString] CSSOMString subscriptSizeOverride; + attribute [LegacyNullToEmptyString] CSSOMString subscript-size-override; +}; + +[Exposed=Window] +interface CSSFontFaceRule : CSSRule { + [SameObject, PutForwards=cssText] readonly attribute CSSFontFaceDescriptors style; +}; diff --git a/test/fixtures/wpt/interfaces/css-fonts.idl b/test/fixtures/wpt/interfaces/css-fonts.idl index d5c9dc86705..9b8034bc6d7 100644 --- a/test/fixtures/wpt/interfaces/css-fonts.idl +++ b/test/fixtures/wpt/interfaces/css-fonts.idl @@ -3,44 +3,6 @@ // (https://github.com/w3c/webref) // Source: CSS Fonts Module Level 4 (https://drafts.csswg.org/css-fonts-4/) -[Exposed=Window] -interface CSSFontFaceDescriptors : CSSStyleDeclaration { - attribute [LegacyNullToEmptyString] CSSOMString src; - attribute [LegacyNullToEmptyString] CSSOMString fontFamily; - attribute [LegacyNullToEmptyString] CSSOMString font-family; - attribute [LegacyNullToEmptyString] CSSOMString fontStyle; - attribute [LegacyNullToEmptyString] CSSOMString font-style; - attribute [LegacyNullToEmptyString] CSSOMString fontWeight; - attribute [LegacyNullToEmptyString] CSSOMString font-weight; - attribute [LegacyNullToEmptyString] CSSOMString fontStretch; - attribute [LegacyNullToEmptyString] CSSOMString font-stretch; - attribute [LegacyNullToEmptyString] CSSOMString fontWidth; - attribute [LegacyNullToEmptyString] CSSOMString font-width; - attribute [LegacyNullToEmptyString] CSSOMString unicodeRange; - attribute [LegacyNullToEmptyString] CSSOMString unicode-range; - attribute [LegacyNullToEmptyString] CSSOMString fontFeatureSettings; - attribute [LegacyNullToEmptyString] CSSOMString font-feature-settings; - attribute [LegacyNullToEmptyString] CSSOMString fontVariationSettings; - attribute [LegacyNullToEmptyString] CSSOMString font-variation-settings; - attribute [LegacyNullToEmptyString] CSSOMString fontNamedInstance; - attribute [LegacyNullToEmptyString] CSSOMString font-named-instance; - attribute [LegacyNullToEmptyString] CSSOMString fontDisplay; - attribute [LegacyNullToEmptyString] CSSOMString font-display; - attribute [LegacyNullToEmptyString] CSSOMString fontLanguageOverride; - attribute [LegacyNullToEmptyString] CSSOMString font-language-override; - attribute [LegacyNullToEmptyString] CSSOMString ascentOverride; - attribute [LegacyNullToEmptyString] CSSOMString ascent-override; - attribute [LegacyNullToEmptyString] CSSOMString descentOverride; - attribute [LegacyNullToEmptyString] CSSOMString descent-override; - attribute [LegacyNullToEmptyString] CSSOMString lineGapOverride; - attribute [LegacyNullToEmptyString] CSSOMString line-gap-override; -}; - -[Exposed=Window] -interface CSSFontFaceRule : CSSRule { - [SameObject, PutForwards=cssText] readonly attribute CSSFontFaceDescriptors style; -}; - partial interface CSSRule { const unsigned short FONT_FEATURE_VALUES_RULE = 14; }; [Exposed=Window] diff --git a/test/fixtures/wpt/interfaces/css-mixins.idl b/test/fixtures/wpt/interfaces/css-mixins.idl index 49806ab5470..6629b3861f6 100644 --- a/test/fixtures/wpt/interfaces/css-mixins.idl +++ b/test/fixtures/wpt/interfaces/css-mixins.idl @@ -5,3 +5,13 @@ [Exposed=Window] interface CSSFunctionRule : CSSGroupingRule { }; + +[Exposed=Window] +interface CSSFunctionDescriptors : CSSStyleDeclaration { + attribute [LegacyNullToEmptyString] CSSOMString result; +}; + +[Exposed=Window] +interface CSSFunctionDeclarations : CSSRule { + [SameObject, PutForwards=cssText] readonly attribute CSSFunctionDescriptors style; +}; diff --git a/test/fixtures/wpt/interfaces/digital-credentials.idl b/test/fixtures/wpt/interfaces/digital-credentials.idl index e20079efa14..e4ebb3b3e86 100644 --- a/test/fixtures/wpt/interfaces/digital-credentials.idl +++ b/test/fixtures/wpt/interfaces/digital-credentials.idl @@ -19,5 +19,5 @@ dictionary DigitalCredentialRequest { [Exposed=Window, SecureContext] interface DigitalCredential : Credential { readonly attribute DOMString protocol; - readonly attribute object data; + [SameObject] readonly attribute object data; }; diff --git a/test/fixtures/wpt/interfaces/fedcm.idl b/test/fixtures/wpt/interfaces/fedcm.idl index 16b5b2faf10..07f7955ff64 100644 --- a/test/fixtures/wpt/interfaces/fedcm.idl +++ b/test/fixtures/wpt/interfaces/fedcm.idl @@ -49,6 +49,7 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig { USVString nonce; DOMString loginHint; DOMString domainHint; + sequence fields; any params; }; diff --git a/test/fixtures/wpt/interfaces/html.idl b/test/fixtures/wpt/interfaces/html.idl index d4f8b9a7680..3832a6f9b71 100644 --- a/test/fixtures/wpt/interfaces/html.idl +++ b/test/fixtures/wpt/interfaces/html.idl @@ -1222,9 +1222,11 @@ interface HTMLDialogElement : HTMLElement { [CEReactions] attribute boolean open; attribute DOMString returnValue; + [CEReactions] attribute DOMString closedBy; [CEReactions] undefined show(); [CEReactions] undefined showModal(); [CEReactions] undefined close(optional DOMString returnValue); + [CEReactions] undefined requestClose(optional DOMString returnValue); }; [Exposed=Window] diff --git a/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl b/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl index b0bbd22304f..964f662da7f 100644 --- a/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl +++ b/test/fixtures/wpt/interfaces/mediacapture-surface-control.idl @@ -12,5 +12,5 @@ partial interface CaptureController { partial interface CaptureController { constructor(); - Promise forwardWheel(HTMLElement element); + Promise forwardWheel(HTMLElement? element); }; diff --git a/test/fixtures/wpt/interfaces/permissions-policy.idl b/test/fixtures/wpt/interfaces/permissions-policy.idl index 5878d8d150a..806d2eb80f6 100644 --- a/test/fixtures/wpt/interfaces/permissions-policy.idl +++ b/test/fixtures/wpt/interfaces/permissions-policy.idl @@ -27,4 +27,5 @@ interface PermissionsPolicyViolationReportBody : ReportBody { readonly attribute long? lineNumber; readonly attribute long? columnNumber; readonly attribute DOMString disposition; + readonly attribute DOMString? allowAttribute; }; diff --git a/test/fixtures/wpt/interfaces/shared-storage.idl b/test/fixtures/wpt/interfaces/shared-storage.idl index b6863eff8ee..6f38d673952 100644 --- a/test/fixtures/wpt/interfaces/shared-storage.idl +++ b/test/fixtures/wpt/interfaces/shared-storage.idl @@ -38,15 +38,49 @@ partial interface Window { [SecureContext] readonly attribute SharedStorage? sharedStorage; }; +[Exposed=(Window,SharedStorageWorklet)] +interface SharedStorageModifierMethod {}; + +[Exposed=(Window, SharedStorageWorklet)] +interface SharedStorageSetMethod : SharedStorageModifierMethod { + constructor(DOMString key, DOMString value, optional SharedStorageSetMethodOptions options = {}); +}; + +[Exposed=(Window, SharedStorageWorklet)] +interface SharedStorageAppendMethod : SharedStorageModifierMethod { + constructor(DOMString key, DOMString value, optional SharedStorageModifierMethodOptions options = {}); +}; + +[Exposed=(Window, SharedStorageWorklet)] +interface SharedStorageDeleteMethod : SharedStorageModifierMethod { + constructor(DOMString key, optional SharedStorageModifierMethodOptions options = {}); +}; + +[Exposed=(Window, SharedStorageWorklet)] +interface SharedStorageClearMethod : SharedStorageModifierMethod { + constructor(optional SharedStorageModifierMethodOptions options = {}); +}; + +dictionary SharedStorageModifierMethodOptions { + DOMString withLock; +}; + +dictionary SharedStorageSetMethodOptions : SharedStorageModifierMethodOptions { + boolean ignoreIfPresent; +}; + [Exposed=(Window,SharedStorageWorklet)] interface SharedStorage { Promise set(DOMString key, DOMString value, optional SharedStorageSetMethodOptions options = {}); Promise append(DOMString key, - DOMString value); - Promise delete(DOMString key); - Promise clear(); + DOMString value, + optional SharedStorageModifierMethodOptions options = {}); + Promise delete(DOMString key, optional SharedStorageModifierMethodOptions options = {}); + Promise clear(optional SharedStorageModifierMethodOptions options = {}); + Promise batchUpdate(sequence methods, + optional SharedStorageModifierMethodOptions options = {}); [Exposed=Window] Promise selectURL(DOMString name, @@ -76,10 +110,6 @@ interface SharedStorage { async iterable; }; -dictionary SharedStorageSetMethodOptions { - boolean ignoreIfPresent = false; -}; - dictionary SharedStoragePrivateAggregationConfig { USVString aggregationCoordinatorOrigin; USVString contextId; diff --git a/test/fixtures/wpt/interfaces/webnn.idl b/test/fixtures/wpt/interfaces/webnn.idl index 132280b05f8..3e1d9a9f440 100644 --- a/test/fixtures/wpt/interfaces/webnn.idl +++ b/test/fixtures/wpt/interfaces/webnn.idl @@ -34,6 +34,10 @@ interface ML { typedef record MLNamedTensors; +dictionary MLContextLostInfo { + DOMString message; +}; + [SecureContext, Exposed=(Window, DedicatedWorker)] interface MLContext { undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs); @@ -46,6 +50,10 @@ interface MLContext { undefined writeTensor(MLTensor tensor, AllowSharedBufferSource inputData); MLOpSupportLimits opSupportLimits(); + + undefined destroy(); + + readonly attribute Promise lost; }; dictionary MLOpSupportLimits { @@ -71,7 +79,9 @@ dictionary MLSingleInputSupportLimits { }; [SecureContext, Exposed=(Window, DedicatedWorker)] -interface MLGraph {}; +interface MLGraph { + undefined destroy(); +}; enum MLInputOperandLayout { "nchw", diff --git a/test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe-worker.js b/test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe-worker.js new file mode 100644 index 00000000000..548116c89ea --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe-worker.js @@ -0,0 +1,11 @@ +self.addEventListener('message', event => { + event.source.postMessage('passed'); +}); + +self.addEventListener('fetch', event => { + let url = new URL(event.request.url); + if (!url.searchParams.get('test_resource')) { + return; + } + event.respondWith(new Response('passed')); +}); diff --git a/test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe.html b/test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe.html new file mode 100644 index 00000000000..6407845c5ad --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/resources/srcdoc-iframe.html @@ -0,0 +1,92 @@ + + + + + + + + diff --git a/test/fixtures/wpt/service-workers/service-worker/srcdoc-iframe.https.html b/test/fixtures/wpt/service-workers/service-worker/srcdoc-iframe.https.html new file mode 100644 index 00000000000..9c1c88e15a8 --- /dev/null +++ b/test/fixtures/wpt/service-workers/service-worker/srcdoc-iframe.https.html @@ -0,0 +1,66 @@ + +Service Worker: srcdoc frame handling + + + + + + \ No newline at end of file