From 40714fac7e346d0fc72d16cd04e12214ed8f364d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 22:16:42 +0100 Subject: [PATCH] chore: update WPT (#3954) Co-authored-by: Uzlopak <5059100+Uzlopak@users.noreply.github.com> --- ...t-json-module-import-static.https.sub.html | 373 +++++++++++++++++ .../script-json-module-import-static.sub.html | 378 ++++++++++++++++++ .../metadata/resources/es-json-module.sub.js | 1 + .../metadata/tools/fetch-metadata.conf.yml | 12 + .../script-json-module-import-static.sub.html | 58 +++ test/fixtures/wpt/interfaces/dom.idl | 4 +- .../wpt/interfaces/element-timing.idl | 2 + test/fixtures/wpt/interfaces/login-status.idl | 19 + test/fixtures/wpt/interfaces/observable.idl | 4 +- .../fixtures/wpt/interfaces/sanitizer-api.idl | 8 +- .../wpt/interfaces/shared-storage.idl | 8 + test/fixtures/wpt/interfaces/web-locks.idl | 4 +- test/fixtures/wpt/resources/testdriver.js | 28 +- 13 files changed, 889 insertions(+), 10 deletions(-) create mode 100644 test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.https.sub.html create mode 100644 test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.sub.html create mode 100644 test/fixtures/wpt/fetch/metadata/resources/es-json-module.sub.js create mode 100644 test/fixtures/wpt/fetch/metadata/tools/templates/script-json-module-import-static.sub.html create mode 100644 test/fixtures/wpt/interfaces/login-status.idl diff --git a/test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.https.sub.html b/test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.https.sub.html new file mode 100644 index 00000000000..55c7014b9cb --- /dev/null +++ b/test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.https.sub.html @@ -0,0 +1,373 @@ + + + + + HTTP headers on request for static ECMAScript module import + + + + + + diff --git a/test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.sub.html b/test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.sub.html new file mode 100644 index 00000000000..2b554df255a --- /dev/null +++ b/test/fixtures/wpt/fetch/metadata/generated/script-json-module-import-static.sub.html @@ -0,0 +1,378 @@ + + + + + HTTP headers on request for static ECMAScript module import + + + + + + diff --git a/test/fixtures/wpt/fetch/metadata/resources/es-json-module.sub.js b/test/fixtures/wpt/fetch/metadata/resources/es-json-module.sub.js new file mode 100644 index 00000000000..df5d44cb890 --- /dev/null +++ b/test/fixtures/wpt/fetch/metadata/resources/es-json-module.sub.js @@ -0,0 +1 @@ +import '{{GET[moduleId]}}' with { type: 'json' }; diff --git a/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml b/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml index bc764aed02d..425a4e1c86f 100644 --- a/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml +++ b/test/fixtures/wpt/fetch/metadata/tools/fetch-metadata.conf.yml @@ -95,6 +95,7 @@ cases: window-location.sub.html: [{}] script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] + script-json-module-import-static.sub.html: [{}] svg-image.sub.html: [{}] window-history.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] @@ -152,6 +153,7 @@ cases: window-location.sub.html: [] script-module-import-dynamic.sub.html: [] script-module-import-static.sub.html: [] + script-json-module-import-static.sub.html: [] svg-image.sub.html: [] window-history.sub.html: [] worker-dedicated-importscripts.sub.html: [] @@ -220,6 +222,7 @@ cases: window-location.sub.html: [{}] script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] + script-json-module-import-static.sub.html: [{}] serviceworker.https.sub.html: [{}] svg-image.sub.html: [{}] window-history.sub.html: [{}] @@ -296,6 +299,7 @@ cases: window-location.sub.html: [{}] script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] + script-json-module-import-static.sub.html: [{}] svg-image.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] @@ -390,6 +394,7 @@ cases: window-location.sub.html: [{}] script-module-import-dynamic.sub.html: [{}] script-module-import-static.sub.html: [{}] + script-json-module-import-static.sub.html: [{}] svg-image.sub.html: [{}] worker-dedicated-importscripts.sub.html: [{}] @@ -431,6 +436,7 @@ cases: header-link.sub.html: [] script-module-import-static.sub.html: [] script-module-import-dynamic.sub.html: [] + script-json-module-import-static.sub.html: [] # Service Workers' redirect mode is "error" serviceworker.https.sub.html: [] # Interstitial locations in an HTTP redirect chain are not added to the @@ -619,6 +625,8 @@ cases: - expected: cors script-module-import-static.sub.html: - expected: cors + script-json-module-import-static.sub.html: + - expected: cors # https://svgwg.org/svg2-draft/linking.html#processingURL-fetch svg-image.sub.html: - expected: no-cors @@ -747,6 +755,8 @@ cases: - expected: script script-module-import-static.sub.html: - expected: script + script-json-module-import-static.sub.html: + - expected: json serviceworker.https.sub.html: - expected: serviceworker # Implemented as "image" in Chromium and Firefox, but specified as @@ -850,6 +860,8 @@ cases: - expected: NULL script-module-import-static.sub.html: - expected: NULL + script-json-module-import-static.sub.html: + - expected: NULL serviceworker.https.sub.html: - expected: NULL svg-image.sub.html: diff --git a/test/fixtures/wpt/fetch/metadata/tools/templates/script-json-module-import-static.sub.html b/test/fixtures/wpt/fetch/metadata/tools/templates/script-json-module-import-static.sub.html new file mode 100644 index 00000000000..76aecbdb220 --- /dev/null +++ b/test/fixtures/wpt/fetch/metadata/tools/templates/script-json-module-import-static.sub.html @@ -0,0 +1,58 @@ + + + + + HTTP headers on request for static ECMAScript module import + + + + + + diff --git a/test/fixtures/wpt/interfaces/dom.idl b/test/fixtures/wpt/interfaces/dom.idl index 99192924f4f..814040a2c40 100644 --- a/test/fixtures/wpt/interfaces/dom.idl +++ b/test/fixtures/wpt/interfaces/dom.idl @@ -237,7 +237,7 @@ interface Node : EventTarget { [CEReactions] attribute DOMString? textContent; [CEReactions] undefined normalize(); - [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); + [CEReactions, NewObject] Node cloneNode(optional boolean subtree = false); boolean isEqualNode(Node? otherNode); boolean isSameNode(Node? otherNode); // legacy alias of === @@ -291,7 +291,7 @@ interface Document : Node { [NewObject] Comment createComment(DOMString data); [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); + [CEReactions, NewObject] Node importNode(Node node, optional boolean subtree = false); [CEReactions] Node adoptNode(Node node); [NewObject] Attr createAttribute(DOMString localName); diff --git a/test/fixtures/wpt/interfaces/element-timing.idl b/test/fixtures/wpt/interfaces/element-timing.idl index 70ca384894f..586b5084bb0 100644 --- a/test/fixtures/wpt/interfaces/element-timing.idl +++ b/test/fixtures/wpt/interfaces/element-timing.idl @@ -17,6 +17,8 @@ interface PerformanceElementTiming : PerformanceEntry { [Default] object toJSON(); }; +PerformanceElementTiming includes PaintTimingMixin; + partial interface Element { [CEReactions] attribute DOMString elementTiming; }; diff --git a/test/fixtures/wpt/interfaces/login-status.idl b/test/fixtures/wpt/interfaces/login-status.idl new file mode 100644 index 00000000000..6d368806e46 --- /dev/null +++ b/test/fixtures/wpt/interfaces/login-status.idl @@ -0,0 +1,19 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Login Status API (https://w3c-fedid.github.io/login-status/) + +enum LoginStatus { + "logged-in", + "logged-out", +}; + +[Exposed=Window, SecureContext] + +interface NavigatorLogin { + Promise setStatus(LoginStatus status); +}; + +partial interface Navigator { + [SecureContext] readonly attribute NavigatorLogin login; +}; diff --git a/test/fixtures/wpt/interfaces/observable.idl b/test/fixtures/wpt/interfaces/observable.idl index 55bdbb21e41..5aa8332ca9b 100644 --- a/test/fixtures/wpt/interfaces/observable.idl +++ b/test/fixtures/wpt/interfaces/observable.idl @@ -18,7 +18,7 @@ interface Subscriber { readonly attribute AbortSignal signal; }; -// SubscribeCallback is where the Observable "creator’s" code lives. It’s +// SubscribeCallback is where the Observable "creator's" code lives. It's // called when subscribe() is called, to set up a new subscription. callback SubscribeCallback = undefined (Subscriber subscriber); callback ObservableSubscriptionCallback = undefined (any value); @@ -63,7 +63,7 @@ interface Observable { constructor(SubscribeCallback callback); undefined subscribe(optional ObserverUnion observer = {}, optional SubscribeOptions options = {}); - // Constructs a native Observable from value if it’s any of the following: + // Constructs a native Observable from value if it's any of the following: // - Observable // - AsyncIterable // - Iterable diff --git a/test/fixtures/wpt/interfaces/sanitizer-api.idl b/test/fixtures/wpt/interfaces/sanitizer-api.idl index 47c6d12fab0..86ec7875f49 100644 --- a/test/fixtures/wpt/interfaces/sanitizer-api.idl +++ b/test/fixtures/wpt/interfaces/sanitizer-api.idl @@ -3,13 +3,17 @@ // (https://github.com/w3c/webref) // Source: HTML Sanitizer API (https://wicg.github.io/sanitizer-api/) +enum SanitizerPresets { "default" }; dictionary SetHTMLOptions { - (Sanitizer or SanitizerConfig) sanitizer = {}; + (Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = "default"; +}; +dictionary SetHTMLUnsafeOptions { + (Sanitizer or SanitizerConfig or SanitizerPresets) sanitizer = {}; }; [Exposed=(Window,Worker)] interface Sanitizer { - constructor(optional SanitizerConfig configuration = {}); + constructor(optional (SanitizerConfig or SanitizerPresets) configuration = "default"); // Query configuration: SanitizerConfig get(); diff --git a/test/fixtures/wpt/interfaces/shared-storage.idl b/test/fixtures/wpt/interfaces/shared-storage.idl index 741b86a31c8..b6863eff8ee 100644 --- a/test/fixtures/wpt/interfaces/shared-storage.idl +++ b/test/fixtures/wpt/interfaces/shared-storage.idl @@ -25,6 +25,8 @@ interface SharedStorageWorkletGlobalScope : WorkletGlobalScope { readonly attribute PrivateAggregation privateAggregation; Promise> interestGroups(); + + readonly attribute SharedStorageWorkletNavigator navigator; }; dictionary SharedStorageUrlWithMetadata { @@ -106,3 +108,9 @@ HTMLImageElement includes HTMLSharedStorageWritableElementUtils; partial dictionary RequestInit { boolean sharedStorageWritable; }; + +[ + Exposed=SharedStorageWorklet +] interface SharedStorageWorkletNavigator {}; + +SharedStorageWorkletNavigator includes NavigatorLocks; diff --git a/test/fixtures/wpt/interfaces/web-locks.idl b/test/fixtures/wpt/interfaces/web-locks.idl index d79e404b983..00648cc3b1e 100644 --- a/test/fixtures/wpt/interfaces/web-locks.idl +++ b/test/fixtures/wpt/interfaces/web-locks.idl @@ -10,7 +10,7 @@ interface mixin NavigatorLocks { Navigator includes NavigatorLocks; WorkerNavigator includes NavigatorLocks; -[SecureContext, Exposed=(Window,Worker)] +[SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)] interface LockManager { Promise request(DOMString name, LockGrantedCallback callback); @@ -43,7 +43,7 @@ dictionary LockInfo { DOMString clientId; }; -[SecureContext, Exposed=(Window,Worker)] +[SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)] interface Lock { readonly attribute DOMString name; readonly attribute LockMode mode; diff --git a/test/fixtures/wpt/resources/testdriver.js b/test/fixtures/wpt/resources/testdriver.js index bdd18cc0e7d..aee319f5757 100644 --- a/test/fixtures/wpt/resources/testdriver.js +++ b/test/fixtures/wpt/resources/testdriver.js @@ -3,6 +3,26 @@ var idCounter = 0; let testharness_context = null; + const features = (() => { + function getFeatures(scriptSrc) { + try { + const url = new URL(scriptSrc); + return url.searchParams.getAll('feature'); + } catch (e) { + return []; + } + } + + return getFeatures(document?.currentScript?.src ?? ''); + })(); + + function assertBidiIsEnabled(){ + if (!features.includes('bidi')) { + throw new Error( + "`?feature=bidi` is missing when importing testdriver.js but the test is using WebDriver BiDi APIs"); + } + } + function getInViewCenterPoint(rect) { var left = Math.max(0, rect.left); var right = Math.min(window.innerWidth, rect.right); @@ -115,6 +135,7 @@ * is successfully done. */ subscribe: async function (params = {}) { + assertBidiIsEnabled(); return window.test_driver_internal.bidi.log.entry_added.subscribe(params); }, /** @@ -127,6 +148,7 @@ * added event listener when called. */ on: function (callback) { + assertBidiIsEnabled(); return window.test_driver_internal.bidi.log.entry_added.on(callback); }, /** @@ -137,6 +159,7 @@ * with the event object when the event is emitted. */ once: function () { + assertBidiIsEnabled(); return new Promise(resolve => { const remove_handler = window.test_driver_internal.bidi.log.entry_added.on( event => { @@ -181,6 +204,7 @@ * the permission fails. */ set_permission: function (params) { + assertBidiIsEnabled(); return window.test_driver_internal.bidi.permissions.set_permission( params); } @@ -250,8 +274,8 @@ let wait_click = new Promise(resolve => button.addEventListener("click", resolve)); return test_driver.click(button) - .then(wait_click) - .then(function() { + .then(() => wait_click) + .then(() => { button.remove(); if (typeof action === "function") {