Skip to content

Commit 42d9cd2

Browse files
Uzlopakgithub-actions[bot]
authored andcommitted
chore: update WPT
1 parent 290b24d commit 42d9cd2

15 files changed

+162
-92
lines changed

test/fixtures/wpt/interfaces/compute-pressure.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// (https://github.com/w3c/webref)
44
// Source: Compute Pressure Level 1 (https://w3c.github.io/compute-pressure/)
55

6-
enum PressureSource { "thermals", "cpu" };
6+
enum PressureSource { "cpu" };
77

88
enum PressureState { "nominal", "fair", "serious", "critical" };
99

test/fixtures/wpt/interfaces/fedcm.idl

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
5353
};
5454

5555
dictionary IdentityProviderWellKnown {
56-
required sequence<USVString> provider_urls;
56+
sequence<USVString> provider_urls;
57+
USVString accounts_endpoint;
58+
USVString login_url;
5759
};
5860

5961
dictionary IdentityProviderIcon {

test/fixtures/wpt/interfaces/gpc.idl

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// GENERATED CONTENT - DO NOT EDIT
2+
// Content was automatically extracted by Reffy into webref
3+
// (https://github.com/w3c/webref)
4+
// Source: Global Privacy Control (GPC) (https://w3c.github.io/gpc/)
5+
6+
interface mixin GlobalPrivacyControl {
7+
readonly attribute boolean globalPrivacyControl;
8+
};
9+
Navigator includes GlobalPrivacyControl;
10+
WorkerNavigator includes GlobalPrivacyControl;

test/fixtures/wpt/interfaces/html.idl

+10-7
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,11 @@ interface MessageChannel {
25202520
readonly attribute MessagePort port2;
25212521
};
25222522

2523+
interface mixin MessageEventTarget {
2524+
attribute EventHandler onmessage;
2525+
attribute EventHandler onmessageerror;
2526+
};
2527+
25232528
[Exposed=(Window,Worker,AudioWorklet), Transferable]
25242529
interface MessagePort : EventTarget {
25252530
undefined postMessage(any message, sequence<object> transfer);
@@ -2528,11 +2533,11 @@ interface MessagePort : EventTarget {
25282533
undefined close();
25292534

25302535
// event handlers
2531-
attribute EventHandler onmessage;
2532-
attribute EventHandler onmessageerror;
25332536
attribute EventHandler onclose;
25342537
};
25352538

2539+
MessagePort includes MessageEventTarget;
2540+
25362541
dictionary StructuredSerializeOptions {
25372542
sequence<object> transfer = [];
25382543
};
@@ -2571,11 +2576,10 @@ interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
25712576
undefined postMessage(any message, optional StructuredSerializeOptions options = {});
25722577

25732578
undefined close();
2574-
2575-
attribute EventHandler onmessage;
2576-
attribute EventHandler onmessageerror;
25772579
};
25782580

2581+
DedicatedWorkerGlobalScope includes MessageEventTarget;
2582+
25792583
[Global=(Worker,SharedWorker),Exposed=SharedWorker]
25802584
interface SharedWorkerGlobalScope : WorkerGlobalScope {
25812585
[Replaceable] readonly attribute DOMString name;
@@ -2597,8 +2601,6 @@ interface Worker : EventTarget {
25972601

25982602
undefined postMessage(any message, sequence<object> transfer);
25992603
undefined postMessage(any message, optional StructuredSerializeOptions options = {});
2600-
attribute EventHandler onmessage;
2601-
attribute EventHandler onmessageerror;
26022604
};
26032605

26042606
dictionary WorkerOptions {
@@ -2610,6 +2612,7 @@ dictionary WorkerOptions {
26102612
enum WorkerType { "classic", "module" };
26112613

26122614
Worker includes AbstractWorker;
2615+
Worker includes MessageEventTarget;
26132616

26142617
[Exposed=Window]
26152618
interface SharedWorker : EventTarget {

test/fixtures/wpt/interfaces/long-animation-frames.idl

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ interface PerformanceLongAnimationFrameTiming : PerformanceEntry {
1919
[Default] object toJSON();
2020
};
2121

22+
PerformanceLongAnimationFrameTiming includes PaintTimingMixin;
23+
2224
enum ScriptInvokerType {
2325
"classic-script",
2426
"module-script",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// GENERATED CONTENT - DO NOT EDIT
2+
// Content was automatically extracted by Reffy into webref
3+
// (https://github.com/w3c/webref)
4+
// Source: Captured Surface Control (https://w3c.github.io/mediacapture-surface-control/)
5+
6+
partial interface CaptureController {
7+
sequence<long> getSupportedZoomLevels();
8+
long getZoomLevel();
9+
Promise<undefined> setZoomLevel(long zoomLevel);
10+
attribute EventHandler oncapturedzoomlevelchange;
11+
};
12+
13+
partial interface CaptureController {
14+
constructor();
15+
Promise<undefined> forwardWheel(HTMLElement element);
16+
};

test/fixtures/wpt/interfaces/sanitizer-api.idl

+15-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,22 @@ dictionary SetHTMLOptions {
99

1010
[Exposed=(Window,Worker)]
1111
interface Sanitizer {
12-
constructor(optional SanitizerConfig config = {});
12+
constructor(optional SanitizerConfig configuration = {});
13+
14+
// Query configuration:
1315
SanitizerConfig get();
14-
SanitizerConfig getUnsafe();
16+
17+
// Modify a Sanitizer’s lists and fields:
18+
undefined allowElement(SanitizerElementWithAttributes element);
19+
undefined removeElement(SanitizerElement element);
20+
undefined replaceElementWithChildren(SanitizerElement element);
21+
undefined allowAttribute(SanitizerAttribute attribute);
22+
undefined removeAttribute(SanitizerAttribute attribute);
23+
undefined setComments(boolean allow);
24+
undefined setDataAttributes(boolean allow);
25+
26+
// Remove markup that executes script. May modify multiple lists:
27+
undefined removeUnsafe();
1528
};
1629

1730
dictionary SanitizerElementNamespace {

test/fixtures/wpt/interfaces/vibration.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// GENERATED CONTENT - DO NOT EDIT
22
// Content was automatically extracted by Reffy into webref
33
// (https://github.com/w3c/webref)
4-
// Source: Vibration API (Second Edition) (https://w3c.github.io/vibration/)
4+
// Source: Vibration API (https://w3c.github.io/vibration/)
55

66
typedef (unsigned long or sequence<unsigned long>) VibratePattern;
77

test/fixtures/wpt/interfaces/webnn.idl

+26-9
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,18 @@ interface ML {
3232
Promise<MLContext> createContext(GPUDevice gpuDevice);
3333
};
3434

35-
typedef record<USVString, ArrayBufferView> MLNamedArrayBufferViews;
36-
37-
dictionary MLComputeResult {
38-
MLNamedArrayBufferViews inputs;
39-
MLNamedArrayBufferViews outputs;
40-
};
35+
typedef record<USVString, MLTensor> MLNamedTensors;
4136

4237
[SecureContext, Exposed=(Window, DedicatedWorker)]
4338
interface MLContext {
44-
Promise<MLComputeResult> compute(
45-
MLGraph graph, MLNamedArrayBufferViews inputs, MLNamedArrayBufferViews outputs);
39+
undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs);
40+
41+
Promise<MLTensor> createTensor(MLTensorDescriptor descriptor);
42+
43+
Promise<ArrayBuffer> readTensor(MLTensor tensor);
44+
Promise<undefined> readTensor(MLTensor tensor, AllowSharedBufferSource outputData);
45+
46+
undefined writeTensor(MLTensor tensor, AllowSharedBufferSource inputData);
4647

4748
MLOpSupportLimits opSupportLimits();
4849
};
@@ -105,6 +106,21 @@ dictionary MLOperatorOptions {
105106

106107
typedef (bigint or unrestricted double) MLNumber;
107108

109+
dictionary MLTensorDescriptor : MLOperandDescriptor {
110+
boolean readable = false;
111+
boolean writable = false;
112+
};
113+
114+
[SecureContext, Exposed=(Window, DedicatedWorker)]
115+
interface MLTensor {
116+
readonly attribute MLOperandDataType dataType;
117+
readonly attribute FrozenArray<unsigned long> shape;
118+
readonly attribute boolean readable;
119+
readonly attribute boolean writable;
120+
121+
undefined destroy();
122+
};
123+
108124
typedef record<USVString, MLOperand> MLNamedOperands;
109125

110126
[SecureContext, Exposed=(Window, DedicatedWorker)]
@@ -116,7 +132,8 @@ interface MLGraphBuilder {
116132
MLOperand input(USVString name, MLOperandDescriptor descriptor);
117133

118134
// Create an operand for a graph constant.
119-
MLOperand constant(MLOperandDescriptor descriptor, ArrayBufferView bufferView);
135+
MLOperand constant(MLOperandDescriptor descriptor,
136+
AllowSharedBufferSource buffer);
120137

121138
// Create a scalar operand from the specified number of the specified type.
122139
MLOperand constant(MLOperandDataType type, MLNumber value);

test/fixtures/wpt/resources/idlharness-shadowrealm.js

-52
This file was deleted.

test/fixtures/wpt/resources/idlharness.js

+16-3
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ IdlArray.prototype.test = function()
734734

735735
Object.getOwnPropertyNames(this.members).forEach(function(memberName) {
736736
var member = this.members[memberName];
737-
if (!(member instanceof IdlInterface)) {
737+
if (!(member instanceof IdlInterface || member instanceof IdlNamespace)) {
738738
return;
739739
}
740740

@@ -1421,7 +1421,7 @@ IdlInterface.prototype.test = function()
14211421
if (!this.untested)
14221422
{
14231423
subsetTestByKey(this.name, test, function() {
1424-
assert_false(this.name in self);
1424+
assert_false(this.name in self, this.name + " interface should not exist");
14251425
}.bind(this), this.name + " interface: existence and properties of interface object");
14261426
}
14271427
return;
@@ -3451,6 +3451,17 @@ IdlNamespace.prototype.test_self = function ()
34513451

34523452
IdlNamespace.prototype.test = function ()
34533453
{
3454+
// If the namespace object is not exposed, only test that. Members can't be
3455+
// tested either
3456+
if (!this.exposed) {
3457+
if (!this.untested) {
3458+
subsetTestByKey(this.name, test, function() {
3459+
assert_false(this.name in self, this.name + " namespace should not exist");
3460+
}.bind(this), this.name + " namespace: existence and properties of namespace object");
3461+
}
3462+
return;
3463+
}
3464+
34543465
if (!this.untested) {
34553466
this.test_self();
34563467
}
@@ -3498,7 +3509,7 @@ function idl_test(srcs, deps, idl_setup_func) {
34983509
"require-exposed"
34993510
];
35003511
return Promise.all(
3501-
srcs.concat(deps).map(fetch_spec))
3512+
srcs.concat(deps).map(globalThis.fetch_spec))
35023513
.then(function(results) {
35033514
const astArray = results.map(result =>
35043515
WebIDL2.parse(result.idl, { sourceName: result.spec })
@@ -3539,9 +3550,11 @@ function idl_test(srcs, deps, idl_setup_func) {
35393550
});
35403551
}, 'idl_test setup');
35413552
}
3553+
globalThis.idl_test = idl_test;
35423554

35433555
/**
35443556
* fetch_spec is a shorthand for a Promise that fetches the spec's content.
3557+
* Note: ShadowRealm-specific implementation in testharness-shadowrealm-inner.js
35453558
*/
35463559
function fetch_spec(spec) {
35473560
var url = '/interfaces/' + spec + '.idl';

test/fixtures/wpt/resources/test/tests/functional/idlharness/IdlNamespace/test_operation.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@
6767
namespace baz {
6868
DOMString LongStory(any hero, DOMString... details);
6969
DOMString ShortStory(DOMString... details);
70-
};`);
70+
};
71+
[Exposed=Worker]
72+
namespace Absent {
73+
undefined Lies();
74+
};
75+
`);
7176
idlArray.test();
7277
</script>
7378
<script type="text/json" id="expected">
@@ -233,6 +238,12 @@
233238
"status_string": "PASS",
234239
"properties": {},
235240
"message": null
241+
},
242+
{
243+
"name": "Absent namespace: existence and properties of namespace object",
244+
"status_string": "PASS",
245+
"properties": {},
246+
"message": null
236247
}
237248
],
238249
"type": "complete"

test/fixtures/wpt/resources/testharness-shadowrealm-inner.js

+11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ globalThis.setShadowRealmGlobalProperties = function (queryString, fetchAdaptor)
1717
return new Promise(executor).then((s) => JSON.parse(s));
1818
};
1919

20+
// Used only by idlharness.js
21+
globalThis.fetch_spec = (spec) => {
22+
const resource = `/interfaces/${spec}.idl`;
23+
const executor = fetchAdaptor(resource);
24+
return new Promise(executor).then(
25+
idl => ({ spec, idl }),
26+
() => {
27+
throw new IdlHarnessError(`Error fetching ${resource}.`);
28+
});
29+
}
30+
2031
globalThis.location = { search: queryString };
2132
};
2233

0 commit comments

Comments
 (0)