Skip to content

Commit 1332ee5

Browse files
metcoder95github-actions[bot]
authored andcommitted
chore: update WPT
1 parent 6211fac commit 1332ee5

File tree

321 files changed

+7389
-9194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

321 files changed

+7389
-9194
lines changed

test/fixtures/wpt/common/get-host-info.sub.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ function get_host_info() {
2020
var REMOTE_HOST = (ORIGINAL_HOST === 'localhost') ? '127.0.0.1' : ('www1.' + ORIGINAL_HOST);
2121
var OTHER_HOST = '{{domains[www2]}}';
2222
var NOTSAMESITE_HOST = (ORIGINAL_HOST === 'localhost') ? '127.0.0.1' : ('{{hosts[alt][]}}');
23+
var OTHER_NOTSAMESITE_HOST = '{{hosts[alt][www2]}}';
2324

2425
return {
2526
HTTP_PORT: HTTP_PORT,
2627
HTTP_PORT2: HTTP_PORT2,
2728
HTTPS_PORT: HTTPS_PORT,
2829
HTTPS_PORT2: HTTPS_PORT2,
30+
HTTP_PORT_ELIDED: HTTP_PORT_ELIDED,
31+
HTTPS_PORT_ELIDED: HTTPS_PORT_ELIDED,
2932
PORT: PORT,
3033
PORT2: PORT2,
3134
ORIGINAL_HOST: ORIGINAL_HOST,
3235
REMOTE_HOST: REMOTE_HOST,
36+
NOTSAMESITE_HOST,
3337

3438
ORIGIN: PROTOCOL + "//" + ORIGINAL_HOST + PORT_ELIDED,
3539
HTTP_ORIGIN: 'http://' + ORIGINAL_HOST + HTTP_PORT_ELIDED,
@@ -44,6 +48,7 @@ function get_host_info() {
4448
HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + HTTPS_PORT_ELIDED,
4549
HTTPS_REMOTE_ORIGIN_WITH_CREDS: 'https://foo:bar@' + REMOTE_HOST + HTTPS_PORT_ELIDED,
4650
HTTPS_NOTSAMESITE_ORIGIN: 'https://' + NOTSAMESITE_HOST + HTTPS_PORT_ELIDED,
51+
HTTPS_OTHER_NOTSAMESITE_ORIGIN: 'https://' + OTHER_NOTSAMESITE_HOST + HTTPS_PORT_ELIDED,
4752
UNAUTHENTICATED_ORIGIN: 'http://' + OTHER_HOST + HTTP_PORT_ELIDED,
4853
AUTHENTICATED_ORIGIN: 'https://' + OTHER_HOST + HTTPS_PORT_ELIDED
4954
};

test/fixtures/wpt/common/security-features/resources/common.sub.js

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function setAttributes(el, attrs) {
166166
attrs = attrs || {}
167167
for (var attr in attrs) {
168168
if (attr !== 'src')
169-
el.setAttribute(attr, attrs[attr]);
169+
el.setAttribute(attr.toLowerCase(), attrs[attr]);
170170
}
171171
// Workaround for Chromium: set <img>'s src attribute after all other
172172
// attributes to ensure the policy is applied.
@@ -826,6 +826,54 @@ function requestViaWebSocket(url) {
826826
});
827827
}
828828

829+
/**
830+
* Creates a svg anchor element and the corresponding svg setup, appends the
831+
* setup to {@code document.body} and performs the navigation.
832+
* @param {string} url The URL to navigate to.
833+
* @return {Promise} The promise for success/error events.
834+
*/
835+
function requestViaSVGAnchor(url, additionalAttributes) {
836+
const name = guid();
837+
838+
const iframe =
839+
createElement("iframe", { "name": name, "id": name }, document.body, false);
840+
841+
// Create SVG container
842+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
843+
844+
// Create SVG anchor element
845+
const svgAnchor = document.createElementNS("http://www.w3.org/2000/svg", "a");
846+
const link_attributes = Object.assign({ "href": url, "target": name }, additionalAttributes);
847+
setAttributes(svgAnchor, link_attributes);
848+
849+
// Add some text content for the anchor
850+
const text = document.createElementNS("http://www.w3.org/2000/svg", "text");
851+
text.setAttribute("y", "50");
852+
text.textContent = "SVG Link to resource";
853+
854+
svgAnchor.appendChild(text);
855+
svg.appendChild(svgAnchor);
856+
document.body.appendChild(svg);
857+
858+
const promise =
859+
bindEvents2(window, "message", iframe, "error", window, "error")
860+
.then(event => {
861+
if (event.source !== iframe.contentWindow)
862+
return Promise.reject(new Error('Unexpected event.source'));
863+
return event.data;
864+
});
865+
866+
// Simulate a click event on the SVG anchor
867+
const event = new MouseEvent('click', {
868+
view: window,
869+
bubbles: true,
870+
cancelable: true
871+
});
872+
svgAnchor.dispatchEvent(event);
873+
874+
return promise;
875+
}
876+
829877
/**
830878
@typedef SubresourceType
831879
@type {string}
@@ -892,6 +940,10 @@ const subresourceMap = {
892940
path: "/common/security-features/subresource/script.py",
893941
invoker: requestViaDynamicImport,
894942
},
943+
"svg-a-tag": {
944+
path: "/common/security-features/subresource/document.py",
945+
invoker: requestViaSVGAnchor,
946+
},
895947
"video-tag": {
896948
path: "/common/security-features/subresource/video.py",
897949
invoker: requestViaVideo,

test/fixtures/wpt/common/security-features/tools/spec.src.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"sharedworker-import",
112112
"sharedworker-import-data",
113113
"sharedworker-module",
114+
"svg-a-tag",
114115
"video-tag",
115116
"worker-classic",
116117
"worker-import",
@@ -513,6 +514,7 @@
513514
"sharedworker-import",
514515
"sharedworker-import-data",
515516
"sharedworker-module",
517+
"svg-a-tag",
516518
"video-tag",
517519
"websocket",
518520
"worker-classic",

test/fixtures/wpt/common/security-features/tools/spec_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def validate(spec_json, details):
113113
valid_subresource_names = [
114114
"a-tag", "area-tag", "audio-tag", "form-tag", "iframe-tag", "img-tag",
115115
"link-css-tag", "link-prefetch-tag", "object-tag", "picture-tag",
116-
"script-tag", "script-tag-dynamic-import", "video-tag"
116+
"script-tag", "script-tag-dynamic-import", "svg-a-tag", "video-tag"
117117
] + ["beacon", "fetch", "xhr", "websocket"] + [
118118
"worker-classic", "worker-module", "worker-import",
119119
"worker-import-data", "sharedworker-classic", "sharedworker-module",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
features:
2+
- name: server-sent-events
3+
files: "**"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
features:
2+
- name: abortable-fetch
3+
files: "**"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
features:
2+
- name: fetch-request-streams
3+
files:
4+
- request-upload*

test/fixtures/wpt/fetch/api/body/mime-type.any.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
[
8989
() => new Request("about:blank", { method: "POST", body: new Blob([""], { type: "Text/Plain" }), headers: [["Content-Type", "Text/Html"]] }),
90-
() => new Response(new Blob([""], { type: "Text/Plain" }, { headers: [["Content-Type", "Text/Html"]] }))
90+
() => new Response(new Blob([""], { type: "Text/Plain" }), { headers: [["Content-Type", "Text/Html"]] })
9191
].forEach(bodyContainerCreator => {
9292
const bodyContainer = bodyContainerCreator();
9393
const cloned = bodyContainer.clone();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
features:
2+
- name: fetch-priority
3+
files:
4+
- request-init-priority.any.js

0 commit comments

Comments
 (0)