Skip to content

Commit af0eee2

Browse files
chore: update WPT (#4011)
Co-authored-by: Uzlopak <[email protected]>
1 parent f0ffe1f commit af0eee2

14 files changed

+306
-48
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// META: global=window,worker
2+
// META: script=/common/gc.js
3+
4+
promise_test(async () => {
5+
let i = 0;
6+
const repeat = 5;
7+
const buffer = await new Response(new ReadableStream({
8+
pull(c) {
9+
if (i >= repeat) {
10+
c.close();
11+
return;
12+
}
13+
++i;
14+
c.enqueue(new Uint8Array([0]))
15+
garbageCollect();
16+
}
17+
})).arrayBuffer();
18+
assert_equals(buffer.byteLength, repeat, `The buffer should be ${repeat}-byte long`);
19+
}, "GC/CC should not abruptly close the stream while being consumed by Response");
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// GENERATED CONTENT - DO NOT EDIT
2+
// Content was automatically extracted by Reffy into webref
3+
// (https://github.com/w3c/webref)
4+
// Source: CSS Fonts Module Level 5 (https://drafts.csswg.org/css-fonts-5/)
5+
6+
[Exposed=Window]
7+
interface CSSFontFaceDescriptors : CSSStyleDeclaration {
8+
attribute [LegacyNullToEmptyString] CSSOMString src;
9+
attribute [LegacyNullToEmptyString] CSSOMString fontFamily;
10+
attribute [LegacyNullToEmptyString] CSSOMString font-family;
11+
attribute [LegacyNullToEmptyString] CSSOMString fontStyle;
12+
attribute [LegacyNullToEmptyString] CSSOMString font-style;
13+
attribute [LegacyNullToEmptyString] CSSOMString fontWeight;
14+
attribute [LegacyNullToEmptyString] CSSOMString font-weight;
15+
attribute [LegacyNullToEmptyString] CSSOMString fontStretch;
16+
attribute [LegacyNullToEmptyString] CSSOMString font-stretch;
17+
attribute [LegacyNullToEmptyString] CSSOMString fontWidth;
18+
attribute [LegacyNullToEmptyString] CSSOMString font-width;
19+
attribute [LegacyNullToEmptyString] CSSOMString fontSize;
20+
attribute [LegacyNullToEmptyString] CSSOMString font-size;
21+
attribute [LegacyNullToEmptyString] CSSOMString sizeAdjust;
22+
attribute [LegacyNullToEmptyString] CSSOMString size-adjust;
23+
attribute [LegacyNullToEmptyString] CSSOMString unicodeRange;
24+
attribute [LegacyNullToEmptyString] CSSOMString unicode-range;
25+
attribute [LegacyNullToEmptyString] CSSOMString fontFeatureSettings;
26+
attribute [LegacyNullToEmptyString] CSSOMString font-feature-settings;
27+
attribute [LegacyNullToEmptyString] CSSOMString fontVariationSettings;
28+
attribute [LegacyNullToEmptyString] CSSOMString font-variation-settings;
29+
attribute [LegacyNullToEmptyString] CSSOMString fontNamedInstance;
30+
attribute [LegacyNullToEmptyString] CSSOMString font-named-instance;
31+
attribute [LegacyNullToEmptyString] CSSOMString fontDisplay;
32+
attribute [LegacyNullToEmptyString] CSSOMString font-display;
33+
attribute [LegacyNullToEmptyString] CSSOMString fontLanguageOverride;
34+
attribute [LegacyNullToEmptyString] CSSOMString font-language-override;
35+
attribute [LegacyNullToEmptyString] CSSOMString ascentOverride;
36+
attribute [LegacyNullToEmptyString] CSSOMString ascent-override;
37+
attribute [LegacyNullToEmptyString] CSSOMString descentOverride;
38+
attribute [LegacyNullToEmptyString] CSSOMString descent-override;
39+
attribute [LegacyNullToEmptyString] CSSOMString lineGapOverride;
40+
attribute [LegacyNullToEmptyString] CSSOMString line-gap-override;
41+
attribute [LegacyNullToEmptyString] CSSOMString superscriptPositionOverride;
42+
attribute [LegacyNullToEmptyString] CSSOMString superscript-position-override;
43+
attribute [LegacyNullToEmptyString] CSSOMString subscriptPositionOverride;
44+
attribute [LegacyNullToEmptyString] CSSOMString subscript-position-override;
45+
attribute [LegacyNullToEmptyString] CSSOMString superscriptSizeOverride;
46+
attribute [LegacyNullToEmptyString] CSSOMString superscript-size-override;
47+
attribute [LegacyNullToEmptyString] CSSOMString subscriptSizeOverride;
48+
attribute [LegacyNullToEmptyString] CSSOMString subscript-size-override;
49+
};
50+
51+
[Exposed=Window]
52+
interface CSSFontFaceRule : CSSRule {
53+
[SameObject, PutForwards=cssText] readonly attribute CSSFontFaceDescriptors style;
54+
};

test/fixtures/wpt/interfaces/css-fonts.idl

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,6 @@
33
// (https://github.com/w3c/webref)
44
// Source: CSS Fonts Module Level 4 (https://drafts.csswg.org/css-fonts-4/)
55

6-
[Exposed=Window]
7-
interface CSSFontFaceDescriptors : CSSStyleDeclaration {
8-
attribute [LegacyNullToEmptyString] CSSOMString src;
9-
attribute [LegacyNullToEmptyString] CSSOMString fontFamily;
10-
attribute [LegacyNullToEmptyString] CSSOMString font-family;
11-
attribute [LegacyNullToEmptyString] CSSOMString fontStyle;
12-
attribute [LegacyNullToEmptyString] CSSOMString font-style;
13-
attribute [LegacyNullToEmptyString] CSSOMString fontWeight;
14-
attribute [LegacyNullToEmptyString] CSSOMString font-weight;
15-
attribute [LegacyNullToEmptyString] CSSOMString fontStretch;
16-
attribute [LegacyNullToEmptyString] CSSOMString font-stretch;
17-
attribute [LegacyNullToEmptyString] CSSOMString fontWidth;
18-
attribute [LegacyNullToEmptyString] CSSOMString font-width;
19-
attribute [LegacyNullToEmptyString] CSSOMString unicodeRange;
20-
attribute [LegacyNullToEmptyString] CSSOMString unicode-range;
21-
attribute [LegacyNullToEmptyString] CSSOMString fontFeatureSettings;
22-
attribute [LegacyNullToEmptyString] CSSOMString font-feature-settings;
23-
attribute [LegacyNullToEmptyString] CSSOMString fontVariationSettings;
24-
attribute [LegacyNullToEmptyString] CSSOMString font-variation-settings;
25-
attribute [LegacyNullToEmptyString] CSSOMString fontNamedInstance;
26-
attribute [LegacyNullToEmptyString] CSSOMString font-named-instance;
27-
attribute [LegacyNullToEmptyString] CSSOMString fontDisplay;
28-
attribute [LegacyNullToEmptyString] CSSOMString font-display;
29-
attribute [LegacyNullToEmptyString] CSSOMString fontLanguageOverride;
30-
attribute [LegacyNullToEmptyString] CSSOMString font-language-override;
31-
attribute [LegacyNullToEmptyString] CSSOMString ascentOverride;
32-
attribute [LegacyNullToEmptyString] CSSOMString ascent-override;
33-
attribute [LegacyNullToEmptyString] CSSOMString descentOverride;
34-
attribute [LegacyNullToEmptyString] CSSOMString descent-override;
35-
attribute [LegacyNullToEmptyString] CSSOMString lineGapOverride;
36-
attribute [LegacyNullToEmptyString] CSSOMString line-gap-override;
37-
};
38-
39-
[Exposed=Window]
40-
interface CSSFontFaceRule : CSSRule {
41-
[SameObject, PutForwards=cssText] readonly attribute CSSFontFaceDescriptors style;
42-
};
43-
446
partial interface CSSRule { const unsigned short FONT_FEATURE_VALUES_RULE = 14;
457
};
468
[Exposed=Window]

test/fixtures/wpt/interfaces/css-mixins.idl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@
55

66
[Exposed=Window]
77
interface CSSFunctionRule : CSSGroupingRule { };
8+
9+
[Exposed=Window]
10+
interface CSSFunctionDescriptors : CSSStyleDeclaration {
11+
attribute [LegacyNullToEmptyString] CSSOMString result;
12+
};
13+
14+
[Exposed=Window]
15+
interface CSSFunctionDeclarations : CSSRule {
16+
[SameObject, PutForwards=cssText] readonly attribute CSSFunctionDescriptors style;
17+
};

test/fixtures/wpt/interfaces/digital-credentials.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ dictionary DigitalCredentialRequest {
1919
[Exposed=Window, SecureContext]
2020
interface DigitalCredential : Credential {
2121
readonly attribute DOMString protocol;
22-
readonly attribute object data;
22+
[SameObject] readonly attribute object data;
2323
};

test/fixtures/wpt/interfaces/fedcm.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
4949
USVString nonce;
5050
DOMString loginHint;
5151
DOMString domainHint;
52+
sequence<USVString> fields;
5253
any params;
5354
};
5455

test/fixtures/wpt/interfaces/html.idl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,11 @@ interface HTMLDialogElement : HTMLElement {
12221222

12231223
[CEReactions] attribute boolean open;
12241224
attribute DOMString returnValue;
1225+
[CEReactions] attribute DOMString closedBy;
12251226
[CEReactions] undefined show();
12261227
[CEReactions] undefined showModal();
12271228
[CEReactions] undefined close(optional DOMString returnValue);
1229+
[CEReactions] undefined requestClose(optional DOMString returnValue);
12281230
};
12291231

12301232
[Exposed=Window]

test/fixtures/wpt/interfaces/mediacapture-surface-control.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ partial interface CaptureController {
1212

1313
partial interface CaptureController {
1414
constructor();
15-
Promise<undefined> forwardWheel(HTMLElement element);
15+
Promise<undefined> forwardWheel(HTMLElement? element);
1616
};

test/fixtures/wpt/interfaces/permissions-policy.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ interface PermissionsPolicyViolationReportBody : ReportBody {
2727
readonly attribute long? lineNumber;
2828
readonly attribute long? columnNumber;
2929
readonly attribute DOMString disposition;
30+
readonly attribute DOMString? allowAttribute;
3031
};

test/fixtures/wpt/interfaces/shared-storage.idl

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,49 @@ partial interface Window {
3838
[SecureContext] readonly attribute SharedStorage? sharedStorage;
3939
};
4040

41+
[Exposed=(Window,SharedStorageWorklet)]
42+
interface SharedStorageModifierMethod {};
43+
44+
[Exposed=(Window, SharedStorageWorklet)]
45+
interface SharedStorageSetMethod : SharedStorageModifierMethod {
46+
constructor(DOMString key, DOMString value, optional SharedStorageSetMethodOptions options = {});
47+
};
48+
49+
[Exposed=(Window, SharedStorageWorklet)]
50+
interface SharedStorageAppendMethod : SharedStorageModifierMethod {
51+
constructor(DOMString key, DOMString value, optional SharedStorageModifierMethodOptions options = {});
52+
};
53+
54+
[Exposed=(Window, SharedStorageWorklet)]
55+
interface SharedStorageDeleteMethod : SharedStorageModifierMethod {
56+
constructor(DOMString key, optional SharedStorageModifierMethodOptions options = {});
57+
};
58+
59+
[Exposed=(Window, SharedStorageWorklet)]
60+
interface SharedStorageClearMethod : SharedStorageModifierMethod {
61+
constructor(optional SharedStorageModifierMethodOptions options = {});
62+
};
63+
64+
dictionary SharedStorageModifierMethodOptions {
65+
DOMString withLock;
66+
};
67+
68+
dictionary SharedStorageSetMethodOptions : SharedStorageModifierMethodOptions {
69+
boolean ignoreIfPresent;
70+
};
71+
4172
[Exposed=(Window,SharedStorageWorklet)]
4273
interface SharedStorage {
4374
Promise<any> set(DOMString key,
4475
DOMString value,
4576
optional SharedStorageSetMethodOptions options = {});
4677
Promise<any> append(DOMString key,
47-
DOMString value);
48-
Promise<any> delete(DOMString key);
49-
Promise<any> clear();
78+
DOMString value,
79+
optional SharedStorageModifierMethodOptions options = {});
80+
Promise<any> delete(DOMString key, optional SharedStorageModifierMethodOptions options = {});
81+
Promise<any> clear(optional SharedStorageModifierMethodOptions options = {});
82+
Promise<any> batchUpdate(sequence<SharedStorageModifierMethod> methods,
83+
optional SharedStorageModifierMethodOptions options = {});
5084

5185
[Exposed=Window]
5286
Promise<SharedStorageResponse> selectURL(DOMString name,
@@ -76,10 +110,6 @@ interface SharedStorage {
76110
async iterable<DOMString, DOMString>;
77111
};
78112

79-
dictionary SharedStorageSetMethodOptions {
80-
boolean ignoreIfPresent = false;
81-
};
82-
83113
dictionary SharedStoragePrivateAggregationConfig {
84114
USVString aggregationCoordinatorOrigin;
85115
USVString contextId;

test/fixtures/wpt/interfaces/webnn.idl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ interface ML {
3434

3535
typedef record<USVString, MLTensor> MLNamedTensors;
3636

37+
dictionary MLContextLostInfo {
38+
DOMString message;
39+
};
40+
3741
[SecureContext, Exposed=(Window, DedicatedWorker)]
3842
interface MLContext {
3943
undefined dispatch(MLGraph graph, MLNamedTensors inputs, MLNamedTensors outputs);
@@ -46,6 +50,10 @@ interface MLContext {
4650
undefined writeTensor(MLTensor tensor, AllowSharedBufferSource inputData);
4751

4852
MLOpSupportLimits opSupportLimits();
53+
54+
undefined destroy();
55+
56+
readonly attribute Promise<MLContextLostInfo> lost;
4957
};
5058

5159
dictionary MLOpSupportLimits {
@@ -71,7 +79,9 @@ dictionary MLSingleInputSupportLimits {
7179
};
7280

7381
[SecureContext, Exposed=(Window, DedicatedWorker)]
74-
interface MLGraph {};
82+
interface MLGraph {
83+
undefined destroy();
84+
};
7585

7686
enum MLInputOperandLayout {
7787
"nchw",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
self.addEventListener('message', event => {
2+
event.source.postMessage('passed');
3+
});
4+
5+
self.addEventListener('fetch', event => {
6+
let url = new URL(event.request.url);
7+
if (!url.searchParams.get('test_resource')) {
8+
return;
9+
}
10+
event.respondWith(new Response('passed'));
11+
});
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<!doctype html>
2+
<html>
3+
<body>
4+
<iframe id="srcdocFrame" srcdoc="
5+
<script>
6+
function reportTestResult(result) {
7+
top.postMessage({ type: 'TEST_RESULT', result: result }, '*');
8+
}
9+
10+
async function postMessageToController() {
11+
let controller = navigator.serviceWorker.controller;
12+
if (!controller) {
13+
reportTestResult('no navigator.serviceWorker.controller');
14+
}
15+
try {
16+
controller.postMessage('test');
17+
} catch (e) {
18+
reportTestResult('Unexpected Error ' + e.name + ' : ' + e.message);
19+
}
20+
}
21+
22+
async function getServiceWorkerRegistration(scope) {
23+
try {
24+
let reg = await navigator.serviceWorker.getRegistration(scope);
25+
if (!reg) {
26+
reportTestResult('no regsitration for ' + scope);
27+
}
28+
if (reg.scope !== scope) {
29+
reportTestResult('regsitration scope does not match');
30+
}
31+
32+
if (!reg.active) {
33+
reportTestResult('regsitration.active is not valid' + reg.active);
34+
}
35+
reportTestResult('passed');
36+
} catch (e) {
37+
reportTestResult('Unexpected Error ' + e.name + ' : ' + e.message);
38+
}
39+
}
40+
41+
function addSrcdocIframeWithSandbox(sandbox) {
42+
let frame = document.createElement('iframe');
43+
frame.sandbox = sandbox;
44+
frame.srcdoc = `
45+
<script>
46+
function reportTestResult(result) {
47+
top.postMessage({ type: 'TEST_RESULT', result: result }, '*');
48+
}
49+
50+
window.onload = function onLoad() {
51+
try {
52+
let controller = navigator.serviceWorker.controller;
53+
reportTestResult(controller ? 'HasController' : 'NoController');
54+
} catch (e) {
55+
reportTestResult((e.name == 'SecurityError') ?
56+
'NoController' : 'UnexpectedError:' + e.message);
57+
}
58+
}
59+
<\/script>`;
60+
document.body.appendChild(frame);
61+
}
62+
63+
function addSandboxedSrcdocFrame() {
64+
addSrcdocIframeWithSandbox('allow-scripts');
65+
}
66+
67+
function addSameOriginSandboxedSrcdocFrame() {
68+
addSrcdocIframeWithSandbox('allow-scripts allow-same-origin');
69+
}
70+
71+
async function fetchResource() {
72+
let response = await fetch('?test_resource=1');
73+
reportTestResult(await response.text());
74+
}
75+
76+
window.navigator.serviceWorker.addEventListener(
77+
'message', function onMsg(evt) {
78+
// Forward the message as test result.
79+
reportTestResult(evt.data);
80+
});
81+
</script>
82+
"></iframe>
83+
84+
<script>
85+
// Helper routine to make it slightly easier for our parent to find
86+
// the srcdoc frame.
87+
function srcdocFrame() {
88+
return document.getElementById('srcdocFrame').contentWindow;
89+
}
90+
</script>
91+
</body>
92+
</html>

0 commit comments

Comments
 (0)