From 55864c661085a3a250b1afee8c98a7346016dd71 Mon Sep 17 00:00:00 2001 From: jazelly <28685065+jazelly@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:00:16 +0000 Subject: [PATCH] chore: update WPT --- test/fixtures/wpt/eventsource/META.yml | 1 + .../quota.tentative.https.window.js | 52 ++-- .../interfaces/attribution-reporting-api.idl | 1 + .../wpt/interfaces/compute-pressure.idl | 2 +- test/fixtures/wpt/interfaces/fedcm.idl | 21 +- test/fixtures/wpt/interfaces/fenced-frame.idl | 6 + test/fixtures/wpt/interfaces/html.idl | 31 ++- .../wpt/interfaces/invokers.tentative.idl | 10 +- .../wpt/interfaces/long-animation-frames.idl | 2 + test/fixtures/wpt/interfaces/mediasession.idl | 2 +- test/fixtures/wpt/interfaces/paint-timing.idl | 7 + .../interfaces/private-aggregation-api.idl | 52 ---- .../wpt/interfaces/resource-timing.idl | 1 + .../wpt/interfaces/shared-storage.idl | 6 +- test/fixtures/wpt/interfaces/turtledove.idl | 69 ++++- test/fixtures/wpt/interfaces/user-timing.idl | 2 +- .../wpt/interfaces/web-animations-2.idl | 2 +- .../wpt/interfaces/web-animations.idl | 1 + test/fixtures/wpt/interfaces/webaudio.idl | 12 +- test/fixtures/wpt/interfaces/webauthn.idl | 1 - test/fixtures/wpt/interfaces/webcodecs.idl | 10 +- test/fixtures/wpt/interfaces/webgpu.idl | 56 ++-- test/fixtures/wpt/interfaces/webnn.idl | 31 ++- test/fixtures/wpt/interfaces/webrtc-stats.idl | 3 + test/fixtures/wpt/interfaces/webtransport.idl | 3 +- test/fixtures/wpt/interfaces/webusb.idl | 26 +- test/fixtures/wpt/interfaces/webxr.idl | 1 + test/fixtures/wpt/resources/check-layout.js | 245 ------------------ .../wpt/resources/idlharness-shadowrealm.js | 61 ----- test/fixtures/wpt/resources/idlharness.js | 19 +- .../wpt/resources/out-of-scope-test.js | 5 + .../IdlNamespace/test_operation.html | 13 +- test/fixtures/wpt/resources/testdriver.js | 140 ++++++++-- ...rness-shadowrealm-audioworkletprocessor.js | 52 ++++ .../testharness-shadowrealm-inner.js | 38 +++ .../testharness-shadowrealm-outer.js | 151 +++++++++++ test/fixtures/wpt/resources/testharness.js | 52 ++-- .../local-url-inherit-controller-frame.html | 3 +- .../service-worker/resources/router-rules.js | 31 --- .../static-router-invalid-rules.https.html | 27 -- .../static-router-resource-timing.https.html | 1 + ...ge-in-detached-iframe.tentative.https.html | 21 -- .../constructor-submitter-coordinate.html | 19 +- .../formdata/submitter-coordinate-value.html | 55 ++++ 44 files changed, 755 insertions(+), 589 deletions(-) delete mode 100644 test/fixtures/wpt/resources/check-layout.js delete mode 100644 test/fixtures/wpt/resources/idlharness-shadowrealm.js create mode 100644 test/fixtures/wpt/resources/out-of-scope-test.js create mode 100644 test/fixtures/wpt/resources/testharness-shadowrealm-audioworkletprocessor.js create mode 100644 test/fixtures/wpt/resources/testharness-shadowrealm-inner.js create mode 100644 test/fixtures/wpt/resources/testharness-shadowrealm-outer.js delete mode 100644 test/fixtures/wpt/storage/quotachange-in-detached-iframe.tentative.https.html create mode 100644 test/fixtures/wpt/xhr/formdata/submitter-coordinate-value.html diff --git a/test/fixtures/wpt/eventsource/META.yml b/test/fixtures/wpt/eventsource/META.yml index 437da600931..c0756cf85af 100644 --- a/test/fixtures/wpt/eventsource/META.yml +++ b/test/fixtures/wpt/eventsource/META.yml @@ -3,3 +3,4 @@ suggested_reviewers: - odinho - Yaffle - annevk + - rexxars diff --git a/test/fixtures/wpt/fetch/fetch-later/quota.tentative.https.window.js b/test/fixtures/wpt/fetch/fetch-later/quota.tentative.https.window.js index 9d0ae4287df..400be405095 100644 --- a/test/fixtures/wpt/fetch/fetch-later/quota.tentative.https.window.js +++ b/test/fixtures/wpt/fetch/fetch-later/quota.tentative.https.window.js @@ -4,8 +4,9 @@ 'use strict'; -const kQuotaPerOrigin = 64 * 1024; // 64 kilobytes per spec. +const QUOTA_PER_ORIGIN = 64 * 1024; // 64 kilobytes per spec. const {ORIGIN, HTTPS_NOTSAMESITE_ORIGIN} = get_host_info(); +const TEST_ENDPOINT = '/fetch-later'; // Runs a test case that cover a single fetchLater() call with `body` in its // request payload. The call is not expected to throw any errors. @@ -13,8 +14,7 @@ function fetchLaterPostTest(body, description) { test(() => { const controller = new AbortController(); const result = fetchLater( - '/fetch-later', - {method: 'POST', signal: controller.signal, body: body}); + TEST_ENDPOINT, {method: 'POST', signal: controller.signal, body: body}); assert_false(result.activated); // Release quota taken by the pending request for subsequent tests. controller.abort(); @@ -30,19 +30,25 @@ for (const [dataType, skipCharset] of Object.entries( } // Test various size of payloads for the same origin. -for (const dataType in BeaconDataType) { - if (dataType !== BeaconDataType.FormData && - dataType !== BeaconDataType.URLSearchParams) { - // Skips FormData & URLSearchParams, as browser adds extra bytes to them - // in addition to the user-provided content. It is difficult to test a - // request right at the quota limit. - fetchLaterPostTest( - // Generates data that is exactly 64 kilobytes. - makeBeaconData(generatePayload(kQuotaPerOrigin), dataType), - `A single fetchLater() call takes up the per-origin quota for its ` + - `body of ${dataType}.`); - } -} + +// Test max possible size of payload. +// Length of absolute URL to the endpoint. +const POST_TEST_REQUEST_URL_SIZE = (ORIGIN + TEST_ENDPOINT).length; +// Total size of the request header. +const POST_TEST_REQUEST_HEADER_SIZE = 36; +// Runs this test only for String type beacon, as browser adds extra bytes to +// body for some other types (FormData & URLSearchParams), and the request +// header sizes varies for every other types. It is difficult to test a request +// right at the quota limit. +fetchLaterPostTest( + // Generates data that is exactly 64 kilobytes. + makeBeaconData( + generatePayload( + QUOTA_PER_ORIGIN - POST_TEST_REQUEST_URL_SIZE - + POST_TEST_REQUEST_HEADER_SIZE), + BeaconDataType.String), + `A single fetchLater() call takes up the per-origin quota for its ` + + `body of String.`); // Test empty payload. for (const dataType in BeaconDataType) { @@ -64,8 +70,8 @@ for (const dataType in BeaconDataType) { () => fetchLater('/fetch-later', { method: 'POST', // Generates data that exceeds 64 kilobytes. - body: - makeBeaconData(generatePayload(kQuotaPerOrigin + 1), dataType) + body: makeBeaconData( + generatePayload(QUOTA_PER_ORIGIN + 1), dataType) })); }, `A single fetchLater() call is not allowed to exceed per-origin quota ` + @@ -81,7 +87,7 @@ for (const dataType in BeaconDataType) { fetchLater('/fetch-later', { method: 'POST', signal: controller.signal, - body: makeBeaconData(generatePayload(kQuotaPerOrigin / 2), dataType) + body: makeBeaconData(generatePayload(QUOTA_PER_ORIGIN / 2), dataType) }); // Makes the 2nd call that sends half+1 of allowed quota. @@ -90,7 +96,7 @@ for (const dataType in BeaconDataType) { method: 'POST', signal: controller.signal, body: makeBeaconData( - generatePayload(kQuotaPerOrigin / 2 + 1), dataType) + generatePayload(QUOTA_PER_ORIGIN / 2 + 1), dataType) }); }); // Release quota taken by the pending requests for subsequent tests. @@ -109,7 +115,7 @@ for (const dataType in BeaconDataType) { fetchLater('/fetch-later', { method: 'POST', signal: controller.signal, - body: makeBeaconData(generatePayload(kQuotaPerOrigin / 2), dataType) + body: makeBeaconData(generatePayload(QUOTA_PER_ORIGIN / 2), dataType) }); // Makes the 2nd call that sends half+1 of allowed quota, but to a @@ -117,8 +123,8 @@ for (const dataType in BeaconDataType) { fetchLater(`${HTTPS_NOTSAMESITE_ORIGIN}/fetch-later`, { method: 'POST', signal: controller.signal, - body: - makeBeaconData(generatePayload(kQuotaPerOrigin / 2 + 1), dataType) + body: makeBeaconData( + generatePayload(QUOTA_PER_ORIGIN / 2 + 1), dataType) }); // Release quota taken by the pending requests for subsequent tests. controller.abort(); diff --git a/test/fixtures/wpt/interfaces/attribution-reporting-api.idl b/test/fixtures/wpt/interfaces/attribution-reporting-api.idl index ed4497b56ff..3fe24bd34a0 100644 --- a/test/fixtures/wpt/interfaces/attribution-reporting-api.idl +++ b/test/fixtures/wpt/interfaces/attribution-reporting-api.idl @@ -8,6 +8,7 @@ interface mixin HTMLAttributionSrcElementUtils { }; HTMLAnchorElement includes HTMLAttributionSrcElementUtils; +HTMLAreaElement includes HTMLAttributionSrcElementUtils; HTMLImageElement includes HTMLAttributionSrcElementUtils; HTMLScriptElement includes HTMLAttributionSrcElementUtils; diff --git a/test/fixtures/wpt/interfaces/compute-pressure.idl b/test/fixtures/wpt/interfaces/compute-pressure.idl index 77537feb106..92bcc6e55e7 100644 --- a/test/fixtures/wpt/interfaces/compute-pressure.idl +++ b/test/fixtures/wpt/interfaces/compute-pressure.idl @@ -3,7 +3,7 @@ // (https://github.com/w3c/webref) // Source: Compute Pressure Level 1 (https://w3c.github.io/compute-pressure/) -enum PressureSource { "thermals", "cpu" }; +enum PressureSource { "cpu" }; enum PressureState { "nominal", "fair", "serious", "critical" }; diff --git a/test/fixtures/wpt/interfaces/fedcm.idl b/test/fixtures/wpt/interfaces/fedcm.idl index ba99f1174c8..16b5b2faf10 100644 --- a/test/fixtures/wpt/interfaces/fedcm.idl +++ b/test/fixtures/wpt/interfaces/fedcm.idl @@ -29,9 +29,15 @@ enum IdentityCredentialRequestOptionsContext { "continue" }; +enum IdentityCredentialRequestOptionsMode { + "active", + "passive" +}; + dictionary IdentityCredentialRequestOptions { required sequence providers; IdentityCredentialRequestOptionsContext context = "signin"; + IdentityCredentialRequestOptionsMode mode = "passive"; }; dictionary IdentityProviderConfig { @@ -43,10 +49,13 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig { USVString nonce; DOMString loginHint; DOMString domainHint; + any params; }; dictionary IdentityProviderWellKnown { - required sequence provider_urls; + sequence provider_urls; + USVString accounts_endpoint; + USVString login_url; }; dictionary IdentityProviderIcon { @@ -84,8 +93,9 @@ dictionary IdentityProviderAccountList { sequence accounts; }; -dictionary IdentityProviderToken { - required USVString token; +dictionary IdentityAssertionResponse { + USVString token; + USVString continue_on; }; dictionary IdentityProviderClientMetadata { @@ -100,7 +110,12 @@ dictionary IdentityUserInfo { USVString picture; }; +dictionary IdentityResolveOptions { + USVString accountId; +}; + [Exposed=Window, SecureContext] interface IdentityProvider { static undefined close(); + static undefined resolve(DOMString token, optional IdentityResolveOptions options = {}); static Promise> getUserInfo(IdentityProviderConfig config); }; diff --git a/test/fixtures/wpt/interfaces/fenced-frame.idl b/test/fixtures/wpt/interfaces/fenced-frame.idl index 8c5fa31bea8..b21ba8f99d2 100644 --- a/test/fixtures/wpt/interfaces/fenced-frame.idl +++ b/test/fixtures/wpt/interfaces/fenced-frame.idl @@ -74,9 +74,15 @@ interface Fence { undefined reportEvent(optional ReportEventType event = {}); undefined setReportEventDataForAutomaticBeacons(optional FenceEvent event = {}); sequence getNestedConfigs(); + Promise disableUntrustedNetwork(); + undefined notifyEvent(Event event); }; partial interface Window { // Collection of fenced frame APIs readonly attribute Fence? fence; }; + +partial interface mixin GlobalEventHandlers { + attribute EventHandler onfencedtreeclick; +}; diff --git a/test/fixtures/wpt/interfaces/html.idl b/test/fixtures/wpt/interfaces/html.idl index 25e1f8a4ca0..d4f8b9a7680 100644 --- a/test/fixtures/wpt/interfaces/html.idl +++ b/test/fixtures/wpt/interfaces/html.idl @@ -133,12 +133,20 @@ interface HTMLElement : Element { ElementInternals attachInternals(); // The popover API - undefined showPopover(); + undefined showPopover(optional ShowPopoverOptions options = {}); undefined hidePopover(); - boolean togglePopover(optional boolean force); + boolean togglePopover(optional (TogglePopoverOptions or boolean) options = {}); [CEReactions] attribute DOMString? popover; }; +dictionary ShowPopoverOptions { + HTMLElement source; +}; + +dictionary TogglePopoverOptions : ShowPopoverOptions { + boolean force; +}; + HTMLElement includes GlobalEventHandlers; HTMLElement includes ElementContentEditable; HTMLElement includes HTMLOrSVGElement; @@ -881,10 +889,12 @@ interface HTMLInputElement : HTMLElement { [HTMLConstructor] constructor(); [CEReactions] attribute DOMString accept; + [CEReactions] attribute boolean alpha; [CEReactions] attribute DOMString alt; [CEReactions] attribute DOMString autocomplete; [CEReactions] attribute boolean defaultChecked; attribute boolean checked; + [CEReactions] attribute DOMString colorSpace; [CEReactions] attribute DOMString dirName; [CEReactions] attribute boolean disabled; readonly attribute HTMLFormElement? form; @@ -2510,6 +2520,11 @@ interface MessageChannel { readonly attribute MessagePort port2; }; +interface mixin MessageEventTarget { + attribute EventHandler onmessage; + attribute EventHandler onmessageerror; +}; + [Exposed=(Window,Worker,AudioWorklet), Transferable] interface MessagePort : EventTarget { undefined postMessage(any message, sequence transfer); @@ -2518,11 +2533,11 @@ interface MessagePort : EventTarget { undefined close(); // event handlers - attribute EventHandler onmessage; - attribute EventHandler onmessageerror; attribute EventHandler onclose; }; +MessagePort includes MessageEventTarget; + dictionary StructuredSerializeOptions { sequence transfer = []; }; @@ -2561,11 +2576,10 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope { undefined postMessage(any message, optional StructuredSerializeOptions options = {}); undefined close(); - - attribute EventHandler onmessage; - attribute EventHandler onmessageerror; }; +DedicatedWorkerGlobalScope includes MessageEventTarget; + [Global=(Worker,SharedWorker),Exposed=SharedWorker] interface SharedWorkerGlobalScope : WorkerGlobalScope { [Replaceable] readonly attribute DOMString name; @@ -2587,8 +2601,6 @@ interface Worker : EventTarget { undefined postMessage(any message, sequence transfer); undefined postMessage(any message, optional StructuredSerializeOptions options = {}); - attribute EventHandler onmessage; - attribute EventHandler onmessageerror; }; dictionary WorkerOptions { @@ -2600,6 +2612,7 @@ dictionary WorkerOptions { enum WorkerType { "classic", "module" }; Worker includes AbstractWorker; +Worker includes MessageEventTarget; [Exposed=Window] interface SharedWorker : EventTarget { diff --git a/test/fixtures/wpt/interfaces/invokers.tentative.idl b/test/fixtures/wpt/interfaces/invokers.tentative.idl index 4724d7deb08..046a365939c 100644 --- a/test/fixtures/wpt/interfaces/invokers.tentative.idl +++ b/test/fixtures/wpt/interfaces/invokers.tentative.idl @@ -1,15 +1,15 @@ -interface mixin InvokerElement { - [CEReactions,Reflect=invoketarget] attribute Element? commandForElement; - [CEReactions,Reflect=invokeaction] attribute DOMString command; +interface mixin CommandElement { + [CEReactions,Reflect=commandfor] attribute Element? commandForElement; + [CEReactions,Reflect=command] attribute DOMString command; }; interface CommandEvent : Event { constructor(DOMString type, optional CommandEventInit eventInitDict = {}); - readonly attribute Element? invoker; + readonly attribute Element? source; readonly attribute DOMString command; }; dictionary CommandEventInit : EventInit { - Element? invoker = null; + Element? source = null; DOMString command = ""; }; diff --git a/test/fixtures/wpt/interfaces/long-animation-frames.idl b/test/fixtures/wpt/interfaces/long-animation-frames.idl index 79a42ca8f0a..de0d7c9a66a 100644 --- a/test/fixtures/wpt/interfaces/long-animation-frames.idl +++ b/test/fixtures/wpt/interfaces/long-animation-frames.idl @@ -19,6 +19,8 @@ interface PerformanceLongAnimationFrameTiming : PerformanceEntry { [Default] object toJSON(); }; +PerformanceLongAnimationFrameTiming includes PaintTimingMixin; + enum ScriptInvokerType { "classic-script", "module-script", diff --git a/test/fixtures/wpt/interfaces/mediasession.idl b/test/fixtures/wpt/interfaces/mediasession.idl index 5c6942be5a0..9c050b0efdf 100644 --- a/test/fixtures/wpt/interfaces/mediasession.idl +++ b/test/fixtures/wpt/interfaces/mediasession.idl @@ -59,7 +59,7 @@ interface MediaMetadata { attribute DOMString title; attribute DOMString artist; attribute DOMString album; - attribute FrozenArray artwork; + attribute FrozenArray artwork; [SameObject] readonly attribute FrozenArray chapterInfo; }; diff --git a/test/fixtures/wpt/interfaces/paint-timing.idl b/test/fixtures/wpt/interfaces/paint-timing.idl index 396f461e94c..fbf91858571 100644 --- a/test/fixtures/wpt/interfaces/paint-timing.idl +++ b/test/fixtures/wpt/interfaces/paint-timing.idl @@ -3,5 +3,12 @@ // (https://github.com/w3c/webref) // Source: Paint Timing (https://w3c.github.io/paint-timing/) +[Exposed=Window] +interface mixin PaintTimingMixin { + readonly attribute DOMHighResTimeStamp paintTime; + readonly attribute DOMHighResTimeStamp? presentationTime; +}; + [Exposed=Window] interface PerformancePaintTiming : PerformanceEntry {}; +PerformancePaintTiming includes PaintTimingMixin; diff --git a/test/fixtures/wpt/interfaces/private-aggregation-api.idl b/test/fixtures/wpt/interfaces/private-aggregation-api.idl index cee17c63f04..c89a4687abb 100644 --- a/test/fixtures/wpt/interfaces/private-aggregation-api.idl +++ b/test/fixtures/wpt/interfaces/private-aggregation-api.idl @@ -19,55 +19,3 @@ dictionary PAHistogramContribution { dictionary PADebugModeOptions { required bigint debugKey; }; - -partial interface InterestGroupScriptRunnerGlobalScope { - readonly attribute PrivateAggregation privateAggregation; -}; - -dictionary PASignalValue { - required DOMString baseValue; - double scale; - (bigint or long) offset; -}; - -dictionary PAExtendedHistogramContribution { - required (PASignalValue or bigint) bucket; - required (PASignalValue or long) value; - bigint filteringId = 0; -}; - -[Exposed=InterestGroupScriptRunnerGlobalScope, SecureContext] -partial interface PrivateAggregation { - undefined contributeToHistogramOnEvent( - DOMString event, PAExtendedHistogramContribution contribution); -}; - -dictionary AuctionReportBuyersConfig { - required bigint bucket; - required double scale; -}; - -dictionary AuctionReportBuyerDebugModeConfig { - boolean enabled = false; - - // Must only be provided if `enabled` is true. - bigint? debugKey; -}; - -partial dictionary AuctionAdConfig { - sequence auctionReportBuyerKeys; - record auctionReportBuyers; - AuctionReportBuyerDebugModeConfig auctionReportBuyerDebugModeConfig; -}; - -dictionary ProtectedAudiencePrivateAggregationConfig { - USVString aggregationCoordinatorOrigin; -}; - -partial dictionary AuctionAdConfig { - ProtectedAudiencePrivateAggregationConfig privateAggregationConfig; -}; - -partial dictionary AuctionAdInterestGroup { - ProtectedAudiencePrivateAggregationConfig privateAggregationConfig; -}; diff --git a/test/fixtures/wpt/interfaces/resource-timing.idl b/test/fixtures/wpt/interfaces/resource-timing.idl index 33fed05b756..66f2841d744 100644 --- a/test/fixtures/wpt/interfaces/resource-timing.idl +++ b/test/fixtures/wpt/interfaces/resource-timing.idl @@ -18,6 +18,7 @@ interface PerformanceResourceTiming : PerformanceEntry { readonly attribute DOMHighResTimeStamp connectEnd; readonly attribute DOMHighResTimeStamp secureConnectionStart; readonly attribute DOMHighResTimeStamp requestStart; + readonly attribute DOMHighResTimeStamp finalResponseHeadersStart; readonly attribute DOMHighResTimeStamp firstInterimResponseStart; readonly attribute DOMHighResTimeStamp responseStart; readonly attribute DOMHighResTimeStamp responseEnd; diff --git a/test/fixtures/wpt/interfaces/shared-storage.idl b/test/fixtures/wpt/interfaces/shared-storage.idl index 85906bedbcf..741b86a31c8 100644 --- a/test/fixtures/wpt/interfaces/shared-storage.idl +++ b/test/fixtures/wpt/interfaces/shared-storage.idl @@ -5,8 +5,6 @@ typedef (USVString or FencedFrameConfig) SharedStorageResponse; -enum SharedStorageDataOrigin { "context-origin", "script-origin" }; - [Exposed=(Window)] interface SharedStorageWorklet : Worklet { Promise selectURL(DOMString name, @@ -25,6 +23,8 @@ interface SharedStorageWorkletGlobalScope : WorkletGlobalScope { readonly attribute SharedStorage sharedStorage; readonly attribute PrivateAggregation privateAggregation; + + Promise> interestGroups(); }; dictionary SharedStorageUrlWithMetadata { @@ -93,7 +93,7 @@ dictionary SharedStorageRunOperationMethodOptions { }; dictionary SharedStorageWorkletOptions : WorkletOptions { - SharedStorageDataOrigin dataOrigin = "context-origin"; + USVString dataOrigin = "context-origin"; }; interface mixin HTMLSharedStorageWritableElementUtils { diff --git a/test/fixtures/wpt/interfaces/turtledove.idl b/test/fixtures/wpt/interfaces/turtledove.idl index ff48d311914..c416760d595 100644 --- a/test/fixtures/wpt/interfaces/turtledove.idl +++ b/test/fixtures/wpt/interfaces/turtledove.idl @@ -15,6 +15,7 @@ dictionary AuctionAd { USVString buyerReportingId; USVString buyerAndSellerReportingId; + sequence selectableBuyerAndSellerReportingIds; sequence allowedReportingOrigins; DOMString adRenderId; }; @@ -47,11 +48,16 @@ dictionary GenerateBidInterestGroup { record> sizeGroups; }; +dictionary ProtectedAudiencePrivateAggregationConfig { + USVString aggregationCoordinatorOrigin; +}; + dictionary AuctionAdInterestGroup : GenerateBidInterestGroup { double priority = 0.0; record prioritySignalsOverrides; required double lifetimeMs; DOMString additionalBidKey; + ProtectedAudiencePrivateAggregationConfig privateAggregationConfig; }; [SecureContext] @@ -76,6 +82,18 @@ partial interface Navigator { readonly attribute boolean deprecatedRunAdAuctionEnforcesKAnonymity; }; +dictionary AuctionReportBuyersConfig { + required bigint bucket; + required double scale; +}; + +dictionary AuctionReportBuyerDebugModeConfig { + boolean enabled = false; + + // Must only be provided if `enabled` is true. + bigint? debugKey; +}; + dictionary AuctionRealTimeReportingConfig { required DOMString type; }; @@ -89,21 +107,27 @@ dictionary AuctionAdConfig { sequence interestGroupBuyers; Promise auctionSignals; Promise sellerSignals; - Promise directFromSellerSignalsHeaderAdSlot; - Promise> deprecatedRenderURLReplacements; + Promise directFromSellerSignalsHeaderAdSlot; + Promise?> deprecatedRenderURLReplacements; unsigned long long sellerTimeout; unsigned short sellerExperimentGroupId; - Promise> perBuyerSignals; - Promise> perBuyerTimeouts; - Promise> perBuyerCumulativeTimeouts; + Promise?> perBuyerSignals; + Promise?> perBuyerTimeouts; + Promise?> perBuyerCumulativeTimeouts; unsigned long long reportingTimeout; USVString sellerCurrency; - Promise> perBuyerCurrencies; + Promise?> perBuyerCurrencies; record perBuyerMultiBidLimits; record perBuyerGroupLimits; record perBuyerExperimentGroupIds; record> perBuyerPrioritySignals; + + sequence auctionReportBuyerKeys; + record auctionReportBuyers; + AuctionReportBuyerDebugModeConfig auctionReportBuyerDebugModeConfig; sequence requiredSellerCapabilities; + ProtectedAudiencePrivateAggregationConfig privateAggregationConfig; + record requestedSize; sequence> allSlotsRequestedSizes; Promise additionalBids; @@ -144,6 +168,18 @@ dictionary AdAuctionDataBuyerConfig { unsigned long targetSize; }; +dictionary StorageInterestGroup : AuctionAdInterestGroup { + unsigned long long joinCount; + unsigned long long bidCount; + sequence prevWinsMs; + USVString joiningOrigin; + long long timeSinceGroupJoinedMs; + long long lifetimeRemainingMs; + long long timeSinceLastUpdateMs; + long long timeUntilNextUpdateMs; + unsigned long long estimatedSize; +}; + [SecureContext] partial interface Navigator { Promise createAuctionNonce(); @@ -151,6 +187,25 @@ partial interface Navigator { [Exposed=InterestGroupScriptRunnerGlobalScope] interface InterestGroupScriptRunnerGlobalScope { + readonly attribute PrivateAggregation? privateAggregation; +}; + +dictionary PASignalValue { + required DOMString baseValue; + double scale; + (bigint or long) offset; +}; + +dictionary PAExtendedHistogramContribution { + required (PASignalValue or bigint) bucket; + required (PASignalValue or long) value; + bigint filteringId = 0; +}; + +[Exposed=InterestGroupScriptRunnerGlobalScope] +partial interface PrivateAggregation { + undefined contributeToHistogramOnEvent( + DOMString event, PAExtendedHistogramContribution contribution); }; [Exposed=InterestGroupBiddingAndScoringScriptRunnerGlobalScope] @@ -198,6 +253,7 @@ dictionary GenerateBidOutput { DOMString bidCurrency; (DOMString or AdRender) render; any ad; + USVString selectedBuyerAndSellerReportingId; sequence<(DOMString or AdRender)> adComponents; double adCost; unrestricted double modelingSignals; @@ -294,6 +350,7 @@ dictionary ReportingBrowserSignals { USVString componentSeller; USVString buyerAndSellerReportingId; + USVString selectedBuyerAndSellerReportingId; }; dictionary ReportResultBrowserSignals : ReportingBrowserSignals { diff --git a/test/fixtures/wpt/interfaces/user-timing.idl b/test/fixtures/wpt/interfaces/user-timing.idl index 28ee8aac2b1..fc6d3082258 100644 --- a/test/fixtures/wpt/interfaces/user-timing.idl +++ b/test/fixtures/wpt/interfaces/user-timing.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: User Timing Level 3 (https://w3c.github.io/user-timing/) +// Source: User Timing (https://w3c.github.io/user-timing/) dictionary PerformanceMarkOptions { any detail; diff --git a/test/fixtures/wpt/interfaces/web-animations-2.idl b/test/fixtures/wpt/interfaces/web-animations-2.idl index 4c3af535149..97a0d3f6c6b 100644 --- a/test/fixtures/wpt/interfaces/web-animations-2.idl +++ b/test/fixtures/wpt/interfaces/web-animations-2.idl @@ -14,7 +14,7 @@ partial interface AnimationTimeline { partial interface Animation { attribute CSSNumberish? startTime; attribute CSSNumberish? currentTime; - readonly attribute double? progress; + readonly attribute double? overallProgress; }; [Exposed=Window] diff --git a/test/fixtures/wpt/interfaces/web-animations.idl b/test/fixtures/wpt/interfaces/web-animations.idl index 1bc82fab119..c36588af478 100644 --- a/test/fixtures/wpt/interfaces/web-animations.idl +++ b/test/fixtures/wpt/interfaces/web-animations.idl @@ -136,6 +136,7 @@ dictionary KeyframeAnimationOptions : KeyframeEffectOptions { dictionary GetAnimationsOptions { boolean subtree = false; + CSSOMString? pseudoElement = null; }; partial interface Document { diff --git a/test/fixtures/wpt/interfaces/webaudio.idl b/test/fixtures/wpt/interfaces/webaudio.idl index 74aab7e2362..d14eb96820f 100644 --- a/test/fixtures/wpt/interfaces/webaudio.idl +++ b/test/fixtures/wpt/interfaces/webaudio.idl @@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: Web Audio API (https://webaudio.github.io/web-audio-api/) +// Source: Web Audio API 1.1 (https://webaudio.github.io/web-audio-api/) enum AudioContextState { "suspended", @@ -33,8 +33,8 @@ interface BaseAudioContext : EventTarget { AnalyserNode createAnalyser (); BiquadFilterNode createBiquadFilter (); AudioBuffer createBuffer (unsigned long numberOfChannels, - unsigned long length, - float sampleRate); + unsigned long length, + float sampleRate); AudioBufferSourceNode createBufferSource (); ChannelMergerNode createChannelMerger (optional unsigned long numberOfInputs = 6); ChannelSplitterNode createChannelSplitter ( @@ -45,12 +45,12 @@ interface BaseAudioContext : EventTarget { DynamicsCompressorNode createDynamicsCompressor (); GainNode createGain (); IIRFilterNode createIIRFilter (sequence feedforward, - sequence feedback); + sequence feedback); OscillatorNode createOscillator (); PannerNode createPanner (); PeriodicWave createPeriodicWave (sequence real, - sequence imag, - optional PeriodicWaveConstraints constraints = {}); + sequence imag, + optional PeriodicWaveConstraints constraints = {}); ScriptProcessorNode createScriptProcessor( optional unsigned long bufferSize = 0, optional unsigned long numberOfInputChannels = 2, diff --git a/test/fixtures/wpt/interfaces/webauthn.idl b/test/fixtures/wpt/interfaces/webauthn.idl index 2b855144650..46e2418281e 100644 --- a/test/fixtures/wpt/interfaces/webauthn.idl +++ b/test/fixtures/wpt/interfaces/webauthn.idl @@ -330,7 +330,6 @@ partial dictionary AuthenticationExtensionsClientInputs { dictionary CredentialPropertiesOutput { boolean rk; - DOMString authenticatorDisplayName; }; partial dictionary AuthenticationExtensionsClientOutputs { diff --git a/test/fixtures/wpt/interfaces/webcodecs.idl b/test/fixtures/wpt/interfaces/webcodecs.idl index 52731257f1f..5cd4adf9348 100644 --- a/test/fixtures/wpt/interfaces/webcodecs.idl +++ b/test/fixtures/wpt/interfaces/webcodecs.idl @@ -317,6 +317,8 @@ interface VideoFrame { readonly attribute unsigned long codedHeight; readonly attribute DOMRectReadOnly? codedRect; readonly attribute DOMRectReadOnly? visibleRect; + readonly attribute double rotation; + readonly attribute boolean flip; readonly attribute unsigned long displayWidth; readonly attribute unsigned long displayHeight; readonly attribute unsigned long long? duration; // microseconds @@ -340,10 +342,13 @@ dictionary VideoFrameInit { AlphaOption alpha = "keep"; // Default matches image. May be used to efficiently crop. Will trigger - // new computation of displayWidth and displayHeight using image’s pixel + // new computation of displayWidth and displayHeight using image's pixel // aspect ratio unless an explicit displayWidth and displayHeight are given. DOMRectInit visibleRect; + double rotation = 0; + boolean flip = false; + // Default matches image unless visibleRect is provided. [EnforceRange] unsigned long displayWidth; [EnforceRange] unsigned long displayHeight; @@ -364,6 +369,9 @@ dictionary VideoFrameBufferInit { // Default visible rect is coded size positioned at (0,0) DOMRectInit visibleRect; + double rotation = 0; + boolean flip = false; + // Default display dimensions match visibleRect. [EnforceRange] unsigned long displayWidth; [EnforceRange] unsigned long displayHeight; diff --git a/test/fixtures/wpt/interfaces/webgpu.idl b/test/fixtures/wpt/interfaces/webgpu.idl index 421685c7a8f..401d2ec69b5 100644 --- a/test/fixtures/wpt/interfaces/webgpu.idl +++ b/test/fixtures/wpt/interfaces/webgpu.idl @@ -78,9 +78,10 @@ interface GPU { }; dictionary GPURequestAdapterOptions { - DOMString featureLevel; + DOMString featureLevel = "core"; GPUPowerPreference powerPreference; boolean forceFallbackAdapter = false; + boolean xrCompatible = false; }; enum GPUPowerPreference { @@ -119,6 +120,7 @@ enum GPUFeatureName { "rg11b10ufloat-renderable", "bgra8unorm-storage", "float32-filterable", + "float32-blendable", "clip-distances", "dual-source-blending", }; @@ -127,6 +129,7 @@ enum GPUFeatureName { interface GPUDevice : EventTarget { [SameObject] readonly attribute GPUSupportedFeatures features; [SameObject] readonly attribute GPUSupportedLimits limits; + [SameObject] readonly attribute GPUAdapterInfo adapterInfo; [SameObject] readonly attribute GPUQueue queue; @@ -569,7 +572,7 @@ GPUPipelineLayout includes GPUObjectBase; dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { - required sequence bindGroupLayouts; + required sequence bindGroupLayouts; }; [Exposed=(Window, Worker), SecureContext] @@ -809,22 +812,31 @@ enum GPUIndexFormat { }; enum GPUVertexFormat { + "uint8", "uint8x2", "uint8x4", + "sint8", "sint8x2", "sint8x4", + "unorm8", "unorm8x2", "unorm8x4", + "snorm8", "snorm8x2", "snorm8x4", + "uint16", "uint16x2", "uint16x4", + "sint16", "sint16x2", "sint16x4", + "unorm16", "unorm16x2", "unorm16x4", + "snorm16", "snorm16x2", "snorm16x4", + "float16", "float16x2", "float16x4", "float32", @@ -840,6 +852,7 @@ enum GPUVertexFormat { "sint32x3", "sint32x4", "unorm10-10-10-2", + "unorm8x4-bgra", }; enum GPUVertexStepMode { @@ -865,26 +878,26 @@ dictionary GPUVertexAttribute { required GPUIndex32 shaderLocation; }; -dictionary GPUImageDataLayout { +dictionary GPUTexelCopyBufferLayout { GPUSize64 offset = 0; GPUSize32 bytesPerRow; GPUSize32 rowsPerImage; }; -dictionary GPUImageCopyBuffer - : GPUImageDataLayout { +dictionary GPUTexelCopyBufferInfo + : GPUTexelCopyBufferLayout { required GPUBuffer buffer; }; -dictionary GPUImageCopyTexture { +dictionary GPUTexelCopyTextureInfo { required GPUTexture texture; GPUIntegerCoordinate mipLevel = 0; GPUOrigin3D origin = {}; GPUTextureAspect aspect = "all"; }; -dictionary GPUImageCopyTextureTagged - : GPUImageCopyTexture { +dictionary GPUCopyExternalImageDestInfo + : GPUTexelCopyTextureInfo { PredefinedColorSpace colorSpace = "srgb"; boolean premultipliedAlpha = false; }; @@ -895,10 +908,10 @@ typedef (ImageBitmap or HTMLVideoElement or VideoFrame or HTMLCanvasElement or - OffscreenCanvas) GPUImageCopyExternalImageSource; + OffscreenCanvas) GPUCopyExternalImageSource; -dictionary GPUImageCopyExternalImage { - required GPUImageCopyExternalImageSource source; +dictionary GPUCopyExternalImageSourceInfo { + required GPUCopyExternalImageSource source; GPUOrigin2D origin = {}; boolean flipY = false; }; @@ -928,18 +941,18 @@ interface GPUCommandEncoder { GPUSize64 size); undefined copyBufferToTexture( - GPUImageCopyBuffer source, - GPUImageCopyTexture destination, + GPUTexelCopyBufferInfo source, + GPUTexelCopyTextureInfo destination, GPUExtent3D copySize); undefined copyTextureToBuffer( - GPUImageCopyTexture source, - GPUImageCopyBuffer destination, + GPUTexelCopyTextureInfo source, + GPUTexelCopyBufferInfo destination, GPUExtent3D copySize); undefined copyTextureToTexture( - GPUImageCopyTexture source, - GPUImageCopyTexture destination, + GPUTexelCopyTextureInfo source, + GPUTexelCopyTextureInfo destination, GPUExtent3D copySize); undefined clearBuffer( @@ -1144,14 +1157,14 @@ interface GPUQueue { optional GPUSize64 size); undefined writeTexture( - GPUImageCopyTexture destination, + GPUTexelCopyTextureInfo destination, AllowSharedBufferSource data, - GPUImageDataLayout dataLayout, + GPUTexelCopyBufferLayout dataLayout, GPUExtent3D size); undefined copyExternalImageToTexture( - GPUImageCopyExternalImage source, - GPUImageCopyTextureTagged destination, + GPUCopyExternalImageSourceInfo source, + GPUCopyExternalImageDestInfo destination, GPUExtent3D copySize); }; GPUQueue includes GPUObjectBase; @@ -1274,7 +1287,6 @@ dictionary GPUUncapturedErrorEventInit : EventInit { }; partial interface GPUDevice { - [Exposed=(Window, Worker)] attribute EventHandler onuncapturederror; }; diff --git a/test/fixtures/wpt/interfaces/webnn.idl b/test/fixtures/wpt/interfaces/webnn.idl index 8329e7d2b33..9f17b6ceb71 100644 --- a/test/fixtures/wpt/interfaces/webnn.idl +++ b/test/fixtures/wpt/interfaces/webnn.idl @@ -33,6 +33,7 @@ interface ML { }; typedef record MLNamedArrayBufferViews; +typedef record MLNamedTensors; dictionary MLComputeResult { MLNamedArrayBufferViews inputs; @@ -41,8 +42,17 @@ dictionary MLComputeResult { [SecureContext, Exposed=(Window, DedicatedWorker)] interface MLContext { + // ISSUE(791): compute() will soon be removed in favor of dispatch(). Promise compute( MLGraph graph, MLNamedArrayBufferViews inputs, MLNamedArrayBufferViews outputs); + undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs); + + Promise createTensor(MLTensorDescriptor descriptor); + + Promise readTensor(MLTensor tensor); + Promise readTensor(MLTensor tensor, AllowSharedBufferSource outputData); + + undefined writeTensor(MLTensor tensor, AllowSharedBufferSource inputData); MLOpSupportLimits opSupportLimits(); }; @@ -95,8 +105,8 @@ dictionary MLOperandDescriptor { [SecureContext, Exposed=(Window, DedicatedWorker)] interface MLOperand { - MLOperandDataType dataType(); - sequence shape(); + readonly attribute MLOperandDataType dataType; + readonly attribute FrozenArray shape; }; dictionary MLOperatorOptions { @@ -105,6 +115,21 @@ dictionary MLOperatorOptions { typedef (bigint or unrestricted double) MLNumber; +dictionary MLTensorDescriptor : MLOperandDescriptor { + boolean readable = false; + boolean writable = false; +}; + +[SecureContext, Exposed=(Window, DedicatedWorker)] +interface MLTensor { + readonly attribute MLOperandDataType dataType; + readonly attribute FrozenArray shape; + readonly attribute boolean readable; + readonly attribute boolean writable; + + undefined destroy(); +}; + typedef record MLNamedOperands; [SecureContext, Exposed=(Window, DedicatedWorker)] @@ -872,7 +897,7 @@ dictionary MLSplitSupportLimits { }; partial dictionary MLOpSupportLimits { - MLSingleInputSupportLimits split; + MLSplitSupportLimits split; }; partial interface MLGraphBuilder { diff --git a/test/fixtures/wpt/interfaces/webrtc-stats.idl b/test/fixtures/wpt/interfaces/webrtc-stats.idl index 0b2e956a207..ac820c7c9dc 100644 --- a/test/fixtures/wpt/interfaces/webrtc-stats.idl +++ b/test/fixtures/wpt/interfaces/webrtc-stats.idl @@ -96,6 +96,9 @@ dictionary RTCInboundRtpStreamStats : RTCReceivedRtpStreamStats { unsigned long long retransmittedBytesReceived; unsigned long rtxSsrc; unsigned long fecSsrc; + double totalCorruptionProbability; + double totalSquaredCorruptionProbability; + unsigned long long corruptionMeasurements; }; dictionary RTCRemoteInboundRtpStreamStats : RTCReceivedRtpStreamStats { diff --git a/test/fixtures/wpt/interfaces/webtransport.idl b/test/fixtures/wpt/interfaces/webtransport.idl index 6e9d1036736..24fe5b7e61b 100644 --- a/test/fixtures/wpt/interfaces/webtransport.idl +++ b/test/fixtures/wpt/interfaces/webtransport.idl @@ -96,7 +96,8 @@ dictionary WebTransportConnectionStats { required DOMHighResTimeStamp rttVariation; required DOMHighResTimeStamp minRtt; required WebTransportDatagramStats datagrams; - required unsigned long long? estimatedSendRate; + unsigned long long? estimatedSendRate = null; + boolean atSendCapacity = false; }; dictionary WebTransportDatagramStats { diff --git a/test/fixtures/wpt/interfaces/webusb.idl b/test/fixtures/wpt/interfaces/webusb.idl index 3b362d2351d..d6484db3e88 100644 --- a/test/fixtures/wpt/interfaces/webusb.idl +++ b/test/fixtures/wpt/interfaces/webusb.idl @@ -40,7 +40,7 @@ dictionary USBConnectionEventInit : EventInit { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBConnectionEvent : Event { @@ -55,7 +55,7 @@ enum USBTransferStatus { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBInTransferResult { @@ -65,7 +65,7 @@ interface USBInTransferResult { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBOutTransferResult { @@ -75,7 +75,7 @@ interface USBOutTransferResult { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBIsochronousInTransferPacket { @@ -85,7 +85,7 @@ interface USBIsochronousInTransferPacket { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBIsochronousInTransferResult { @@ -95,7 +95,7 @@ interface USBIsochronousInTransferResult { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBIsochronousOutTransferPacket { @@ -105,7 +105,7 @@ interface USBIsochronousOutTransferPacket { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBIsochronousOutTransferResult { @@ -113,7 +113,7 @@ interface USBIsochronousOutTransferResult { readonly attribute FrozenArray packets; }; -[Exposed=(DedicatedWorker,SharedWorker,Window), SecureContext] +[Exposed=(Worker,Window), SecureContext] interface USBDevice { readonly attribute octet usbVersionMajor; readonly attribute octet usbVersionMinor; @@ -171,7 +171,7 @@ dictionary USBControlTransferParameters { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBConfiguration { @@ -182,7 +182,7 @@ interface USBConfiguration { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBInterface { @@ -194,7 +194,7 @@ interface USBInterface { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBAlternateInterface { @@ -219,7 +219,7 @@ enum USBEndpointType { }; [ - Exposed=(DedicatedWorker,SharedWorker,Window), + Exposed=(Worker,Window), SecureContext ] interface USBEndpoint { @@ -252,7 +252,7 @@ dictionary USBPermissionStorage { sequence allowedDevices = []; }; -[Exposed=(DedicatedWorker,SharedWorker,Window)] +[Exposed=(Worker,Window)] interface USBPermissionResult : PermissionStatus { attribute FrozenArray devices; }; diff --git a/test/fixtures/wpt/interfaces/webxr.idl b/test/fixtures/wpt/interfaces/webxr.idl index 26a720aa888..dea448d7440 100644 --- a/test/fixtures/wpt/interfaces/webxr.idl +++ b/test/fixtures/wpt/interfaces/webxr.idl @@ -40,6 +40,7 @@ enum XRVisibilityState { readonly attribute Float32Array? supportedFrameRates; [SameObject] readonly attribute XRRenderState renderState; [SameObject] readonly attribute XRInputSourceArray inputSources; + [SameObject] readonly attribute XRInputSourceArray trackedSources; readonly attribute FrozenArray enabledFeatures; readonly attribute boolean isSystemKeyboardSupported; diff --git a/test/fixtures/wpt/resources/check-layout.js b/test/fixtures/wpt/resources/check-layout.js deleted file mode 100644 index 8634481497d..00000000000 --- a/test/fixtures/wpt/resources/check-layout.js +++ /dev/null @@ -1,245 +0,0 @@ -(function() { - -function insertAfter(nodeToAdd, referenceNode) -{ - if (referenceNode == document.body) { - document.body.appendChild(nodeToAdd); - return; - } - - if (referenceNode.nextSibling) - referenceNode.parentNode.insertBefore(nodeToAdd, referenceNode.nextSibling); - else - referenceNode.parentNode.appendChild(nodeToAdd); -} - -function positionedAncestor(node) -{ - var ancestor = node.parentNode; - while (getComputedStyle(ancestor).position == 'static') - ancestor = ancestor.parentNode; - return ancestor; -} - -function checkSubtreeExpectedValues(parent, failures) -{ - var checkedLayout = checkExpectedValues(parent, failures); - Array.prototype.forEach.call(parent.childNodes, function(node) { - checkedLayout |= checkSubtreeExpectedValues(node, failures); - }); - return checkedLayout; -} - -function checkAttribute(output, node, attribute) -{ - var result = node.getAttribute && node.getAttribute(attribute); - output.checked |= !!result; - return result; -} - -function checkExpectedValues(node, failures) -{ - var output = { checked: false }; - var expectedWidth = checkAttribute(output, node, "data-expected-width"); - if (expectedWidth) { - if (isNaN(expectedWidth) || Math.abs(node.offsetWidth - expectedWidth) >= 1) - failures.push("Expected " + expectedWidth + " for width, but got " + node.offsetWidth + ". "); - } - - var expectedHeight = checkAttribute(output, node, "data-expected-height"); - if (expectedHeight) { - if (isNaN(expectedHeight) || Math.abs(node.offsetHeight - expectedHeight) >= 1) - failures.push("Expected " + expectedHeight + " for height, but got " + node.offsetHeight + ". "); - } - - var expectedOffset = checkAttribute(output, node, "data-offset-x"); - if (expectedOffset) { - if (isNaN(expectedOffset) || Math.abs(node.offsetLeft - expectedOffset) >= 1) - failures.push("Expected " + expectedOffset + " for offsetLeft, but got " + node.offsetLeft + ". "); - } - - var expectedOffset = checkAttribute(output, node, "data-offset-y"); - if (expectedOffset) { - if (isNaN(expectedOffset) || Math.abs(node.offsetTop - expectedOffset) >= 1) - failures.push("Expected " + expectedOffset + " for offsetTop, but got " + node.offsetTop + ". "); - } - - var expectedOffset = checkAttribute(output, node, "data-positioned-offset-x"); - if (expectedOffset) { - var actualOffset = node.getBoundingClientRect().left - positionedAncestor(node).getBoundingClientRect().left; - if (isNaN(expectedOffset) || Math.abs(actualOffset - expectedOffset) >= 1) - failures.push("Expected " + expectedOffset + " for getBoundingClientRect().left offset, but got " + actualOffset + ". "); - } - - var expectedOffset = checkAttribute(output, node, "data-positioned-offset-y"); - if (expectedOffset) { - var actualOffset = node.getBoundingClientRect().top - positionedAncestor(node).getBoundingClientRect().top; - if (isNaN(expectedOffset) || Math.abs(actualOffset - expectedOffset) >= 1) - failures.push("Expected " + expectedOffset + " for getBoundingClientRect().top offset, but got " + actualOffset + ". "); - } - - var expectedWidth = checkAttribute(output, node, "data-expected-client-width"); - if (expectedWidth) { - if (isNaN(expectedWidth) || Math.abs(node.clientWidth - expectedWidth) >= 1) - failures.push("Expected " + expectedWidth + " for clientWidth, but got " + node.clientWidth + ". "); - } - - var expectedHeight = checkAttribute(output, node, "data-expected-client-height"); - if (expectedHeight) { - if (isNaN(expectedHeight) || Math.abs(node.clientHeight - expectedHeight) >= 1) - failures.push("Expected " + expectedHeight + " for clientHeight, but got " + node.clientHeight + ". "); - } - - var expectedWidth = checkAttribute(output, node, "data-expected-scroll-width"); - if (expectedWidth) { - if (isNaN(expectedWidth) || Math.abs(node.scrollWidth - expectedWidth) >= 1) - failures.push("Expected " + expectedWidth + " for scrollWidth, but got " + node.scrollWidth + ". "); - } - - var expectedHeight = checkAttribute(output, node, "data-expected-scroll-height"); - if (expectedHeight) { - if (isNaN(expectedHeight) || Math.abs(node.scrollHeight - expectedHeight) >= 1) - failures.push("Expected " + expectedHeight + " for scrollHeight, but got " + node.scrollHeight + ". "); - } - - var expectedOffset = checkAttribute(output, node, "data-total-x"); - if (expectedOffset) { - var totalLeft = node.clientLeft + node.offsetLeft; - if (isNaN(expectedOffset) || Math.abs(totalLeft - expectedOffset) >= 1) - failures.push("Expected " + expectedOffset + " for clientLeft+offsetLeft, but got " + totalLeft + ", clientLeft: " + node.clientLeft + ", offsetLeft: " + node.offsetLeft + ". "); - } - - var expectedOffset = checkAttribute(output, node, "data-total-y"); - if (expectedOffset) { - var totalTop = node.clientTop + node.offsetTop; - if (isNaN(expectedOffset) || Math.abs(totalTop - expectedOffset) >= 1) - failures.push("Expected " + expectedOffset + " for clientTop+offsetTop, but got " + totalTop + ", clientTop: " + node.clientTop + ", + offsetTop: " + node.offsetTop + ". "); - } - - var expectedDisplay = checkAttribute(output, node, "data-expected-display"); - if (expectedDisplay) { - var actualDisplay = getComputedStyle(node).display; - if (actualDisplay != expectedDisplay) - failures.push("Expected " + expectedDisplay + " for display, but got " + actualDisplay + ". "); - } - - var expectedPaddingTop = checkAttribute(output, node, "data-expected-padding-top"); - if (expectedPaddingTop) { - var actualPaddingTop = getComputedStyle(node).paddingTop; - // Trim the unit "px" from the output. - actualPaddingTop = actualPaddingTop.substring(0, actualPaddingTop.length - 2); - if (actualPaddingTop != expectedPaddingTop) - failures.push("Expected " + expectedPaddingTop + " for padding-top, but got " + actualPaddingTop + ". "); - } - - var expectedPaddingBottom = checkAttribute(output, node, "data-expected-padding-bottom"); - if (expectedPaddingBottom) { - var actualPaddingBottom = getComputedStyle(node).paddingBottom; - // Trim the unit "px" from the output. - actualPaddingBottom = actualPaddingBottom.substring(0, actualPaddingBottom.length - 2); - if (actualPaddingBottom != expectedPaddingBottom) - failures.push("Expected " + expectedPaddingBottom + " for padding-bottom, but got " + actualPaddingBottom + ". "); - } - - var expectedPaddingLeft = checkAttribute(output, node, "data-expected-padding-left"); - if (expectedPaddingLeft) { - var actualPaddingLeft = getComputedStyle(node).paddingLeft; - // Trim the unit "px" from the output. - actualPaddingLeft = actualPaddingLeft.substring(0, actualPaddingLeft.length - 2); - if (actualPaddingLeft != expectedPaddingLeft) - failures.push("Expected " + expectedPaddingLeft + " for padding-left, but got " + actualPaddingLeft + ". "); - } - - var expectedPaddingRight = checkAttribute(output, node, "data-expected-padding-right"); - if (expectedPaddingRight) { - var actualPaddingRight = getComputedStyle(node).paddingRight; - // Trim the unit "px" from the output. - actualPaddingRight = actualPaddingRight.substring(0, actualPaddingRight.length - 2); - if (actualPaddingRight != expectedPaddingRight) - failures.push("Expected " + expectedPaddingRight + " for padding-right, but got " + actualPaddingRight + ". "); - } - - var expectedMarginTop = checkAttribute(output, node, "data-expected-margin-top"); - if (expectedMarginTop) { - var actualMarginTop = getComputedStyle(node).marginTop; - // Trim the unit "px" from the output. - actualMarginTop = actualMarginTop.substring(0, actualMarginTop.length - 2); - if (actualMarginTop != expectedMarginTop) - failures.push("Expected " + expectedMarginTop + " for margin-top, but got " + actualMarginTop + ". "); - } - - var expectedMarginBottom = checkAttribute(output, node, "data-expected-margin-bottom"); - if (expectedMarginBottom) { - var actualMarginBottom = getComputedStyle(node).marginBottom; - // Trim the unit "px" from the output. - actualMarginBottom = actualMarginBottom.substring(0, actualMarginBottom.length - 2); - if (actualMarginBottom != expectedMarginBottom) - failures.push("Expected " + expectedMarginBottom + " for margin-bottom, but got " + actualMarginBottom + ". "); - } - - var expectedMarginLeft = checkAttribute(output, node, "data-expected-margin-left"); - if (expectedMarginLeft) { - var actualMarginLeft = getComputedStyle(node).marginLeft; - // Trim the unit "px" from the output. - actualMarginLeft = actualMarginLeft.substring(0, actualMarginLeft.length - 2); - if (actualMarginLeft != expectedMarginLeft) - failures.push("Expected " + expectedMarginLeft + " for margin-left, but got " + actualMarginLeft + ". "); - } - - var expectedMarginRight = checkAttribute(output, node, "data-expected-margin-right"); - if (expectedMarginRight) { - var actualMarginRight = getComputedStyle(node).marginRight; - // Trim the unit "px" from the output. - actualMarginRight = actualMarginRight.substring(0, actualMarginRight.length - 2); - if (actualMarginRight != expectedMarginRight) - failures.push("Expected " + expectedMarginRight + " for margin-right, but got " + actualMarginRight + ". "); - } - - return output.checked; -} - -window.checkLayout = function(selectorList, outputContainer) -{ - var result = true; - if (!selectorList) { - document.body.appendChild(document.createTextNode("You must provide a CSS selector of nodes to check.")); - return; - } - var nodes = document.querySelectorAll(selectorList); - nodes = Array.prototype.slice.call(nodes); - nodes.reverse(); - var checkedLayout = false; - Array.prototype.forEach.call(nodes, function(node) { - var failures = []; - checkedLayout |= checkExpectedValues(node.parentNode, failures); - checkedLayout |= checkSubtreeExpectedValues(node, failures); - - var container = node.parentNode.className == 'container' ? node.parentNode : node; - - var pre = document.createElement('pre'); - if (failures.length) { - pre.className = 'FAIL'; - result = false; - } - pre.appendChild(document.createTextNode(failures.length ? "FAIL:\n" + failures.join('\n') + '\n\n' + container.outerHTML : "PASS")); - - var referenceNode = container; - if (outputContainer) { - if (!outputContainer.lastChild) { - // Inserting a text node so we have something to insertAfter. - outputContainer.textContent = " "; - } - referenceNode = outputContainer.lastChild; - } - insertAfter(pre, referenceNode); - }); - - if (!checkedLayout) { - document.body.appendChild(document.createTextNode("FAIL: No valid data-* attributes found in selector list : " + selectorList)); - return false; - } - - return result; -} - -})(); diff --git a/test/fixtures/wpt/resources/idlharness-shadowrealm.js b/test/fixtures/wpt/resources/idlharness-shadowrealm.js deleted file mode 100644 index 9484ca6f512..00000000000 --- a/test/fixtures/wpt/resources/idlharness-shadowrealm.js +++ /dev/null @@ -1,61 +0,0 @@ -// TODO: it would be nice to support `idl_array.add_objects` -function fetch_text(url) { - return fetch(url).then(function (r) { - if (!r.ok) { - throw new Error("Error fetching " + url + "."); - } - return r.text(); - }); -} - -/** - * idl_test_shadowrealm is a promise_test wrapper that handles the fetching of the IDL, and - * running the code in a `ShadowRealm`, avoiding repetitive boilerplate. - * - * @see https://github.com/tc39/proposal-shadowrealm - * @param {String[]} srcs Spec name(s) for source idl files (fetched from - * /interfaces/{name}.idl). - * @param {String[]} deps Spec name(s) for dependency idl files (fetched - * from /interfaces/{name}.idl). Order is important - dependencies from - * each source will only be included if they're already know to be a - * dependency (i.e. have already been seen). - */ -function idl_test_shadowrealm(srcs, deps) { - promise_setup(async t => { - const realm = new ShadowRealm(); - // https://github.com/web-platform-tests/wpt/issues/31996 - realm.evaluate("globalThis.self = globalThis; undefined;"); - - realm.evaluate(` - globalThis.self.GLOBAL = { - isWindow: function() { return false; }, - isWorker: function() { return false; }, - isShadowRealm: function() { return true; }, - }; undefined; - `); - const specs = await Promise.all(srcs.concat(deps).map(spec => { - return fetch_text("/interfaces/" + spec + ".idl"); - })); - const idls = JSON.stringify(specs); - await new Promise( - realm.evaluate(`(resolve,reject) => { - (async () => { - await import("/resources/testharness.js"); - await import("/resources/WebIDLParser.js"); - await import("/resources/idlharness.js"); - const idls = ${idls}; - const idl_array = new IdlArray(); - for (let i = 0; i < ${srcs.length}; i++) { - idl_array.add_idls(idls[i]); - } - for (let i = ${srcs.length}; i < ${srcs.length + deps.length}; i++) { - idl_array.add_dependency_idls(idls[i]); - } - idl_array.test(); - })().then(resolve, (e) => reject(e.toString())); - }`) - ); - await fetch_tests_from_shadow_realm(realm); - }); -} -// vim: set expandtab shiftwidth=4 tabstop=4 foldmarker=@{,@} foldmethod=marker: diff --git a/test/fixtures/wpt/resources/idlharness.js b/test/fixtures/wpt/resources/idlharness.js index 4cf19234af2..d52ba9fd3c4 100644 --- a/test/fixtures/wpt/resources/idlharness.js +++ b/test/fixtures/wpt/resources/idlharness.js @@ -734,7 +734,7 @@ IdlArray.prototype.test = function() Object.getOwnPropertyNames(this.members).forEach(function(memberName) { var member = this.members[memberName]; - if (!(member instanceof IdlInterface)) { + if (!(member instanceof IdlInterface || member instanceof IdlNamespace)) { return; } @@ -1421,7 +1421,7 @@ IdlInterface.prototype.test = function() if (!this.untested) { subsetTestByKey(this.name, test, function() { - assert_false(this.name in self); + assert_false(this.name in self, this.name + " interface should not exist"); }.bind(this), this.name + " interface: existence and properties of interface object"); } return; @@ -3451,6 +3451,17 @@ IdlNamespace.prototype.test_self = function () IdlNamespace.prototype.test = function () { + // If the namespace object is not exposed, only test that. Members can't be + // tested either + if (!this.exposed) { + if (!this.untested) { + subsetTestByKey(this.name, test, function() { + assert_false(this.name in self, this.name + " namespace should not exist"); + }.bind(this), this.name + " namespace: existence and properties of namespace object"); + } + return; + } + if (!this.untested) { this.test_self(); } @@ -3498,7 +3509,7 @@ function idl_test(srcs, deps, idl_setup_func) { "require-exposed" ]; return Promise.all( - srcs.concat(deps).map(fetch_spec)) + srcs.concat(deps).map(globalThis.fetch_spec)) .then(function(results) { const astArray = results.map(result => WebIDL2.parse(result.idl, { sourceName: result.spec }) @@ -3539,9 +3550,11 @@ function idl_test(srcs, deps, idl_setup_func) { }); }, 'idl_test setup'); } +globalThis.idl_test = idl_test; /** * fetch_spec is a shorthand for a Promise that fetches the spec's content. + * Note: ShadowRealm-specific implementation in testharness-shadowrealm-inner.js */ function fetch_spec(spec) { var url = '/interfaces/' + spec + '.idl'; diff --git a/test/fixtures/wpt/resources/out-of-scope-test.js b/test/fixtures/wpt/resources/out-of-scope-test.js new file mode 100644 index 00000000000..ce24124646d --- /dev/null +++ b/test/fixtures/wpt/resources/out-of-scope-test.js @@ -0,0 +1,5 @@ +// Testing that the resolution is correct using `resolve`, as you can't import +// the same module twice. +window.outscope_test_result = import.meta.resolve("a"); +window.outscope_test_result2 = import.meta.resolve("../resources/log.sub.js?name=E"); + diff --git a/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html b/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html index da70c8fa31c..d7fe20a5a57 100644 --- a/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html +++ b/test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html @@ -67,7 +67,12 @@ namespace baz { DOMString LongStory(any hero, DOMString... details); DOMString ShortStory(DOMString... details); -};`); +}; +[Exposed=Worker] +namespace Absent { + undefined Lies(); +}; +`); idlArray.test(); - - - diff --git a/test/fixtures/wpt/xhr/formdata/constructor-submitter-coordinate.html b/test/fixtures/wpt/xhr/formdata/constructor-submitter-coordinate.html index 992f64b7217..b7bf128bd12 100644 --- a/test/fixtures/wpt/xhr/formdata/constructor-submitter-coordinate.html +++ b/test/fixtures/wpt/xhr/formdata/constructor-submitter-coordinate.html @@ -1,18 +1,21 @@ +
- +
diff --git a/test/fixtures/wpt/xhr/formdata/submitter-coordinate-value.html b/test/fixtures/wpt/xhr/formdata/submitter-coordinate-value.html new file mode 100644 index 00000000000..69bea0ac3f9 --- /dev/null +++ b/test/fixtures/wpt/xhr/formdata/submitter-coordinate-value.html @@ -0,0 +1,55 @@ + + + +Test image button coordinates + + + + +
+ +
+ + + + +