Skip to content

Commit

Permalink
chore: update WPT
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored and github-actions[bot] committed Oct 19, 2024
1 parent 8e025d1 commit 7f763c5
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 62 deletions.
1 change: 1 addition & 0 deletions test/fixtures/wpt/interfaces/fedcm.idl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
USVString nonce;
DOMString loginHint;
DOMString domainHint;
any params;
};

dictionary IdentityProviderWellKnown {
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/wpt/interfaces/invokers.tentative.idl
Original file line number Diff line number Diff line change
@@ -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 = "";
};
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/mediasession.idl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface MediaMetadata {
attribute DOMString title;
attribute DOMString artist;
attribute DOMString album;
attribute FrozenArray<MediaImage> artwork;
attribute FrozenArray<object> artwork;
[SameObject] readonly attribute FrozenArray<ChapterInformation> chapterInfo;
};

Expand Down
15 changes: 9 additions & 6 deletions test/fixtures/wpt/interfaces/turtledove.idl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dictionary AuctionAd {

USVString buyerReportingId;
USVString buyerAndSellerReportingId;
sequence<USVString> selectableBuyerAndSellerReportingIds;
sequence<USVString> allowedReportingOrigins;
DOMString adRenderId;
};
Expand Down Expand Up @@ -89,16 +90,16 @@ dictionary AuctionAdConfig {
sequence<USVString> interestGroupBuyers;
Promise<any> auctionSignals;
Promise<any> sellerSignals;
Promise<DOMString> directFromSellerSignalsHeaderAdSlot;
Promise<record<USVString, USVString>> deprecatedRenderURLReplacements;
Promise<DOMString?> directFromSellerSignalsHeaderAdSlot;
Promise<record<USVString, USVString>?> deprecatedRenderURLReplacements;
unsigned long long sellerTimeout;
unsigned short sellerExperimentGroupId;
Promise<record<USVString, any>> perBuyerSignals;
Promise<record<USVString, unsigned long long>> perBuyerTimeouts;
Promise<record<USVString, unsigned long long>> perBuyerCumulativeTimeouts;
Promise<record<USVString, any>?> perBuyerSignals;
Promise<record<USVString, unsigned long long>?> perBuyerTimeouts;
Promise<record<USVString, unsigned long long>?> perBuyerCumulativeTimeouts;
unsigned long long reportingTimeout;
USVString sellerCurrency;
Promise<record<USVString, USVString>> perBuyerCurrencies;
Promise<record<USVString, USVString>?> perBuyerCurrencies;
record<USVString, unsigned short> perBuyerMultiBidLimits;
record<USVString, unsigned short> perBuyerGroupLimits;
record<USVString, unsigned short> perBuyerExperimentGroupIds;
Expand Down Expand Up @@ -198,6 +199,7 @@ dictionary GenerateBidOutput {
DOMString bidCurrency;
(DOMString or AdRender) render;
any ad;
USVString selectedBuyerAndSellerReportingId;
sequence<(DOMString or AdRender)> adComponents;
double adCost;
unrestricted double modelingSignals;
Expand Down Expand Up @@ -294,6 +296,7 @@ dictionary ReportingBrowserSignals {
USVString componentSeller;

USVString buyerAndSellerReportingId;
USVString selectedBuyerAndSellerReportingId;
};

dictionary ReportResultBrowserSignals : ReportingBrowserSignals {
Expand Down
12 changes: 6 additions & 6 deletions test/fixtures/wpt/interfaces/webaudio.idl
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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 (
Expand All @@ -45,12 +45,12 @@ interface BaseAudioContext : EventTarget {
DynamicsCompressorNode createDynamicsCompressor ();
GainNode createGain ();
IIRFilterNode createIIRFilter (sequence<double> feedforward,
sequence<double> feedback);
sequence<double> feedback);
OscillatorNode createOscillator ();
PannerNode createPanner ();
PeriodicWave createPeriodicWave (sequence<float> real,
sequence<float> imag,
optional PeriodicWaveConstraints constraints = {});
sequence<float> imag,
optional PeriodicWaveConstraints constraints = {});
ScriptProcessorNode createScriptProcessor(
optional unsigned long bufferSize = 0,
optional unsigned long numberOfInputChannels = 2,
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/interfaces/webcodecs.idl
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ dictionary VideoFrameInit {
AlphaOption alpha = "keep";

// Default matches image. May be used to efficiently crop. Will trigger
// new computation of displayWidth and displayHeight using images pixel
// new computation of displayWidth and displayHeight using image's pixel
// aspect ratio unless an explicit displayWidth and displayHeight are given.
DOMRectInit visibleRect;

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/wpt/interfaces/webgpu.idl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ enum GPUFeatureName {
"rg11b10ufloat-renderable",
"bgra8unorm-storage",
"float32-filterable",
"float32-blendable",
"clip-distances",
"dual-source-blending",
};
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/wpt/interfaces/webtransport.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
26 changes: 13 additions & 13 deletions test/fixtures/wpt/interfaces/webusb.idl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dictionary USBConnectionEventInit : EventInit {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBConnectionEvent : Event {
Expand All @@ -55,7 +55,7 @@ enum USBTransferStatus {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBInTransferResult {
Expand All @@ -65,7 +65,7 @@ interface USBInTransferResult {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBOutTransferResult {
Expand All @@ -75,7 +75,7 @@ interface USBOutTransferResult {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBIsochronousInTransferPacket {
Expand All @@ -85,7 +85,7 @@ interface USBIsochronousInTransferPacket {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBIsochronousInTransferResult {
Expand All @@ -95,7 +95,7 @@ interface USBIsochronousInTransferResult {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBIsochronousOutTransferPacket {
Expand All @@ -105,15 +105,15 @@ interface USBIsochronousOutTransferPacket {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBIsochronousOutTransferResult {
constructor(sequence<USBIsochronousOutTransferPacket> packets);
readonly attribute FrozenArray<USBIsochronousOutTransferPacket> packets;
};

[Exposed=(DedicatedWorker,SharedWorker,Window), SecureContext]
[Exposed=(Worker,Window), SecureContext]
interface USBDevice {
readonly attribute octet usbVersionMajor;
readonly attribute octet usbVersionMinor;
Expand Down Expand Up @@ -171,7 +171,7 @@ dictionary USBControlTransferParameters {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBConfiguration {
Expand All @@ -182,7 +182,7 @@ interface USBConfiguration {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBInterface {
Expand All @@ -194,7 +194,7 @@ interface USBInterface {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBAlternateInterface {
Expand All @@ -219,7 +219,7 @@ enum USBEndpointType {
};

[
Exposed=(DedicatedWorker,SharedWorker,Window),
Exposed=(Worker,Window),
SecureContext
]
interface USBEndpoint {
Expand Down Expand Up @@ -252,7 +252,7 @@ dictionary USBPermissionStorage {
sequence<AllowedUSBDevice> allowedDevices = [];
};

[Exposed=(DedicatedWorker,SharedWorker,Window)]
[Exposed=(Worker,Window)]
interface USBPermissionResult : PermissionStatus {
attribute FrozenArray<USBDevice> devices;
};
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
if (entry.workerFinalSourceType === 'cache') {
assert_equals(entry.fetchStart, entry.responseStart, description);
assert_less_than_equal(entry.workerCacheLookupStart, entry.responseStart, description);
assert_equals(entry.deliveryType, 'cache-storage', description);
} else {
assert_less_than_equal(entry.workerCacheLookupStart, entry.fetchStart, description);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<!DOCTYPE html>
<meta charset='utf-8'>
<meta name=viewport content='width=device-width,initial-scale=1'>
<link rel='help' href='https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-the-form-data-set'>
<link ref='help' href='https://xhr.spec.whatwg.org/#dom-formdata'>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>

<form>
<input type=image src='/media/1x1-green.png'></button>
<input type=image src='/images/100px-green-rect.svg'>
</form>

<script>
"use strict";

test(() => {
promise_test(async () => {
await new Promise(r => window.addEventListener("load", r));

const form = document.querySelector("form");
const submitter = form.querySelector("input[type=image]");

Expand All @@ -23,14 +26,14 @@
});

const domRect = submitter.getBoundingClientRect();
const clientX = Math.round((domRect.left + domRect.right) / 7);
const clientY = Math.round((domRect.top + domRect.bottom) / 4);

submitter.dispatchEvent(
new MouseEvent("click", {
clientX: Math.round(domRect.x) + 1,
clientY: Math.round(domRect.y) + 2
})
new MouseEvent("click", {clientX, clientY})
);

assert_equals(formData?.get("x"), "1");
assert_equals(formData?.get("y"), "2");
assert_equals(formData?.get("x"), "23");
assert_equals(formData?.get("y"), "46");
}, "The constructed FormData object should contain correct entries for Image Button submitter's dispatched coordinate");
</script>
55 changes: 55 additions & 0 deletions test/fixtures/wpt/xhr/formdata/submitter-coordinate-value.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!doctype html>
<meta charset="utf-8">
<meta name=viewport content="width=device-width,initial-scale=1">
<title>Test image button coordinates</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#image-button-state-(type=image)">
<link rel="help" href="https://xhr.spec.whatwg.org/#dom-formdata">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=282266">
<link rel="author" title="Zach Hoffman" href="mailto:[email protected]">
<form id="myForm" onsubmit="return false;">
<input id="myImage" name="myImage" type="image" src="/images/100px-green-rect.svg">
</form>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script>
promise_test(async t => {
await new Promise(r => window.addEventListener("load", r));

const xCoordinates = [];
const yCoordinates = [];

let formData;
myForm.addEventListener("submit", t.step_func(e => {
e.preventDefault();
formData = new FormData(myForm, myImage);
xCoordinates.push(formData.get("myImage.x"));
yCoordinates.push(formData.get("myImage.y"));
}));

await test_driver.click(myImage);

const [clientX, clientY] = getInViewCenterPoint(myImage.getBoundingClientRect());
const mouseEvent = new MouseEvent("click", {clientX, clientY});
myImage.dispatchEvent(mouseEvent);

assert_equals(xCoordinates.length, 2, "there should be 2 X coordinates");
assert_equals(yCoordinates.length, 2, "there should be 2 Y coordinates");
assert_equals(xCoordinates[1], xCoordinates[0], "dispatched event X coordinate should match user intention X coordinate");
assert_equals(yCoordinates[1], yCoordinates[0], "dispatched event Y coordinate should match user intention Y coordinate");
}, "dispatched event coordinates should match user intention coordinates")

// Private function from testdriver.js.
function getInViewCenterPoint(rect) {
var left = Math.max(0, rect.left);
var right = Math.min(window.innerWidth, rect.right);
var top = Math.max(0, rect.top);
var bottom = Math.min(window.innerHeight, rect.bottom);

var x = 0.5 * (left + right);
var y = 0.5 * (top + bottom);

return [x, y];
}
</script>

0 comments on commit 7f763c5

Please sign in to comment.