Introduction to Writing Content Security Policy Tests
The CSP test suite uses the standard W3C testharness.js framework, but there are a few additional things you'll need to do because of the unique way CSP works, even if you're already an expert at writing W3C tests. These tests require the use of the
- wptserve server (included in the web-platform-tests repository) to operate correctly.
Add here the estimation of tests required produced by
- W3C test coverage
+ W3C test coverage
tool. If possible, provide a better informed guess on the number of tests.
Test passes if the scrollbars in the following box are NOT styled:
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar-body.html b/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar-body.html
new file mode 100644
index 00000000000..a1b3aee871a
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar-body.html
@@ -0,0 +1,15 @@
+
+
+CSS Test: scrollbar style on body element should not be propagated to the viewport
+
+
+
+
+
+
Test passes if the scrollbars in the following box are NOT styled:
Test passes if the scrollbars in the following box are styled:
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar.html b/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar.html
new file mode 100644
index 00000000000..500da7a9f95
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-scrollbars/viewport-scrollbar.html
@@ -0,0 +1,15 @@
+
+
+CSS Test: scrollbar style on root element should be propagated to the viewport
+
+
+
+
+
+
Test passes if the scrollbars in the following box are styled:
+
diff --git a/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name.html b/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name.html
new file mode 100644
index 00000000000..7e7a310f6b0
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-change-part-name.html
@@ -0,0 +1,32 @@
+
+
+
+ CSS Shadow Parts - Invalidation Change Part Name
+
+
+
+
+
+
+
+
+
+
+
+
+ This text
+
+ The following text should be green:
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-complex-selector.html b/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-complex-selector.html
new file mode 100644
index 00000000000..e1f10e57dc9
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-shadow-parts/invalidation-complex-selector.html
@@ -0,0 +1,32 @@
+
+
+
+ CSS Shadow Parts - Invalidation Complex Selector
+
+
+
+
+
+
+
+
+
+
+
+
+ This text
+
+ The following text should be green:
+
Add here the estimation of tests required produced by
- W3C test coverage
+ W3C test coverage
tool. If possible, provide a better informed guess on the number of tests.
CSS Test: @namespace in CSSOM is not severely broken
+
+
+
+
+
+
+
Should be green
+
+
diff --git a/tests/wpt/web-platform-tests/css/cssom/insertRule-charset-no-index.html b/tests/wpt/web-platform-tests/css/cssom/insertRule-charset-no-index.html
index b94dc11afae..16f2358dc2d 100644
--- a/tests/wpt/web-platform-tests/css/cssom/insertRule-charset-no-index.html
+++ b/tests/wpt/web-platform-tests/css/cssom/insertRule-charset-no-index.html
@@ -19,7 +19,7 @@
sheet.insertRule("p { color: green; }");
assert_equals(sheet.cssRules.length, 1);
assert_equals(sheet.cssRules.item(0).cssText, "p { color: green; }");
- }, "inserRule with charset and omitted index argument");
+ }, "insertRule with charset and omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 1);
diff --git a/tests/wpt/web-platform-tests/css/cssom/insertRule-import-no-index.html b/tests/wpt/web-platform-tests/css/cssom/insertRule-import-no-index.html
index c97d3949487..ad3622f86aa 100644
--- a/tests/wpt/web-platform-tests/css/cssom/insertRule-import-no-index.html
+++ b/tests/wpt/web-platform-tests/css/cssom/insertRule-import-no-index.html
@@ -20,7 +20,7 @@
assert_equals(sheet.cssRules.length, 1);
assert_throws("HierarchyRequestError", function() { sheet.insertRule("p { color: green; }"); });
assert_equals(sheet.cssRules.length, 1);
- }, "inserRule with import and omitted index argument");
+ }, "insertRule with import and omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 1);
diff --git a/tests/wpt/web-platform-tests/css/cssom/insertRule-namespace-no-index.html b/tests/wpt/web-platform-tests/css/cssom/insertRule-namespace-no-index.html
index 8a3315d8606..c1628eed85f 100644
--- a/tests/wpt/web-platform-tests/css/cssom/insertRule-namespace-no-index.html
+++ b/tests/wpt/web-platform-tests/css/cssom/insertRule-namespace-no-index.html
@@ -22,7 +22,7 @@
assert_equals(sheet.cssRules.length, 3);
assert_throws("HierarchyRequestError", function() { sheet.insertRule("p { color: green; }"); });
assert_equals(sheet.cssRules.length, 3);
- }, "inserRule with namespace and omitted index argument");
+ }, "insertRule with namespace and omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 3);
@@ -34,7 +34,7 @@
assert_equals(sheet.cssRules.length, 3);
sheet.insertRule("@import url(\"support/a-green.css\");");
assert_equals(sheet.cssRules.length, 4);
- }, "inserRule with namespace and omitted index argument should insert import");
+ }, "insertRule with namespace and omitted index argument should insert import");
diff --git a/tests/wpt/web-platform-tests/css/cssom/insertRule-no-index.html b/tests/wpt/web-platform-tests/css/cssom/insertRule-no-index.html
index c9704b7475a..b4370bd080c 100644
--- a/tests/wpt/web-platform-tests/css/cssom/insertRule-no-index.html
+++ b/tests/wpt/web-platform-tests/css/cssom/insertRule-no-index.html
@@ -22,7 +22,7 @@
sheet.insertRule("p { color: green; }");
assert_equals(sheet.cssRules.length, 2);
assert_equals(sheet.cssRules.item(0).cssText, "p { color: green; }");
- }, "inserRule with omitted index argument");
+ }, "insertRule with omitted index argument");
test(function() {
assert_equals(sheet.cssRules.length, 2);
diff --git a/tests/wpt/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html b/tests/wpt/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html
new file mode 100644
index 00000000000..f24cc209c89
--- /dev/null
+++ b/tests/wpt/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html
@@ -0,0 +1,49 @@
+
+
+
+Custom Elements: the HTML fragment parsing algorithm must not create a custom element synchronously
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/docs/_appendix/github-intro.md b/tests/wpt/web-platform-tests/docs/_appendix/github-intro.md
index 6ed68ed0bdb..06b2a39ef2b 100644
--- a/tests/wpt/web-platform-tests/docs/_appendix/github-intro.md
+++ b/tests/wpt/web-platform-tests/docs/_appendix/github-intro.md
@@ -48,7 +48,7 @@ If you are a first-time GitHub user, read on for more details of the workflow.
The test repository that you contribute to will depend on the specification
that you are testing.
-**Main W3C test repository**: [github.com/w3c/web-platform-tests][main-repo]
+**Main W3C test repository**: [github.com/web-platform-tests/wpt][main-repo]
## Fork
@@ -111,7 +111,7 @@ repository.
3. Next, add the remote of the repository your forked. This assigns the
original repository to a remote called "upstream":
- $ git remote add upstream https://github.com/w3c/web-platform-tests.git
+ $ git remote add upstream https://github.com/web-platform-tests/wpt.git
4. To pull in changes in the original repository that are not present in your
local repository first fetch them:
@@ -219,7 +219,7 @@ GitHub UI. Below is one method and others can be found on
of the UI, then click the ![new pull request][pullrequestbtn] button.
2. On the left, you should see the base repo is the
- w3c/web-platform-tests. On the right, you should see your fork of that
+ web-platform-tests/wpt. On the right, you should see your fork of that
repo. In the branch menu of your forked repo, switch to `topic`
**Note:** If you see _'There isn't anything to compare'_, click
@@ -323,8 +323,8 @@ If it is possible to review the tests without a local copy,
but the reviewer still wants to make some simple tweaks to the tests before merging,
it is possible to do so via the Github web UI.
-1. Open the pull request. E.g. https://github.com/w3c/web-platform-tests/pull/1234
-2. Go to the ![Files changed][files-changed] view (e.g. https://github.com/w3c/web-platform-tests/pull/1234/files)
+1. Open the pull request. E.g. https://github.com/web-platform-tests/wpt/pull/1234
+2. Go to the ![Files changed][files-changed] view (e.g. https://github.com/web-platform-tests/wpt/pull/1234/files)
3. Locate the files you wish to change, and click the ![pencil][pencil-icon] icon in the upper right corner
4. Make the desired change
5. Write a commit message (including a good title) at the bottom
@@ -393,7 +393,7 @@ you may also discard your connection to their repo:
[github-fork-docs]: https://help.github.com/articles/fork-a-repo
[github-createpr]: https://help.github.com/articles/creating-a-pull-request
[help]: https://help.github.com/
-[main-repo]: https://github.com/w3c/web-platform-tests
+[main-repo]: https://github.com/web-platform-tests/wpt
[password-caching]: https://help.github.com/articles/caching-your-github-password-in-git
[pullrequestlink]: {{ site.baseurl }}{% link /assets/pullrequestlink.png %}
[pullrequestbtn]: {{ site.baseurl }}{% link /assets/pullrequestbtn.png %}
diff --git a/tests/wpt/web-platform-tests/docs/_includes/header.html b/tests/wpt/web-platform-tests/docs/_includes/header.html
index 6c966407672..055271d4014 100644
--- a/tests/wpt/web-platform-tests/docs/_includes/header.html
+++ b/tests/wpt/web-platform-tests/docs/_includes/header.html
@@ -1,6 +1,6 @@
- Edit on GitHub
+ Edit on GitHub
diff --git a/tests/wpt/web-platform-tests/docs/_reviewing-tests/checklist.md b/tests/wpt/web-platform-tests/docs/_reviewing-tests/checklist.md
index ffb86c1afb6..23b26424180 100644
--- a/tests/wpt/web-platform-tests/docs/_reviewing-tests/checklist.md
+++ b/tests/wpt/web-platform-tests/docs/_reviewing-tests/checklist.md
@@ -7,7 +7,7 @@ order: 2
The following checklist is provided as a guideline to assist in reviewing
tests; in case of any contradiction with requirements stated elsewhere in the
documentation it should be ignored
-(please [file a bug](https://github.com/w3c/web-platform-tests/issues/new)!).
+(please [file a bug](https://github.com/web-platform-tests/wpt/issues/new)!).
As noted on the [reviewing tests][review index] page, nits need not block PRs
from landing.
diff --git a/tests/wpt/web-platform-tests/docs/_running-tests/chrome.md b/tests/wpt/web-platform-tests/docs/_running-tests/chrome.md
index b3b98742dec..dcbc86f745c 100644
--- a/tests/wpt/web-platform-tests/docs/_running-tests/chrome.md
+++ b/tests/wpt/web-platform-tests/docs/_running-tests/chrome.md
@@ -31,7 +31,7 @@ To bypass device selection and use mock media for tests using `getUserMedia`:
./wpt run --binary-arg=--use-fake-ui-for-media-stream --binary-arg=--use-fake-device-for-media-stream chrome mediacapture-streams/
```
-Note: there's an [open issue for doing this using WebDriver](https://github.com/w3c/web-platform-tests/issues/7424).
+Note: there's an [open issue for doing this using WebDriver](https://github.com/web-platform-tests/wpt/issues/7424).
Some of the above are most useful in combination, e.g., to run all tests in
Chrome Dev with experimental web platform features enabled:
diff --git a/tests/wpt/web-platform-tests/docs/_running-tests/chrome_android.md b/tests/wpt/web-platform-tests/docs/_running-tests/chrome_android.md
index 334ef8c85bf..adb662d5710 100644
--- a/tests/wpt/web-platform-tests/docs/_running-tests/chrome_android.md
+++ b/tests/wpt/web-platform-tests/docs/_running-tests/chrome_android.md
@@ -24,7 +24,7 @@ Until we find a better way, we need to root the Android device and update the
## CA certificate
In order to run HTTPS tests, we need to add
-[WPT's CA](https://github.com/w3c/web-platform-tests/blob/master/tools/certs/cacert.pem)
+[WPT's CA](https://github.com/web-platform-tests/wpt/blob/master/tools/certs/cacert.pem)
to the phone. First, convert the certificate from PEM to CRT:
```
diff --git a/tests/wpt/web-platform-tests/docs/_running-tests/safari.md b/tests/wpt/web-platform-tests/docs/_running-tests/safari.md
index b36f6d707bd..e6cedd97f96 100644
--- a/tests/wpt/web-platform-tests/docs/_running-tests/safari.md
+++ b/tests/wpt/web-platform-tests/docs/_running-tests/safari.md
@@ -14,7 +14,7 @@ To run Safari on macOS, some manual setup is required:
* Set `OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES` in your environment. This is a
workaround for a known
- [macOS High Sierra issue](https://github.com/w3c/web-platform-tests/issues/9007).
+ [macOS High Sierra issue](https://github.com/web-platform-tests/wpt/issues/9007).
Now, run the tests using the `safari` product:
```
diff --git a/tests/wpt/web-platform-tests/docs/_writing-tests/ahem.md b/tests/wpt/web-platform-tests/docs/_writing-tests/ahem.md
index f0980a82b1e..97e5b26dc05 100644
--- a/tests/wpt/web-platform-tests/docs/_writing-tests/ahem.md
+++ b/tests/wpt/web-platform-tests/docs/_writing-tests/ahem.md
@@ -86,4 +86,4 @@ On Linux, copy the file to `~/.local/share/fonts` and then run
`fc-cache`.
[ahem-readme]: https://www.w3.org/Style/CSS/Test/Fonts/Ahem/README
-[download-ahem]: https://github.com/w3c/web-platform-tests/raw/master/fonts/Ahem.ttf
+[download-ahem]: https://github.com/web-platform-tests/wpt/raw/master/fonts/Ahem.ttf
diff --git a/tests/wpt/web-platform-tests/docs/_writing-tests/submission-process.md b/tests/wpt/web-platform-tests/docs/_writing-tests/submission-process.md
index 9bbd0a4ac30..27abf74f602 100644
--- a/tests/wpt/web-platform-tests/docs/_writing-tests/submission-process.md
+++ b/tests/wpt/web-platform-tests/docs/_writing-tests/submission-process.md
@@ -41,7 +41,7 @@ Hop on to the [mailing list][public-test-infra] or [IRC][]
no need to announce your review request, as soon as you make a Pull Request
GitHub will inform interested parties.
-[repo]: https://github.com/w3c/web-platform-tests/
+[repo]: https://github.com/web-platform-tests/wpt/
[github-intro]: {{ site.baseurl }}{% link _appendix/github-intro.md %}
[github flow]: https://guides.github.com/introduction/flow/
[public-test-infra]: https://lists.w3.org/Archives/Public/public-test-infra/
diff --git a/tests/wpt/web-platform-tests/docs/_writing-tests/testdriver-tutorial.md b/tests/wpt/web-platform-tests/docs/_writing-tests/testdriver-tutorial.md
index 0b2165cb1e4..2318e0e2e03 100644
--- a/tests/wpt/web-platform-tests/docs/_writing-tests/testdriver-tutorial.md
+++ b/tests/wpt/web-platform-tests/docs/_writing-tests/testdriver-tutorial.md
@@ -313,5 +313,5 @@ run instead of testdriver-extra.js in browser specific test environments. For ex
### What if I need to return a value from my testdriver API?
-We currently don't have this capability, but it is coming soon and will be documented. The bug is [here](https://github.com/w3c/web-platform-tests/issues/10716)
+We currently don't have this capability, but it is coming soon and will be documented. The bug is [here](https://github.com/web-platform-tests/wpt/issues/10716)
diff --git a/tests/wpt/web-platform-tests/docs/introduction.md b/tests/wpt/web-platform-tests/docs/introduction.md
index d021663224b..1b2f7f611d5 100644
--- a/tests/wpt/web-platform-tests/docs/introduction.md
+++ b/tests/wpt/web-platform-tests/docs/introduction.md
@@ -76,7 +76,7 @@ The testsuite has a few types of tests, outlined below:
## GitHub
-[GitHub](https://github.com/w3c/web-platform-tests/) is used both for [issue tracking](https://github.com/w3c/web-platform-tests/issues) and [test submissions](https://github.com/w3c/web-platform-tests/pulls); we
+[GitHub](https://github.com/web-platform-tests/wpt/) is used both for [issue tracking](https://github.com/web-platform-tests/wpt/issues) and [test submissions](https://github.com/web-platform-tests/wpt/pulls); we
provide [a limited introduction][github-intro] to both git and
GitHub.
@@ -148,7 +148,7 @@ After your `hosts` file is configured, the servers will be locally accessible at
http://web-platform.test:8000/
https://web-platform.test:8443/ *
-\**See [Trusting Root CA](https://github.com/w3c/web-platform-tests/blob/master/README.md#trusting-root-ca)*
+\**See [Trusting Root CA](https://github.com/web-platform-tests/wpt/blob/master/README.md#trusting-root-ca)*
## Running tests automatically
diff --git a/tests/wpt/web-platform-tests/domparsing/interfaces.any.js b/tests/wpt/web-platform-tests/domparsing/interfaces.any.js
new file mode 100644
index 00000000000..4eaeabea85d
--- /dev/null
+++ b/tests/wpt/web-platform-tests/domparsing/interfaces.any.js
@@ -0,0 +1,16 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+'use strict';
+
+// https://w3c.github.io/DOM-Parsing/
+
+promise_test(async () => {
+ const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
+ const idl = await fetch('/interfaces/DOM-Parsing.idl').then(r => r.text());
+ const idlArray = new IdlArray();
+ idlArray.add_untested_idls(dom);
+ idlArray.add_idls(idl);
+ idlArray.test();
+ done();
+}, 'Test driver');
diff --git a/tests/wpt/web-platform-tests/eventsource/resources/status-error.py b/tests/wpt/web-platform-tests/eventsource/resources/status-error.py
index 5eaedcdb1a7..f0a1504bdd3 100644
--- a/tests/wpt/web-platform-tests/eventsource/resources/status-error.py
+++ b/tests/wpt/web-platform-tests/eventsource/resources/status-error.py
@@ -6,7 +6,7 @@ def main(request, response):
# not specify a body. The expected browser behavior for this condition is not
# currently defined--see the following for further discussion:
#
- # https://github.com/w3c/web-platform-tests/pull/5227
+ # https://github.com/web-platform-tests/wpt/pull/5227
if status[0] in ["204", "205"]:
body = ""
else:
diff --git a/tests/wpt/web-platform-tests/fetch/OWNERS b/tests/wpt/web-platform-tests/fetch/OWNERS
index e2f2428209f..40c8334df7e 100644
--- a/tests/wpt/web-platform-tests/fetch/OWNERS
+++ b/tests/wpt/web-platform-tests/fetch/OWNERS
@@ -3,3 +3,4 @@
@annevk
@mnot
@yutakahirano
+@domfarolino
diff --git a/tests/wpt/web-platform-tests/fetch/api/request/request-consume-empty.html b/tests/wpt/web-platform-tests/fetch/api/request/request-consume-empty.html
index c84d2cecd37..c3b8bc4f54b 100644
--- a/tests/wpt/web-platform-tests/fetch/api/request/request-consume-empty.html
+++ b/tests/wpt/web-platform-tests/fetch/api/request/request-consume-empty.html
@@ -106,7 +106,7 @@
checkRequestWithEmptyBody("blob", new Blob([], { "type" : "text/plain" }), true);
checkRequestWithEmptyBody("text", "", true);
checkRequestWithEmptyBody("URLSearchParams", new URLSearchParams(""), true);
- // FIXME: This test assumes that the empty string be returned but it is not clear whether that is right. See https://github.com/w3c/web-platform-tests/pull/3950.
+ // FIXME: This test assumes that the empty string be returned but it is not clear whether that is right. See https://github.com/web-platform-tests/wpt/pull/3950.
checkRequestWithEmptyBody("FormData", new FormData(), true);
checkRequestWithEmptyBody("ArrayBuffer", new ArrayBuffer(), true);
diff --git a/tests/wpt/web-platform-tests/fetch/api/request/request-reset-attributes.https.html b/tests/wpt/web-platform-tests/fetch/api/request/request-reset-attributes.https.html
index ba04d19a877..7be3608d737 100644
--- a/tests/wpt/web-platform-tests/fetch/api/request/request-reset-attributes.https.html
+++ b/tests/wpt/web-platform-tests/fetch/api/request/request-reset-attributes.https.html
@@ -7,6 +7,10 @@
diff --git a/tests/wpt/web-platform-tests/fetch/api/request/request-structure.html b/tests/wpt/web-platform-tests/fetch/api/request/request-structure.html
index 575aa178f5b..e137a7ea512 100644
--- a/tests/wpt/web-platform-tests/fetch/api/request/request-structure.html
+++ b/tests/wpt/web-platform-tests/fetch/api/request/request-structure.html
@@ -30,6 +30,8 @@
"cache",
"redirect",
"integrity",
+ "isReloadNavigation",
+ "isHistoryNavigation",
//Request implements Body
"bodyUsed"
];
@@ -104,6 +106,11 @@
newValue = true;
break;
+ case "isHistoryNavigation":
+ defaultValue = false;
+ newValue = true;
+ break;
+
default:
return;
}
diff --git a/tests/wpt/web-platform-tests/fetch/origin/no-cors.any.js b/tests/wpt/web-platform-tests/fetch/origin/no-cors.any.js
new file mode 100644
index 00000000000..c9d1d3b3af3
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/origin/no-cors.any.js
@@ -0,0 +1,20 @@
+// META: script=/common/utils.js
+// META: script=/common/get-host-info.sub.js
+
+promise_test(async function() {
+ const stash = token(),
+ origins = get_host_info(),
+ redirectPath = "/fetch/origin/resources/redirect-and-stash.py";
+
+ // Cross-origin -> same-origin will result in setting the tainted origin flag for the second
+ // request.
+ let url = origins.HTTP_ORIGIN + redirectPath + "?stash=" + stash;
+ url = origins.HTTP_REMOTE_ORIGIN + redirectPath + "?stash=" + stash + "&location=" + encodeURIComponent(url);
+
+ await fetch(url, { mode: "no-cors", method: "POST" });
+
+ const json = await (await fetch(redirectPath + "?dump&stash=" + stash)).json();
+
+ assert_equals(json[0], origins.HTTP_ORIGIN, "first origin should equal this origin");
+ assert_equals(json[1], "null", "second origin should be opaque and therefore null");
+}, "Origin header and 308 redirect");
diff --git a/tests/wpt/web-platform-tests/fetch/origin/resources/redirect-and-stash.py b/tests/wpt/web-platform-tests/fetch/origin/resources/redirect-and-stash.py
new file mode 100644
index 00000000000..1b1b46ba177
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/origin/resources/redirect-and-stash.py
@@ -0,0 +1,29 @@
+import json
+
+def main(request, response):
+ key = request.GET.first("stash")
+ origin = request.headers.get("origin")
+ if origin is None:
+ origin = "no Origin header"
+
+ origin_list = request.server.stash.take(key)
+
+ if "dump" in request.GET:
+ response.headers.set("content-Type", "application/json")
+ response.content = json.dumps(origin_list)
+ return
+
+ if origin_list is None:
+ origin_list = [origin]
+ else:
+ origin_list.append(origin)
+
+ request.server.stash.put(key, origin_list)
+
+ if "location" in request.GET:
+ response.status = 308
+ response.headers.set("Location", request.GET.first("location"))
+ return
+
+ response.headers.set("content-Type", "text/plain")
+ response.content = "Fix https://github.com/whatwg/fetch/issues/737..."
diff --git a/tests/wpt/web-platform-tests/fetch/range/general.any.js b/tests/wpt/web-platform-tests/fetch/range/general.any.js
new file mode 100644
index 00000000000..2e49ed1e0f9
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/general.any.js
@@ -0,0 +1,60 @@
+// Helpers that return headers objects with a particular guard
+function headersGuardNone(fill) {
+ if (fill) return new Headers(fill);
+ return new Headers();
+}
+
+function headersGuardResponse(fill) {
+ const opts = {};
+ if (fill) opts.headers = fill;
+ return new Response('', opts).headers;
+}
+
+function headersGuardRequest(fill) {
+ const opts = {};
+ if (fill) opts.headers = fill;
+ return new Request('./', opts).headers;
+}
+
+function headersGuardRequestNoCors(fill) {
+ const opts = { mode: 'no-cors' };
+ if (fill) opts.headers = fill;
+ return new Request('./', opts).headers;
+}
+
+const headerGuardTypes = [
+ ['none', headersGuardNone],
+ ['response', headersGuardResponse],
+ ['request', headersGuardRequest]
+];
+
+for (const [guardType, createHeaders] of headerGuardTypes) {
+ test(() => {
+ // There are three ways to set headers.
+ // Filling, appending, and setting. Test each:
+ let headers = createHeaders({ Range: 'foo' });
+ assert_equals(headers.get('Range'), 'foo');
+
+ headers = createHeaders();
+ headers.append('Range', 'foo');
+ assert_equals(headers.get('Range'), 'foo');
+
+ headers = createHeaders();
+ headers.set('Range', 'foo');
+ assert_equals(headers.get('Range'), 'foo');
+ }, `Range header setting allowed for guard type: ${guardType}`);
+}
+
+test(() => {
+ let headers = headersGuardRequestNoCors({ Range: 'foo' });
+ assert_false(headers.has('Range'));
+
+ headers = headersGuardRequestNoCors();
+ headers.append('Range', 'foo');
+ assert_false(headers.has('Range'));
+
+ headers = headersGuardRequestNoCors();
+ headers.set('Range', 'foo');
+ assert_false(headers.has('Range'));
+}, `Privileged header not allowed for guard type: request-no-cors`);
+
diff --git a/tests/wpt/web-platform-tests/fetch/range/partial-script.window.js b/tests/wpt/web-platform-tests/fetch/range/partial-script.window.js
new file mode 100644
index 00000000000..36b4bba31aa
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/partial-script.window.js
@@ -0,0 +1,7 @@
+// META: script=resources/utils.js
+
+// It's weird that browsers do this, but it should continue to work.
+promise_test(async t => {
+ await loadScript('resources/partial-script.py?pretend-offset=90000');
+ assert_true(self.scriptExecuted);
+}, `Script executed from partial response`);
diff --git a/tests/wpt/web-platform-tests/fetch/range/resources/basic.html b/tests/wpt/web-platform-tests/fetch/range/resources/basic.html
new file mode 100644
index 00000000000..0e76edd65b7
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/resources/basic.html
@@ -0,0 +1 @@
+
diff --git a/tests/wpt/web-platform-tests/fetch/range/resources/long-wav.py b/tests/wpt/web-platform-tests/fetch/range/resources/long-wav.py
new file mode 100644
index 00000000000..d510767c309
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/resources/long-wav.py
@@ -0,0 +1,111 @@
+"""
+This generates a 30 minute silent wav, and is capable of
+responding to Range requests.
+"""
+import time
+import re
+import struct
+
+
+def create_wav_header(sample_rate, bit_depth, channels, duration):
+ bytes_per_sample = bit_depth / 8
+ block_align = bytes_per_sample * channels
+ byte_rate = sample_rate * block_align
+ sub_chunk_2_size = duration * byte_rate
+
+ data = b''
+ # ChunkID
+ data += b'RIFF'
+ # ChunkSize
+ data += struct.pack(' 0:
+ if not response.writer.flush():
+ break
+
+ to_send = b'\x00' * min(bytes_remaining_to_send, sample_rate)
+ bytes_remaining_to_send -= len(to_send)
+
+ response.writer.write(to_send)
+ # Throttle the stream
+ time.sleep(0.5)
diff --git a/tests/wpt/web-platform-tests/fetch/range/resources/partial-script.py b/tests/wpt/web-platform-tests/fetch/range/resources/partial-script.py
new file mode 100644
index 00000000000..5b642c601d8
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/resources/partial-script.py
@@ -0,0 +1,30 @@
+"""
+This generates a partial response containing valid JavaScript.
+"""
+
+
+def main(request, response):
+ require_range = request.GET.first('require-range', '')
+ pretend_offset = int(request.GET.first('pretend-offset', '0'))
+ range_header = request.headers.get('Range', '')
+
+ if require_range and not range_header:
+ response.set_error(412, "Range header required")
+ response.write()
+ return
+
+ response.headers.set("Content-Type", "text/plain")
+ response.headers.set("Accept-Ranges", "bytes")
+ response.headers.set("Cache-Control", "no-cache")
+ response.status = 206
+
+ to_send = 'self.scriptExecuted = true;'
+ length = len(to_send)
+
+ content_range = "bytes {}-{}/{}".format(
+ pretend_offset, pretend_offset + length - 1, pretend_offset + length)
+
+ response.headers.set("Content-Range", content_range)
+ response.headers.set("Content-Length", length)
+
+ response.content = to_send
diff --git a/tests/wpt/web-platform-tests/fetch/range/resources/range-sw.js b/tests/wpt/web-platform-tests/fetch/range/resources/range-sw.js
new file mode 100644
index 00000000000..1dfee58e452
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/resources/range-sw.js
@@ -0,0 +1,142 @@
+importScripts('/resources/testharness.js');
+
+setup({ explicit_done: true });
+
+function assert_range_request(request, expectedRangeHeader, name) {
+ assert_equals(request.headers.get('Range'), expectedRangeHeader, name);
+}
+
+async function broadcast(msg) {
+ for (const client of await clients.matchAll()) {
+ client.postMessage(msg);
+ }
+}
+
+addEventListener('fetch', event => {
+ /** @type Request */
+ const request = event.request;
+ const url = new URL(request.url);
+ const action = url.searchParams.get('action');
+
+ switch (action) {
+ case 'range-header-filter-test':
+ rangeHeaderFilterTest(request);
+ return;
+ case 'range-header-passthrough-test':
+ rangeHeaderPassthroughTest(event);
+ return;
+ case 'store-ranged-response':
+ storeRangedResponse(event);
+ return;
+ case 'use-stored-ranged-response':
+ useStoredRangeResponse(event);
+ return;
+ }
+});
+
+/**
+ * @param {Request} request
+ */
+function rangeHeaderFilterTest(request) {
+ const rangeValue = request.headers.get('Range');
+
+ test(() => {
+ assert_range_request(new Request(request), rangeValue, `Untampered`);
+ assert_range_request(new Request(request, {}), rangeValue, `Untampered (no init props set)`);
+ assert_range_request(new Request(request, { __foo: 'bar' }), rangeValue, `Untampered (only invalid props set)`);
+ assert_range_request(new Request(request, { mode: 'cors' }), rangeValue, `More permissive mode`);
+ assert_range_request(request.clone(), rangeValue, `Clone`);
+ }, "Range headers correctly preserved");
+
+ test(() => {
+ assert_range_request(new Request(request, { headers: { Range: 'foo' } }), null, `Tampered - range header set`);
+ assert_range_request(new Request(request, { headers: {} }), null, `Tampered - empty headers set`);
+ assert_range_request(new Request(request, { mode: 'no-cors' }), null, `Tampered – mode set`);
+ assert_range_request(new Request(request, { cache: 'no-cache' }), null, `Tampered – cache mode set`);
+ }, "Range headers correctly removed");
+
+ test(() => {
+ let headers;
+
+ headers = new Request(request).headers;
+ headers.delete('does-not-exist');
+ assert_equals(headers.get('Range'), rangeValue, `Preserved if no header actually removed`);
+
+ headers = new Request(request).headers;
+ headers.append('foo', 'bar');
+ assert_equals(headers.get('Range'), rangeValue, `Preserved if silent-failure on append (due to request-no-cors guard)`);
+
+ headers = new Request(request).headers;
+ headers.set('foo', 'bar');
+ assert_equals(headers.get('Range'), rangeValue, `Preserved if silent-failure on set (due to request-no-cors guard)`);
+
+ headers = new Request(request).headers;
+ headers.append('Range', 'foo');
+ assert_equals(headers.get('Range'), rangeValue, `Preserved if silent-failure on append (due to request-no-cors guard)`);
+
+ headers = new Request(request).headers;
+ headers.set('Range', 'foo');
+ assert_equals(headers.get('Range'), rangeValue, `Preserved if silent-failure on set (due to request-no-cors guard)`);
+
+ headers = new Request(request).headers;
+ headers.append('Accept', 'whatever');
+ assert_equals(headers.get('Range'), null, `Stripped if header successfully appended`);
+
+ headers = new Request(request).headers;
+ headers.set('Accept', 'whatever');
+ assert_equals(headers.get('Range'), null, `Stripped if header successfully set`);
+
+ headers = new Request(request).headers;
+ headers.delete('Accept');
+ assert_equals(headers.get('Range'), null, `Stripped if header successfully deleted`);
+
+ headers = new Request(request).headers;
+ headers.delete('Range');
+ assert_equals(headers.get('Range'), null, `Stripped if range header successfully deleted`);
+ }, "Headers correctly filtered");
+
+ done();
+}
+
+function rangeHeaderPassthroughTest(event) {
+ /** @type Request */
+ const request = event.request;
+ const url = new URL(request.url);
+ const key = url.searchParams.get('range-received-key');
+
+ event.waitUntil(new Promise(resolve => {
+ promise_test(async () => {
+ await fetch(event.request);
+ const response = await fetch('stash-take.py?key=' + key);
+ assert_equals(await response.json(), '"range-header-received"');
+ resolve();
+ }, `Include range header in network request`);
+
+ done();
+ }));
+
+ // Just send back any response, it isn't important for the test.
+ event.respondWith(new Response(''));
+}
+
+let storedRangeResponseP;
+
+function storeRangedResponse(event) {
+ /** @type Request */
+ const request = event.request;
+ const id = new URL(request.url).searchParams.get('id');
+
+ storedRangeResponseP = fetch(event.request);
+ broadcast({ id });
+
+ // Just send back any response, it isn't important for the test.
+ event.respondWith(new Response(''));
+}
+
+function useStoredRangeResponse(event) {
+ event.respondWith(async function() {
+ const response = await storedRangeResponseP;
+ if (!response) throw Error("Expected stored range response");
+ return response.clone();
+ }());
+}
diff --git a/tests/wpt/web-platform-tests/fetch/range/resources/stash-take.py b/tests/wpt/web-platform-tests/fetch/range/resources/stash-take.py
new file mode 100644
index 00000000000..4ec1fe57647
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/resources/stash-take.py
@@ -0,0 +1,7 @@
+from wptserve.handlers import json_handler
+
+
+@json_handler
+def main(request, response):
+ key = request.GET.first("key")
+ return request.server.stash.take(key, '/fetch/range/')
diff --git a/tests/wpt/web-platform-tests/fetch/range/resources/utils.js b/tests/wpt/web-platform-tests/fetch/range/resources/utils.js
new file mode 100644
index 00000000000..567f231d030
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/resources/utils.js
@@ -0,0 +1,9 @@
+function loadScript(url, { doc = document }={}) {
+ return new Promise((resolve, reject) => {
+ const script = doc.createElement('script');
+ script.onload = () => resolve();
+ script.onerror = () => reject(Error("Script load failed"));
+ script.src = url;
+ doc.body.appendChild(script);
+ })
+}
diff --git a/tests/wpt/web-platform-tests/fetch/range/sw.https.window.js b/tests/wpt/web-platform-tests/fetch/range/sw.https.window.js
new file mode 100644
index 00000000000..aa3d2c478dd
--- /dev/null
+++ b/tests/wpt/web-platform-tests/fetch/range/sw.https.window.js
@@ -0,0 +1,128 @@
+// META: script=../../../service-workers/service-worker/resources/test-helpers.sub.js
+// META: script=/common/utils.js
+// META: script=/common/get-host-info.sub.js
+// META: script=resources/utils.js
+
+const { REMOTE_HOST } = get_host_info();
+const SCOPE = 'resources/basic.html' + Math.random();
+
+function appendAudio(document, url) {
+ const audio = document.createElement('audio');
+ audio.muted = true;
+ audio.src = url;
+ audio.preload = true;
+ document.body.appendChild(audio);
+}
+
+async function cleanup() {
+ for (const iframe of document.querySelectorAll('.test-iframe')) {
+ iframe.parentNode.removeChild(iframe);
+ }
+
+ const reg = await navigator.serviceWorker.getRegistration(SCOPE);
+ if (reg) await reg.unregister();
+}
+
+async function setupRegistration(t) {
+ await cleanup();
+ const reg = await navigator.serviceWorker.register('resources/range-sw.js', { scope: SCOPE });
+ await wait_for_state(t, reg.installing, 'activated');
+ return reg;
+}
+
+function awaitMessage(obj, id) {
+ return new Promise(resolve => {
+ obj.addEventListener('message', function listener(event) {
+ if (event.data.id !== id) return;
+ obj.removeEventListener('message', listener);
+ resolve();
+ });
+ });
+}
+
+promise_test(async t => {
+ const reg = await setupRegistration(t);
+ const iframe = await with_iframe(SCOPE);
+ const w = iframe.contentWindow;
+
+ // Trigger a cross-origin range request using media
+ const url = new URL('long-wav.py?action=range-header-filter-test', w.location);
+ url.hostname = REMOTE_HOST;
+ appendAudio(w.document, url);
+
+ // See rangeHeaderFilterTest in resources/range-sw.js
+ await fetch_tests_from_worker(reg.active);
+}, `Defer range header filter tests to service worker`);
+
+promise_test(async t => {
+ const reg = await setupRegistration(t);
+ const iframe = await with_iframe(SCOPE);
+ const w = iframe.contentWindow;
+
+ // Trigger a cross-origin range request using media
+ const url = new URL('long-wav.py', w.location);
+ url.searchParams.set('action', 'range-header-passthrough-test');
+ url.searchParams.set('range-received-key', token());
+ url.hostname = REMOTE_HOST;
+ appendAudio(w.document, url);
+
+ // See rangeHeaderPassthroughTest in resources/range-sw.js
+ await fetch_tests_from_worker(reg.active);
+}, `Defer range header passthrough tests to service worker`);
+
+promise_test(async t => {
+ await setupRegistration(t);
+ const iframe = await with_iframe(SCOPE);
+ const w = iframe.contentWindow;
+ const id = Math.random() + '';
+ const storedRangeResponse = awaitMessage(w.navigator.serviceWorker, id);
+
+ // Trigger a cross-origin range request using media
+ const url = new URL('partial-script.py', w.location);
+ url.searchParams.set('require-range', '1');
+ url.searchParams.set('action', 'store-ranged-response');
+ url.searchParams.set('id', id);
+ url.hostname = REMOTE_HOST;
+
+ appendAudio(w.document, url);
+
+ await storedRangeResponse;
+
+ // Fetching should reject
+ const fetchPromise = w.fetch('?action=use-stored-ranged-response', { mode: 'no-cors' });
+ promise_rejects(t, new TypeError(), fetchPromise);
+
+ // Script loading should error too
+ const loadScriptPromise = loadScript('?action=use-stored-ranged-response', { doc: w.document });
+ promise_rejects(t, new Error(), loadScriptPromise);
+
+ await loadScriptPromise.catch(() => {});
+
+ assert_false(!!w.scriptExecuted, `Partial response shouldn't be executed`);
+}, `Ranged response not allowed following no-cors ranged request`);
+
+promise_test(async t => {
+ await setupRegistration(t);
+ const iframe = await with_iframe(SCOPE);
+ const w = iframe.contentWindow;
+ const id = Math.random() + '';
+ const storedRangeResponse = awaitMessage(w.navigator.serviceWorker, id);
+
+ // Trigger a range request using media
+ const url = new URL('partial-script.py', w.location);
+ url.searchParams.set('require-range', '1');
+ url.searchParams.set('action', 'store-ranged-response');
+ url.searchParams.set('id', id);
+
+ appendAudio(w.document, url);
+
+ await storedRangeResponse;
+
+ // This should not throw
+ await w.fetch('?action=use-stored-ranged-response');
+
+ // This shouldn't throw either
+ await loadScript('?action=use-stored-ranged-response', { doc: w.document });
+
+ assert_true(w.scriptExecuted, `Partial response should be executed`);
+}, `Non-opaque ranged response executed`);
diff --git a/tests/wpt/web-platform-tests/generic-sensor/README.md b/tests/wpt/web-platform-tests/generic-sensor/README.md
index 993e0c52b8e..28227b0ba40 100644
--- a/tests/wpt/web-platform-tests/generic-sensor/README.md
+++ b/tests/wpt/web-platform-tests/generic-sensor/README.md
@@ -15,6 +15,6 @@ The Chromium implementation of the `GenericSensorTest` interface is located in
Other browser vendors should provide their own implementations of
the `GenericSensorTest` interface.
-[Known issue](https://github.com/w3c/web-platform-tests/issues/9686): a
+[Known issue](https://github.com/web-platform-tests/wpt/issues/9686): a
WebDriver extension is a better approach for the Generic Sensor tests
automation.
diff --git a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js
index da2e65da5ec..a3896e7b6a1 100644
--- a/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js
+++ b/tests/wpt/web-platform-tests/generic-sensor/generic-sensor-tests.js
@@ -355,7 +355,7 @@ function runGenericSensorTests(sensorName) {
await sensorWatcher.wait_for("reading");
//TODO use mock data to verify sensor readings, blocked by issue:
- // https://github.com/w3c/web-platform-tests/issues/9686
+ // https://github.com/web-platform-tests/wpt/issues/9686
assert_reading_not_null(sensor);
sensor.stop();
diff --git a/tests/wpt/web-platform-tests/geolocation-API/OWNERS b/tests/wpt/web-platform-tests/geolocation-API/OWNERS
index 9bebfbaa6e8..f95e64efb88 100644
--- a/tests/wpt/web-platform-tests/geolocation-API/OWNERS
+++ b/tests/wpt/web-platform-tests/geolocation-API/OWNERS
@@ -1,3 +1,3 @@
@jdm
-@mcasas
+@yellowdoge
@zqzhang
diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html
deleted file mode 100644
index a3ca82f520a..00000000000
--- a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-004-1
-
-// child frame with no onbeforeunload listener. Should leave the parent as unsalvageable.
-// Adding the iframe prevents potential implementation bugs where the the recursive steps of #prompt-to-unload-a-document
-// would overwrite the salvageable state of the parent.
-
diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html
deleted file mode 100644
index 1a605b1b3d5..00000000000
--- a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-004-2
-
diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html
deleted file mode 100644
index 7076a4dd18e..00000000000
--- a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-salvagable state of document after setting beforeunload listener
-
-
-
-
-
diff --git a/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/contentType.window.js b/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/contentType.window.js
index dbabb1b19b4..5a912038749 100644
--- a/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/contentType.window.js
+++ b/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/contentType.window.js
@@ -21,7 +21,7 @@ const videoURL = getVideoURI("/images/pattern"),
assert_equals(frame.contentDocument.contentType, val[1]);
// Make sure a load event is fired across browsers
- // https://github.com/w3c/web-platform-tests/pull/10239
+ // https://github.com/web-platform-tests/wpt/pull/10239
frame.contentDocument.close();
});
}, "document.write(): " + val[2] + " document");
diff --git a/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js b/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js
index 2c8a7fe7b96..c6db2facf5f 100644
--- a/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js
+++ b/tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js
@@ -1,5 +1,5 @@
// NOTE: this file needs to be split up rather than expanded. See ../location.sub.html for some
-// extracted tests. Tracked by https://github.com/w3c/web-platform-tests/issues/4934.
+// extracted tests. Tracked by https://github.com/web-platform-tests/wpt/issues/4934.
setup({explicit_done:true});
onload = function() {
diff --git a/tests/wpt/web-platform-tests/input-events/OWNERS b/tests/wpt/web-platform-tests/input-events/OWNERS
index 452445ef596..32be11bc412 100644
--- a/tests/wpt/web-platform-tests/input-events/OWNERS
+++ b/tests/wpt/web-platform-tests/input-events/OWNERS
@@ -1,2 +1,2 @@
@johanneswilm
-@siusin
\ No newline at end of file
+@siusin
diff --git a/tests/wpt/web-platform-tests/interfaces/DOM-Parsing.idl b/tests/wpt/web-platform-tests/interfaces/DOM-Parsing.idl
new file mode 100644
index 00000000000..11d5d8bc372
--- /dev/null
+++ b/tests/wpt/web-platform-tests/interfaces/DOM-Parsing.idl
@@ -0,0 +1,31 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the DOM Parsing and Serialization spec.
+// See https://w3c.github.io/DOM-Parsing/
+
+[Constructor, Exposed=Window]
+interface DOMParser {
+ [NewObject] Document parseFromString(DOMString str, SupportedType type);
+};
+
+enum SupportedType {
+ "text/html",
+ "text/xml",
+ "application/xml",
+ "application/xhtml+xml",
+ "image/svg+xml"
+};
+
+[Constructor, Exposed=Window]
+ interface XMLSerializer {
+ DOMString serializeToString(Node root);
+};
+
+partial interface Element {
+ [CEReactions, TreatNullAs=EmptyString] attribute DOMString innerHTML;
+ [CEReactions, TreatNullAs=EmptyString] attribute DOMString outerHTML;
+ [CEReactions] void insertAdjacentHTML(DOMString position, DOMString text);
+};
+
+partial interface Range {
+ [CEReactions, NewObject] DocumentFragment createContextualFragment(DOMString fragment);
+};
diff --git a/tests/wpt/web-platform-tests/interfaces/IndexedDB.idl b/tests/wpt/web-platform-tests/interfaces/IndexedDB.idl
index 89924c09b49..25e9a9c8e9c 100644
--- a/tests/wpt/web-platform-tests/interfaces/IndexedDB.idl
+++ b/tests/wpt/web-platform-tests/interfaces/IndexedDB.idl
@@ -1,10 +1,14 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the Indexed Database API spec.
+// See https://w3c.github.io/IndexedDB/
+
[Exposed=(Window,Worker)]
interface IDBRequest : EventTarget {
- readonly attribute any result;
- readonly attribute DOMException? error;
+ readonly attribute any result;
+ readonly attribute DOMException? error;
readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
- readonly attribute IDBTransaction? transaction;
- readonly attribute IDBRequestReadyState readyState;
+ readonly attribute IDBTransaction? transaction;
+ readonly attribute IDBRequestReadyState readyState;
// Event handlers:
attribute EventHandler onsuccess;
@@ -26,12 +30,12 @@ interface IDBOpenDBRequest : IDBRequest {
[Exposed=(Window,Worker),
Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
interface IDBVersionChangeEvent : Event {
- readonly attribute unsigned long long oldVersion;
+ readonly attribute unsigned long long oldVersion;
readonly attribute unsigned long long? newVersion;
};
dictionary IDBVersionChangeEventInit : EventInit {
- unsigned long long oldVersion = 0;
+ unsigned long long oldVersion = 0;
unsigned long long? newVersion = null;
};
@@ -41,26 +45,26 @@ partial interface WindowOrWorkerGlobalScope {
[Exposed=(Window,Worker)]
interface IDBFactory {
- IDBOpenDBRequest open(DOMString name,
- optional [EnforceRange] unsigned long long version);
- IDBOpenDBRequest deleteDatabase(DOMString name);
+ [NewObject] IDBOpenDBRequest open(DOMString name,
+ optional [EnforceRange] unsigned long long version);
+ [NewObject] IDBOpenDBRequest deleteDatabase(DOMString name);
short cmp(any first, any second);
};
[Exposed=(Window,Worker)]
interface IDBDatabase : EventTarget {
- readonly attribute DOMString name;
+ readonly attribute DOMString name;
readonly attribute unsigned long long version;
- readonly attribute DOMStringList objectStoreNames;
+ readonly attribute DOMStringList objectStoreNames;
- IDBTransaction transaction((DOMString or sequence) storeNames,
- optional IDBTransactionMode mode = "readonly");
- void close();
+ [NewObject] IDBTransaction transaction((DOMString or sequence) storeNames,
+ optional IDBTransactionMode mode = "readonly");
+ void close();
- IDBObjectStore createObjectStore(DOMString name,
- optional IDBObjectStoreParameters options);
- void deleteObjectStore(DOMString name);
+ [NewObject] IDBObjectStore createObjectStore(DOMString name,
+ optional IDBObjectStoreParameters options);
+ void deleteObjectStore(DOMString name);
// Event handlers:
attribute EventHandler onabort;
@@ -71,40 +75,40 @@ interface IDBDatabase : EventTarget {
dictionary IDBObjectStoreParameters {
(DOMString or sequence)? keyPath = null;
- boolean autoIncrement = false;
+ boolean autoIncrement = false;
};
[Exposed=(Window,Worker)]
interface IDBObjectStore {
- attribute DOMString name;
- readonly attribute any keyPath;
- readonly attribute DOMStringList indexNames;
- readonly attribute IDBTransaction transaction;
- readonly attribute boolean autoIncrement;
+ attribute DOMString name;
+ readonly attribute any keyPath;
+ readonly attribute DOMStringList indexNames;
+ [SameObject] readonly attribute IDBTransaction transaction;
+ readonly attribute boolean autoIncrement;
- IDBRequest put(any value, optional any key);
- IDBRequest add(any value, optional any key);
- IDBRequest delete(any query);
- IDBRequest clear();
- IDBRequest get(any query);
- IDBRequest getKey(any query);
- IDBRequest getAll(optional any query,
- [EnforceRange] optional unsigned long count);
- IDBRequest getAllKeys(optional any query,
- [EnforceRange] optional unsigned long count);
- IDBRequest count(optional any query);
+ [NewObject] IDBRequest put(any value, optional any key);
+ [NewObject] IDBRequest add(any value, optional any key);
+ [NewObject] IDBRequest delete(any query);
+ [NewObject] IDBRequest clear();
+ [NewObject] IDBRequest get(any query);
+ [NewObject] IDBRequest getKey(any query);
+ [NewObject] IDBRequest getAll(optional any query,
+ optional [EnforceRange] unsigned long count);
+ [NewObject] IDBRequest getAllKeys(optional any query,
+ optional [EnforceRange] unsigned long count);
+ [NewObject] IDBRequest count(optional any query);
- IDBRequest openCursor(optional any query,
- optional IDBCursorDirection direction = "next");
- IDBRequest openKeyCursor(optional any query,
- optional IDBCursorDirection direction = "next");
+ [NewObject] IDBRequest openCursor(optional any query,
+ optional IDBCursorDirection direction = "next");
+ [NewObject] IDBRequest openKeyCursor(optional any query,
+ optional IDBCursorDirection direction = "next");
- IDBIndex index(DOMString name);
+ IDBIndex index(DOMString name);
- IDBIndex createIndex(DOMString name,
- (DOMString or sequence) keyPath,
- optional IDBIndexParameters options);
- void deleteIndex(DOMString indexName);
+ [NewObject] IDBIndex createIndex(DOMString name,
+ (DOMString or sequence) keyPath,
+ optional IDBIndexParameters options);
+ void deleteIndex(DOMString name);
};
dictionary IDBIndexParameters {
@@ -114,58 +118,58 @@ dictionary IDBIndexParameters {
[Exposed=(Window,Worker)]
interface IDBIndex {
- attribute DOMString name;
- readonly attribute IDBObjectStore objectStore;
- readonly attribute any keyPath;
- readonly attribute boolean multiEntry;
- readonly attribute boolean unique;
+ attribute DOMString name;
+ [SameObject] readonly attribute IDBObjectStore objectStore;
+ readonly attribute any keyPath;
+ readonly attribute boolean multiEntry;
+ readonly attribute boolean unique;
- IDBRequest get(any query);
- IDBRequest getKey(any query);
- IDBRequest getAll(optional any query,
- [EnforceRange] optional unsigned long count);
- IDBRequest getAllKeys(optional any query,
- [EnforceRange] optional unsigned long count);
- IDBRequest count(optional any query);
+ [NewObject] IDBRequest get(any query);
+ [NewObject] IDBRequest getKey(any query);
+ [NewObject] IDBRequest getAll(optional any query,
+ optional [EnforceRange] unsigned long count);
+ [NewObject] IDBRequest getAllKeys(optional any query,
+ optional [EnforceRange] unsigned long count);
+ [NewObject] IDBRequest count(optional any query);
- IDBRequest openCursor(optional any query,
- optional IDBCursorDirection direction = "next");
- IDBRequest openKeyCursor(optional any query,
- optional IDBCursorDirection direction = "next");
+ [NewObject] IDBRequest openCursor(optional any query,
+ optional IDBCursorDirection direction = "next");
+ [NewObject] IDBRequest openKeyCursor(optional any query,
+ optional IDBCursorDirection direction = "next");
};
[Exposed=(Window,Worker)]
interface IDBKeyRange {
- readonly attribute any lower;
- readonly attribute any upper;
+ readonly attribute any lower;
+ readonly attribute any upper;
readonly attribute boolean lowerOpen;
readonly attribute boolean upperOpen;
// Static construction methods:
- static IDBKeyRange only(any value);
- static IDBKeyRange lowerBound(any lower, optional boolean open = false);
- static IDBKeyRange upperBound(any upper, optional boolean open = false);
- static IDBKeyRange bound(any lower,
- any upper,
- optional boolean lowerOpen = false,
- optional boolean upperOpen = false);
+ [NewObject] static IDBKeyRange only(any value);
+ [NewObject] static IDBKeyRange lowerBound(any lower, optional boolean open = false);
+ [NewObject] static IDBKeyRange upperBound(any upper, optional boolean open = false);
+ [NewObject] static IDBKeyRange bound(any lower,
+ any upper,
+ optional boolean lowerOpen = false,
+ optional boolean upperOpen = false);
- boolean includes(any key);
+ boolean _includes(any key);
};
[Exposed=(Window,Worker)]
interface IDBCursor {
readonly attribute (IDBObjectStore or IDBIndex) source;
- readonly attribute IDBCursorDirection direction;
- readonly attribute any key;
- readonly attribute any primaryKey;
+ readonly attribute IDBCursorDirection direction;
+ readonly attribute any key;
+ readonly attribute any primaryKey;
void advance([EnforceRange] unsigned long count);
void continue(optional any key);
void continuePrimaryKey(any key, any primaryKey);
- IDBRequest update(any value);
- IDBRequest delete();
+ [NewObject] IDBRequest update(any value);
+ [NewObject] IDBRequest delete();
};
enum IDBCursorDirection {
@@ -182,13 +186,13 @@ interface IDBCursorWithValue : IDBCursor {
[Exposed=(Window,Worker)]
interface IDBTransaction : EventTarget {
- readonly attribute DOMStringList objectStoreNames;
+ readonly attribute DOMStringList objectStoreNames;
readonly attribute IDBTransactionMode mode;
- readonly attribute IDBDatabase db;
- readonly attribute DOMException error;
+ [SameObject] readonly attribute IDBDatabase db;
+ readonly attribute DOMException error;
IDBObjectStore objectStore(DOMString name);
- void abort();
+ void abort();
// Event handlers:
attribute EventHandler onabort;
diff --git a/tests/wpt/web-platform-tests/interfaces/css-typed-om.idl b/tests/wpt/web-platform-tests/interfaces/css-typed-om.idl
index 39e53ce39f9..45df5205d9a 100644
--- a/tests/wpt/web-platform-tests/interfaces/css-typed-om.idl
+++ b/tests/wpt/web-platform-tests/interfaces/css-typed-om.idl
@@ -170,7 +170,7 @@ enum CSSMathOperator {
};
// FIXME: Uncomment this when IDLHarness supports CSS namespaces:
-// https://github.com/w3c/web-platform-tests/issues/7583
+// https://github.com/web-platform-tests/wpt/issues/7583
/*
partial namespace CSS {
CSSUnitValue number(double value);
diff --git a/tests/wpt/web-platform-tests/interfaces/fetch.idl b/tests/wpt/web-platform-tests/interfaces/fetch.idl
index 346d1b08819..18514856bee 100644
--- a/tests/wpt/web-platform-tests/interfaces/fetch.idl
+++ b/tests/wpt/web-platform-tests/interfaces/fetch.idl
@@ -39,6 +39,7 @@ interface Request {
readonly attribute DOMString integrity;
readonly attribute boolean keepalive;
readonly attribute boolean isReloadNavigation;
+ readonly attribute boolean isHistoryNavigation;
readonly attribute AbortSignal signal;
[NewObject] Request clone();
diff --git a/tests/wpt/web-platform-tests/interfaces/pointerevents.idl b/tests/wpt/web-platform-tests/interfaces/pointerevents.idl
new file mode 100644
index 00000000000..3a36c6aaa1b
--- /dev/null
+++ b/tests/wpt/web-platform-tests/interfaces/pointerevents.idl
@@ -0,0 +1,53 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the Pointer Events spec.
+// See https://w3c.github.io/pointerevents/
+
+dictionary PointerEventInit : MouseEventInit {
+ long pointerId = 0;
+ double width = 1;
+ double height = 1;
+ float pressure = 0;
+ float tangentialPressure = 0;
+ long tiltX = 0;
+ long tiltY = 0;
+ long twist = 0;
+ DOMString pointerType = "";
+ boolean isPrimary = false;
+};
+
+[Constructor(DOMString type, optional PointerEventInit eventInitDict), Exposed=Window]
+interface PointerEvent : MouseEvent {
+ readonly attribute long pointerId;
+ readonly attribute double width;
+ readonly attribute double height;
+ readonly attribute float pressure;
+ readonly attribute float tangentialPressure;
+ readonly attribute long tiltX;
+ readonly attribute long tiltY;
+ readonly attribute long twist;
+ readonly attribute DOMString pointerType;
+ readonly attribute boolean isPrimary;
+};
+
+partial interface Element {
+ void setPointerCapture (long pointerId);
+ void releasePointerCapture (long pointerId);
+ boolean hasPointerCapture (long pointerId);
+};
+
+partial interface GlobalEventHandlers {
+ attribute EventHandler ongotpointercapture;
+ attribute EventHandler onlostpointercapture;
+ attribute EventHandler onpointerdown;
+ attribute EventHandler onpointermove;
+ attribute EventHandler onpointerup;
+ attribute EventHandler onpointercancel;
+ attribute EventHandler onpointerover;
+ attribute EventHandler onpointerout;
+ attribute EventHandler onpointerenter;
+ attribute EventHandler onpointerleave;
+};
+
+partial interface Navigator {
+ readonly attribute long maxTouchPoints;
+};
diff --git a/tests/wpt/web-platform-tests/interfaces/pointerlock.idl b/tests/wpt/web-platform-tests/interfaces/pointerlock.idl
new file mode 100644
index 00000000000..e406b53abdf
--- /dev/null
+++ b/tests/wpt/web-platform-tests/interfaces/pointerlock.idl
@@ -0,0 +1,27 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the Pointer Lock spec.
+// See https://w3c.github.io/pointerlock/
+
+partial interface Element {
+ void requestPointerLock();
+};
+
+partial interface Document {
+ attribute EventHandler onpointerlockchange;
+ attribute EventHandler onpointerlockerror;
+ void exitPointerLock();
+};
+
+partial interface DocumentOrShadowRoot {
+ readonly attribute Element ? pointerLockElement;
+};
+
+partial interface MouseEvent {
+ readonly attribute long movementX;
+ readonly attribute long movementY;
+};
+
+partial dictionary MouseEventInit {
+ long movementX = 0;
+ long movementY = 0;
+};
diff --git a/tests/wpt/web-platform-tests/interfaces/remote-playback.idl b/tests/wpt/web-platform-tests/interfaces/remote-playback.idl
new file mode 100644
index 00000000000..b1aa93d3f3c
--- /dev/null
+++ b/tests/wpt/web-platform-tests/interfaces/remote-playback.idl
@@ -0,0 +1,31 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the Remote Playback API spec.
+// See https://w3c.github.io/remote-playback/
+
+[Exposed=Window]
+interface RemotePlayback : EventTarget {
+ Promise watchAvailability(RemotePlaybackAvailabilityCallback callback);
+ Promise cancelWatchAvailability(optional long id);
+
+ readonly attribute RemotePlaybackState state;
+
+ attribute EventHandler onconnecting;
+ attribute EventHandler onconnect;
+ attribute EventHandler ondisconnect;
+
+ Promise prompt();
+};
+
+enum RemotePlaybackState {
+ "connecting",
+ "connected",
+ "disconnected"
+};
+
+callback RemotePlaybackAvailabilityCallback = void(boolean available);
+
+partial interface HTMLMediaElement {
+ [SameObject] readonly attribute RemotePlayback remote;
+
+ [CEReactions] attribute boolean disableRemotePlayback;
+};
diff --git a/tests/wpt/web-platform-tests/interfaces/remoteplayback.idl b/tests/wpt/web-platform-tests/interfaces/remoteplayback.idl
deleted file mode 100644
index 5cd9ba1a8a8..00000000000
--- a/tests/wpt/web-platform-tests/interfaces/remoteplayback.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-[Exposed=Window]
-interface RemotePlayback : EventTarget {
- Promise watchAvailability(RemotePlaybackAvailabilityCallback callback);
- Promise cancelWatchAvailability(optional long id);
-
- readonly attribute RemotePlaybackState state;
-
- attribute EventHandler onconnecting;
- attribute EventHandler onconnect;
- attribute EventHandler ondisconnect;
-
- Promise prompt();
-};
-
-enum RemotePlaybackState {
- "connecting",
- "connected",
- "disconnected"
-};
-
-callback RemotePlaybackAvailabilityCallback = void (boolean available);
-
-partial interface HTMLMediaElement {
- [SameObject]
- readonly attribute RemotePlayback remote;
-
- [CEReactions]
- attribute boolean disableRemotePlayback;
-};
diff --git a/tests/wpt/web-platform-tests/interfaces/staticrange.idl b/tests/wpt/web-platform-tests/interfaces/staticrange.idl
new file mode 100644
index 00000000000..5197e166cb4
--- /dev/null
+++ b/tests/wpt/web-platform-tests/interfaces/staticrange.idl
@@ -0,0 +1,24 @@
+// GENERATED CONTENT - DO NOT EDIT
+// Content of this file was automatically extracted from the Static Range spec.
+// See https://w3c.github.io/staticrange/
+
+dictionary StaticRangeInit {
+ required Node startContainer;
+ required unsigned long startOffset;
+ required Node endContainer;
+ required unsigned long endOffset;
+};
+
+[Constructor(StaticRangeInit initDict),
+ Exposed=Window]
+interface StaticRange {
+ attribute Node startContainer;
+ attribute unsigned long startOffset;
+
+ attribute Node endContainer;
+ attribute unsigned long endOffset;
+
+ readonly attribute boolean collapsed;
+
+ [NewObject] Range toRange();
+};
diff --git a/tests/wpt/web-platform-tests/lint.whitelist b/tests/wpt/web-platform-tests/lint.whitelist
index bfb5f034a12..f3bf0e1fe77 100644
--- a/tests/wpt/web-platform-tests/lint.whitelist
+++ b/tests/wpt/web-platform-tests/lint.whitelist
@@ -79,7 +79,7 @@ AHEM COPY: fonts/Ahem.ttf
# None of these are actually Ahem
AHEM COPY: fonts/ahem-extra/AHEM_*.TTF
-# https://github.com/w3c/web-platform-tests/issues/7437
+# https://github.com/web-platform-tests/wpt/issues/7437
AHEM COPY: css/vendor-imports/mozilla/mozilla-central-reftests/*/Ahem.ttf
## Test exclusions ##
@@ -765,7 +765,7 @@ MISSING-LINK: css/cssom-view/scrollIntoView-shadow.html
MISSING-LINK: css/cssom-view/scrollIntoView-smooth.html
MISSING-LINK: css/cssom-view/scrollTop-display-change.html
-# TODO https://github.com/w3c/web-platform-tests/issues/5770
+# TODO https://github.com/web-platform-tests/wpt/issues/5770
MISSING-LINK: css/geometry/*.worker.js
MISSING-LINK: css/filter-effects/*.any.js
diff --git a/tests/wpt/web-platform-tests/media-source/mediasource-append-buffer.html b/tests/wpt/web-platform-tests/media-source/mediasource-append-buffer.html
index f1866c005e5..7245f64ab86 100644
--- a/tests/wpt/web-platform-tests/media-source/mediasource-append-buffer.html
+++ b/tests/wpt/web-platform-tests/media-source/mediasource-append-buffer.html
@@ -586,6 +586,37 @@
test.done();
}, "Test appending after removeSourceBuffer().");
+ mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
+ {
+ // Media elements using MSE should not fire the stalled event. See discussion at
+ // https://github.com/w3c/media-source/issues/88#issuecomment-374406928
+ mediaElement.addEventListener("stalled", test.unreached_func("Unexpected 'stalled' event."));
+
+ // Prime the media element with initial appends.
+ var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
+ var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[0]);
+ test.expectEvent(sourceBuffer, "updateend", "initSegment append ended.");
+ sourceBuffer.appendBuffer(initSegment);
+ test.waitForExpectedEvents(function()
+ {
+ assert_equals(mediaSource.readyState, "open", "readyState is open after init segment appended.");
+ test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended.");
+ sourceBuffer.appendBuffer(mediaSegment);
+ });
+
+ // Verify state and wait for the 'stalled' event.
+ test.waitForExpectedEvents(function()
+ {
+ assert_equals(sourceBuffer.buffered.length, 1, "sourceBuffer has a buffered range");
+ assert_equals(mediaSource.readyState, "open", "readyState is open after media segment appended.");
+
+ // Set timeout to 4 seconds. This creates an opportunity for UAs to _improperly_ fire the stalled event.
+ // For media elements doing progressive download (not MSE), stalled is thrown after ~3 seconds of the
+ // download failing to progress.
+ test.step_timeout(function() { test.done(); }, 4000);
+ });
+ }, "Test slow appending does not trigger stalled events.");
+