Resync web-platform-tests/html/browsers from upstream
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jul 2020 19:54:27 +0000 (19:54 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jul 2020 19:54:27 +0000 (19:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=213892

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Resync web-platform-tests/html/browsers from upstream 145839c323ba1ec8b9737.

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/html/browsers/*: Updated.

LayoutTests:

* tests-options.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263856 268f45cc-cd09-0410-ab3c-d52691b4dbfc

97 files changed:
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/resources/resource-files.json
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/form.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/001.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/002.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_properties_only_fully_active-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_pushstate_err.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-history-interface/history_replacestate_err.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_assign.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/resources/reload_post_1-1.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/appcache/resources/appcache-data.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/appcache/resources/appcache-iframe.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/resources/appcache-worker-data.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/resources/appcache-worker-import.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/resources/appcache-worker.py
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/application-cache-api/api_swapcache_error.https.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/offline/application-cache-api/api_update_error.https.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/origin-of-data-document.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/sandboxing/sandbox-disallow-same-origin.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/security-window/window-security.https.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/same-origin-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child.sub.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child_remote.sub.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_grandchild.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-nested-navigate.window.js
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/document-domain-setter.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/w3c-import.log
LayoutTests/tests-options.json

index 2fa99b8..3e892a0 100644 (file)
@@ -1,3 +1,12 @@
+2020-07-02  Chris Dumez  <cdumez@apple.com>
+
+        Resync web-platform-tests/html/browsers from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=213892
+
+        Reviewed by Geoffrey Garen.
+
+        * tests-options.json:
+
 2020-07-02  Zalan Bujtas  <zalan@apple.com>
 
         Overlapping content on earny.co
index 7224493..e261b8e 100644 (file)
@@ -1,3 +1,16 @@
+2020-07-02  Chris Dumez  <cdumez@apple.com>
+
+        Resync web-platform-tests/html/browsers from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=213892
+
+        Reviewed by Geoffrey Garen.
+
+        Resync web-platform-tests/html/browsers from upstream 145839c323ba1ec8b9737.
+
+        * resources/import-expectations.json:
+        * resources/resource-files.json:
+        * web-platform-tests/html/browsers/*: Updated.
+
 2020-07-02  Zalan Bujtas  <zalan@apple.com>
 
         Overlapping content on earny.co
index f68275d..fb25dd5 100644 (file)
     "web-platform-tests/html-imports": "skip", 
     "web-platform-tests/html-longdesc": "skip", 
     "web-platform-tests/html-media-capture": "skip", 
+    "web-platform-tests/html/browsers": "import", 
     "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html": "skip", 
     "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html": "skip", 
     "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html": "skip", 
index b44b9e7..9fcb86e 100644 (file)
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/click.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/form.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/href.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/iframe-and-links.html",
         "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/set-child-loaded.html",
         "web-platform-tests/html/browsers/the-window-object/support/closed.html",
         "web-platform-tests/html/browsers/the-window-object/support/noopener-target.html",
         "web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html",
+        "web-platform-tests/html/browsers/the-window-object/support/same-origin-iframe.html",
         "web-platform-tests/html/browsers/the-window-object/support/sizing-target.html",
         "web-platform-tests/html/browsers/windows/browsing-context-names/001-1.html",
         "web-platform-tests/html/browsers/windows/browsing-context-names/002-1.html",
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html
new file mode 100644 (file)
index 0000000..50a9a50
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<script>
+parent.postMessage(document.readyState, "*");
+let f = document.createElement("iframe");
+f.onload = function() {
+  parent.postMessage("stop", "*");
+  window.stop();
+};
+document.documentElement.appendChild(f);
+
+window.addEventListener("load", (event) => {
+    parent.postMessage("load", "*");
+});
+window.addEventListener("error", (event) => {
+    parent.postMessage("error", "*");
+});
+window.addEventListener("abort", (event) => {
+    parent.postMessage("abort", "*");
+});
+window.addEventListener("pageshow", (event) => {
+    parent.postMessage("pageshow", "*");
+});
+window.addEventListener("DOMContentLoaded", (event) => {
+    parent.postMessage("DOMContentLoaded", "*");
+});
+document.addEventListener("readystatechange", (event) => {
+    if (document.readyState === "complete") {
+        parent.postMessage("complete", "*");
+    }
+});
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html
new file mode 100644 (file)
index 0000000..966b93c
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<script>
+parent.postMessage(document.readyState, "*");
+
+window.addEventListener("load", (event) => {
+    parent.postMessage("load", "*");
+});
+window.addEventListener("error", (event) => {
+    parent.postMessage("error", "*");
+});
+window.addEventListener("abort", (event) => {
+    parent.postMessage("abort", "*");
+});
+window.addEventListener("pageshow", (event) => {
+    parent.postMessage("pageshow", "*");
+});
+window.addEventListener("DOMContentLoaded", (event) => {
+    parent.postMessage("DOMContentLoaded", "*");
+});
+document.addEventListener("readystatechange", (event) => {
+    if (document.readyState === "complete") {
+        parent.postMessage("complete", "*");
+    }
+});
+
+window.setTimeout(function() {
+  parent.postMessage("stop", "*");
+  window.stop();
+}, 100);
+
+</script>
+<link rel="stylesheet" href="/common/slow.py"></link>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-expected.txt
new file mode 100644 (file)
index 0000000..9959f56
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL Aborting a Document load assert_array_equals: no load event was fired lengths differ, expected array ["loading", "DOMContentLoaded", "stop", "complete"] length 4, got ["loading", "stop"] length 2
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html
new file mode 100644 (file)
index 0000000..4a4c3df
--- /dev/null
@@ -0,0 +1,30 @@
+<!doctype html>
+<title>Aborting a Document load</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#aborting-a-document-load">
+<div id="log"></div>
+<script>
+var events = [];
+onmessage = function(e) {
+  events.push(e.data);
+};
+async_test(test => {
+  test.step_timeout(() => {
+    const frame = document.querySelector('iframe');
+    const child = frame.contentWindow;
+    assert_equals(child.document.readyState, 'complete', 'readyState is complete');
+    assert_array_equals(events, ["loading", "DOMContentLoaded", "stop", "complete"], 'no load event was fired');
+    events = [];
+    frame.src = "abort-document-load-2.html";
+
+    test.step_timeout(() => {
+      const child = frame.contentWindow;
+      assert_equals(child.document.readyState, 'complete', 'readyState is complete');
+      assert_array_equals(events, ["loading", "DOMContentLoaded", "stop", "complete"], 'no load event was fired');
+      test.done();
+    }, 1000);
+  }, 1000);
+});
+</script>
+<iframe src="abort-document-load-1.html"></iframe>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-expected.txt
new file mode 100644 (file)
index 0000000..42d355e
--- /dev/null
@@ -0,0 +1,5 @@
+
+Test
+
+PASS Anchor element with onclick form submission and href to fragment 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment-expected.txt
new file mode 100644 (file)
index 0000000..42d355e
--- /dev/null
@@ -0,0 +1,5 @@
+
+Test
+
+PASS Anchor element with onclick form submission and href to fragment 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html
new file mode 100644 (file)
index 0000000..8c4c770
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<link rel="help" href="https://html.spec.whatwg.org/C/#following-hyperlinks">
+<title>Anchor element with onclick form submission and href to fragment</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<!-- When an anchor element has an onclick handler which submits a form,
+  the anchor's navigation should occur instead of the form's navigation.
+  However, if the anchor has an href which is just a fragment like "#",
+  then the form should be submitted. Many sites rely on this behavior. -->
+
+<iframe name="test"></iframe>
+<form target="test" action="form.html"></form>
+<a id="anchor" target="test" onclick="document.forms[0].submit()" href="#fragment">Test</a>
+
+<script>
+async_test(t => {
+  const anchor = document.getElementById('anchor');
+  t.step(() => anchor.click());
+  window.onmessage = t.step_func(event => {
+    if (typeof event.data === 'string' && event.data.includes('navigation')) {
+      assert_equals(event.data, 'form navigation');
+      t.done();
+    }
+  });
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath-expected.txt
new file mode 100644 (file)
index 0000000..42d355e
--- /dev/null
@@ -0,0 +1,5 @@
+
+Test
+
+PASS Anchor element with onclick form submission and href to fragment 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html
new file mode 100644 (file)
index 0000000..b891623
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<link rel="help" href="https://html.spec.whatwg.org/C/#following-hyperlinks">
+<title>Anchor element with onclick form submission and href to fragment</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<!-- When an anchor element has an onclick handler which submits a form,
+  the anchor's navigation should occur instead of the form's navigation.
+  However, if the anchor has an href which is just a fragment like "#",
+  then the form should be submitted. Many sites rely on this behavior. -->
+
+<iframe name="test"></iframe>
+<form target="test" action="form.html"></form>
+<a id="anchor" target="test" onclick="document.forms[0].submit()">Test</a>
+
+<script>
+async_test(async t => {
+  const iframe = document.querySelector('iframe');
+  const iframeLoadPromise = new Promise(resolve => iframe.onload = resolve);
+  iframe.src = '/';
+  await iframeLoadPromise;
+
+  const anchor = document.getElementById('anchor');
+  anchor.href = '/#';
+  t.step(() => anchor.click());
+  window.onmessage = t.step_func(event => {
+    if (typeof event.data === 'string' && event.data.includes('navigation')) {
+      assert_equals(event.data, 'form navigation');
+      t.done();
+    }
+  });
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html
new file mode 100644 (file)
index 0000000..57e44f1
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<link rel="help" href="https://html.spec.whatwg.org/C/#following-hyperlinks">
+<title>Anchor element with onclick form submission and href to fragment</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<!-- When an anchor element has an onclick handler which submits a form,
+  the anchor's navigation should occur instead of the form's navigation.
+  However, if the anchor has an href which is just a fragment like "#",
+  then the form should be submitted. Many sites rely on this behavior. -->
+
+<iframe name="test"></iframe>
+<form target="test" action="form.html"></form>
+<a id="anchor" target="test" onclick="document.forms[0].submit()" href="#">Test</a>
+
+<script>
+async_test(t => {
+  const anchor = document.getElementById('anchor');
+  t.step(() => anchor.click());
+  window.onmessage = t.step_func(event => {
+    if (typeof event.data === 'string' && event.data.includes('navigation')) {
+      assert_equals(event.data, 'form navigation');
+      t.done();
+    }
+  });
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit-expected.txt
new file mode 100644 (file)
index 0000000..df505b5
--- /dev/null
@@ -0,0 +1,5 @@
+
+Test
+
+PASS Anchor element with onclick form submission and href to javascript: url 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html
new file mode 100644 (file)
index 0000000..b0534cd
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<link rel="help" href="https://html.spec.whatwg.org/C/#following-hyperlinks">
+<title>Anchor element with onclick form submission and href to javascript: url</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<!-- When an anchor element has an onclick handler which submits a form,
+  the anchor's navigation should occur instead of the form's navigation.
+  However, if the anchor has an href which returns undefined, then the form
+  should be submitted. -->
+
+<iframe name="test"></iframe>
+<form target="test" action="form.html"></form>
+<a id="anchor" target="test" onclick="document.forms[0].submit()" href="javascript:void(0)">Test</a>
+
+<script>
+async_test(t => {
+  const anchor = document.getElementById('anchor');
+  t.step(() => anchor.click());
+  window.onmessage = t.step_func(event => {
+    if (typeof event.data === 'string' && event.data.includes('navigation')) {
+      assert_equals(event.data, 'form navigation');
+      t.done();
+    }
+  });
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/form.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/form.html
new file mode 100644 (file)
index 0000000..6523a82
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<script>
+parent.postMessage("form navigation", "*");
+</script>
+form navigation
index 58e3827..ecdd24f 100644 (file)
@@ -1,4 +1,4 @@
 def main(request, response):
-    response.headers.set("Content-Type", "text/plain")
-    response.headers.set("Refresh", "0;./refreshed.txt?\x80\xFF") # Test byte to Unicode conversion
-    response.content = "Not refreshed.\n"
+    response.headers.set(b"Content-Type", b"text/plain")
+    response.headers.set(b"Refresh", b"0;./refreshed.txt?\x80\xFF") # Test byte to Unicode conversion
+    response.content = u"Not refreshed.\n"
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py
new file mode 100644 (file)
index 0000000..3c78c25
--- /dev/null
@@ -0,0 +1,4 @@
+def main(request, response):
+    location = request.GET.first(b"location")
+    response.status = 302
+    response.headers.set(b"Location", location)
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/w3c-import.log
new file mode 100644 (file)
index 0000000..d400632
--- /dev/null
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window-expected.txt
new file mode 100644 (file)
index 0000000..2de37e1
--- /dev/null
@@ -0,0 +1,10 @@
+
+FAIL Navigating a popup using window.open("data:text/html,...", "", "undefined") assert_true: expected true got false
+FAIL Navigating a popup using window.open("data:text/html,...", "", "opener") assert_true: expected true got false
+PASS Navigating a popup using window.open("data:text/html,...", "", "noopener") 
+PASS Navigating a popup using window.open("data:text/html,...", "", "noreferrer") 
+FAIL Navigating a popup using window.open("resources/redirect.py?location=data%3Atext%2Fhtml%2C...", "", "undefined") assert_true: expected true got false
+FAIL Navigating a popup using window.open("resources/redirect.py?location=data%3Atext%2Fhtml%2C...", "", "opener") assert_true: expected true got false
+PASS Navigating a popup using window.open("resources/redirect.py?location=data%3Atext%2Fhtml%2C...", "", "noopener") 
+PASS Navigating a popup using window.open("resources/redirect.py?location=data%3Atext%2Fhtml%2C...", "", "noreferrer") 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js
new file mode 100644 (file)
index 0000000..ca321f1
--- /dev/null
@@ -0,0 +1,20 @@
+// META: timeout=long
+
+const dataURL = `data:text/html,...`;
+const encodedDataURL = encodeURIComponent(dataURL);
+
+[dataURL, `resources/redirect.py?location=${encodedDataURL}`].forEach(url => {
+  [undefined, "opener", "noopener", "noreferrer"].forEach(opener => {
+    async_test(t => {
+      const popup = window.open(url, "", opener);
+      t.step_timeout(() => {
+        if (opener === "noopener" || opener == "noreferrer") {
+          assert_equals(popup, null);
+        } else {
+          assert_true(popup.closed);
+        }
+        t.done();
+      }, 1500);
+    }, `Navigating a popup using window.open("${url}", "", "${opener}")`);
+  });
+});
index 6282d66..89607dd 100644 (file)
@@ -40,6 +40,13 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/013.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/014.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/015.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html
@@ -52,6 +59,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/click.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/form.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/href.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-global-scope.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html
@@ -66,3 +74,4 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js
index 9df936e..7d4e994 100644 (file)
@@ -9,9 +9,9 @@
 <div id="&#x586f" style="position:absolute; top:100px;"></div>
 <div style="height:200vh;"></div>
 <script>
-assert_equals(document.characterSet, "GBK", "Document should be GBK encoded");
-assert_equals(location.hash, "", "Page must be loaded with no hash");
 async_test(test => {
+  assert_equals(document.characterSet, "GBK", "Document should be GBK encoded");
+  assert_equals(location.hash, "", "Page must be loaded with no hash");
   location.hash = '%89g';
   test.step_timeout(() => {
     assert_equals( document.scrollingElement.scrollTop, 0 );
index f87372a..d1986cb 100644 (file)
@@ -26,6 +26,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/navigate-helpers.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/replacement-enabled.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html
index ac8c800..6d48d10 100644 (file)
@@ -82,19 +82,19 @@ function reportload() {
     function tests4() {
         test(function () {
             //Firefox 4 beta 11 has a messed up error object, which does not have the right error type or .SECURITY_ERR property
-            assert_throws('SECURITY_ERR',function () { history.pushState('','','//exa mple'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.pushState('','','//exa mple'); });
         }, 'pushState must not be allowed to create invalid URLs');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.pushState('','','http://www.example.com/'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.pushState('','','http://www.example.com/'); });
         }, 'pushState must not be allowed to create cross-origin URLs');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.pushState('','','about:blank'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.pushState('','','about:blank'); });
         }, 'pushState must not be allowed to create cross-origin URLs (about:blank)');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.pushState('','','data:text/html,'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.pushState('','','data:text/html,'); });
         }, 'pushState must not be allowed to create cross-origin URLs (data:URI)');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { iframe.contentWindow.history.pushState('','','http://www.example.com/'); },iframe.contentWindow);
+            assert_throws_dom('SECURITY_ERR', iframe.contentWindow.DOMException, function () { iframe.contentWindow.history.pushState('','','http://www.example.com/'); });
         }, 'security errors are expected to be thrown in the context of the document that owns the history object');
         test(function () {
             iframe.contentWindow.location.hash = 'test2';
@@ -164,12 +164,12 @@ function reportload() {
             assert_equals( iframe.contentWindow.location.href, newURL );
         }, 'pushState must be able to set absolute URLs to the same host');
         test(function () {
-            assert_throws( 'DATA_CLONE_ERR', function () {
+            assert_throws_dom( 'DATA_CLONE_ERR', function () {
                 history.pushState({dummy:function () {}},'');
             } );
         }, 'pushState must not be able to use a function as data');
         test(function () {
-            assert_throws( 'DATA_CLONE_ERR', function () {
+            assert_throws_dom( 'DATA_CLONE_ERR', function () {
                 history.pushState({dummy:window},'');
             } );
         }, 'pushState must not be able to use a DOM node as data');
@@ -180,9 +180,9 @@ function reportload() {
             }
         }, 'pushState must be able to use an error object as data');
         test(function () {
-            assert_throws( 'DATA_CLONE_ERR', function () {
+            assert_throws_dom('DATA_CLONE_ERR', iframe.contentWindow.DOMException, function () {
                 iframe.contentWindow.history.pushState(document,'');
-            }, iframe.contentWindow );
+            });
         }, 'security errors are expected to be thrown in the context of the document that owns the history object (2)');
         cloneobj = {
             nulldata: null,
@@ -274,8 +274,8 @@ function reportload() {
             assert_false( cloneobj === iframe.contentWindow.history.state );
         }, 'history.state should be a clone of the original object, not a reference to it (2)');
         test(function () {
-            assert_false( iframe.contentWindow.history.state === ev.state );
-        }, 'history.state should be a separate clone of the object, not a reference to the object passed to the event handler');
+            assert_true( iframe.contentWindow.history.state === ev.state );
+        }, 'history.state should be identical to the object passed to the event handler unless history.state is updated');
         try {
             iframe.contentWindow.persistval = true;
             iframe.contentWindow.history.pushState('','', location.href.replace(/\/[^\/]*$/,'/blank3.html') );
index 431f6a5..c054246 100644 (file)
@@ -87,19 +87,19 @@ function reportload() {
             assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test2' );
         }, 'replaceState must replace the existing state without altering the forward history');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.replaceState('','','//exa mple'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.replaceState('','','//exa mple'); });
         }, 'replaceState must not be allowed to create invalid URLs');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.replaceState('','','http://www.example.com/'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.replaceState('','','http://www.example.com/'); });
         }, 'replaceState must not be allowed to create cross-origin URLs');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.replaceState('','','about:blank'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.replaceState('','','about:blank'); });
         }, 'replaceState must not be allowed to create cross-origin URLs (about:blank)');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { history.replaceState('','','data:text/html,'); });
+            assert_throws_dom('SECURITY_ERR',function () { history.replaceState('','','data:text/html,'); });
         }, 'replaceState must not be allowed to create cross-origin URLs (data:URI)');
         test(function () {
-            assert_throws('SECURITY_ERR',function () { iframe.contentWindow.history.replaceState('','','http://www.example.com/'); },iframe.contentWindow);
+            assert_throws_dom('SECURITY_ERR',iframe.contentWindow.DOMException,function () { iframe.contentWindow.history.replaceState('','','http://www.example.com/'); });
         }, 'security errors are expected to be thrown in the context of the document that owns the history object');
         test(function () {
             //avoids browsers running .go synchronously when only a hash change is involved
@@ -145,12 +145,12 @@ function reportload() {
             assert_false( hashchng );
         }, 'replaceState must not fire hashchange events');
         test(function () {
-            assert_throws( 'DATA_CLONE_ERR', function () {
+            assert_throws_dom( 'DATA_CLONE_ERR', function () {
                 history.replaceState({dummy:function () {}},'');
             } );
         }, 'replaceState must not be able to use a function as data');
         test(function () {
-            assert_throws( 'DATA_CLONE_ERR', function () {
+            assert_throws_dom( 'DATA_CLONE_ERR', function () {
                 history.replaceState({dummy:window},'');
             } );
         }, 'replaceState must not be able to use a DOM node as data');
@@ -161,9 +161,9 @@ function reportload() {
             }
         }, 'replaceState must be able to use an error object as data');
         test(function () {
-            assert_throws( 'DATA_CLONE_ERR', function () {
+            assert_throws_dom('DATA_CLONE_ERR', iframe.contentWindow.DOMException, function () {
                 iframe.contentWindow.history.replaceState(document,'');
-            }, iframe.contentWindow );
+            });
         }, 'security errors are expected to be thrown in the context of the document that owns the history object (2)');
         cloneobj = {
             nulldata: null,
@@ -249,8 +249,8 @@ function reportload() {
             assert_false( cloneobj === iframe.contentWindow.history.state );
         }, 'history.state should be a clone of the original object, not a reference to it (2)');
         test(function () {
-            assert_false( iframe.contentWindow.history.state === ev.state );
-        }, 'history.state should be a separate clone of the object, not a reference to the object passed to the event handler');
+            assert_true( iframe.contentWindow.history.state === ev.state );
+        }, 'history.state should be identical to the object passed to the event handler unless history.state is updated');
         try {
             iframe.contentWindow.persistval = true;
             iframe.contentWindow.history.replaceState('','', location.href.replace(/\/[^\/]*$/,'/blank3.html') );
index f76efdd..3667f1e 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL history properties should throw SecurityError when not in a fully active Document assert_throws: function "function () { cached_history.length; }" did not throw
+FAIL history properties should throw SecurityError when not in a fully active Document assert_throws_dom: function "function () { cached_history.length; }" did not throw
 
index 0404a6b..bc09507 100644 (file)
     var ifr = document.getElementById("child");
     var cached_history = ifr.contentWindow.history;
     ifr.remove();
-    assert_throws("SecurityError", function() { cached_history.length; });
-    assert_throws("SecurityError", function() { cached_history.scrollRestoration; });
-    assert_throws("SecurityError", function() { cached_history.state; });
-    assert_throws("SecurityError", function() { cached_history.go(0); });
-    assert_throws("SecurityError", function() { cached_history.back(); });
-    assert_throws("SecurityError", function() { cached_history.forward(); });
-    assert_throws("SecurityError", function() { cached_history.pushState(1, document.title, "?x=1"); });
-    assert_throws("SecurityError", function() { cached_history.replaceState(2, document.title, "?x=2"); });
+    assert_throws_dom("SecurityError", function() { cached_history.length; });
+    assert_throws_dom("SecurityError", function() { cached_history.scrollRestoration; });
+    assert_throws_dom("SecurityError", function() { cached_history.state; });
+    assert_throws_dom("SecurityError", function() { cached_history.go(0); });
+    assert_throws_dom("SecurityError", function() { cached_history.back(); });
+    assert_throws_dom("SecurityError", function() { cached_history.forward(); });
+    assert_throws_dom("SecurityError", function() { cached_history.pushState(1, document.title, "?x=1"); });
+    assert_throws_dom("SecurityError", function() { cached_history.replaceState(2, document.title, "?x=2"); });
   });
 </script>
index 82afc04..6fa0a85 100644 (file)
@@ -9,7 +9,7 @@
     <div id="log"></div>
     <script>
     test(function () {
-      assert_throws("SecurityError", function () {
+      assert_throws_dom("SecurityError", function () {
         window.history.pushState(1, document.title, 'http://www.microsoft.com/test.html');
       });
     }, "history pushState SECURITY_ERR");
index 3060cf1..15d2181 100644 (file)
@@ -9,7 +9,7 @@
     <div id="log"></div>
     <script>
     test(function () {
-      assert_throws("SecurityError", function () {
+      assert_throws_dom("SecurityError", function () {
         window.history.replaceState(1, document.title, 'http://www.microsoft.com/test.html');
       });
     }, "history replaceState SECURITY_ERR");
index ef92f7a..1afef46 100644 (file)
@@ -86,7 +86,7 @@ onmessage = (e) => {
   ]
   ;broken.forEach((val) => {
     test(() => {
-      assert_throws("SyntaxError", () => { location.protocol = val })
+      assert_throws_dom("SyntaxError", () => { location.protocol = val })
     }, encodeURI(val) + " (percent-encoded) is not a scheme")
   })
   let c = 0
index 6e5cf16..cc8ec86 100644 (file)
@@ -1,16 +1,9 @@
 CONSOLE MESSAGE: SecurityError: Attempted to use a non-registrable domain.
+CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
 
 
+Harness Error (FAIL), message = SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
+
 FAIL Same-origin-domain prerequisite check: the original prototype is accessible assert_not_equals: got disallowed value null
 PASS Same-origin-domain: setting the prototype to an empty object via Object.setPrototypeOf should throw a TypeError 
-FAIL Same-origin-domain: setting the prototype to an empty object via __proto__ should throw a TypeError assert_throws_js: function "function () {
-      target.__proto__ = newValue;
-    }" threw object "SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match." ("SecurityError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-PASS Same-origin-domain: setting the prototype to an empty object via Reflect.setPrototypeOf should return false 
-PASS Same-origin-domain: the prototype must still be null 
-PASS Same-origin-domain: setting the prototype to null via Object.setPrototypeOf should not throw 
-FAIL Same-origin-domain: setting the prototype to null via __proto__ should not throw Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
-PASS Same-origin-domain: setting the prototype to null via Reflect.setPrototypeOf should return true 
 
index c9b913d..950c753 100644 (file)
@@ -23,7 +23,7 @@ window.onload = () => {
     assert_not_equals(origProto, null);
   }, "Same-origin-domain prerequisite check: the original prototype is accessible");
 
-  testSettingImmutablePrototype("Same-origin-domain", targetLocation, origProto, { isSameOriginDomain: true });
+  testSettingImmutablePrototype("Same-origin-domain", targetLocation, origProto, { isSameOriginDomain: true }, frames[0]);
 
   done();
 };
index 7e18804..55f26d5 100644 (file)
@@ -18,7 +18,7 @@
 
     test(function () {
       var href = location.href;
-      assert_throws('SYNTAX_ERR', function() { location.assign("http://:"); });
+      assert_throws_dom('SYNTAX_ERR', function() { location.assign("http://:"); });
       assert_equals(location.href, href);
     }, "URL that fails to parse");
     </script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url-expected.txt
new file mode 100644 (file)
index 0000000..c21da6b
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS location_reload_javascript_url 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html
new file mode 100644 (file)
index 0000000..737cafb
--- /dev/null
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <title>location_reload_javascript_url</title>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+
+    <iframe></iframe>
+
+    <script>
+    async_test(function(t) {
+      const URL = "/common/blank.html";
+      const URL2 = "/common/blank.html#foo";
+      const JS_URL_TEXT = "javascript generated page";
+      const JS_URL = "javascript:'<html>" + JS_URL_TEXT + "</html>'";
+
+      var iframe = document.querySelector("iframe");
+      var count = 0;
+      iframe.onload = t.step_func(function() {
+        // The URL should initially be "blank.html", and then "blank.html#foo";
+        // The textContent of the iframe's document should initially be blank,
+        // then become js generated text, and then be blank again after reload.
+        switch (count) {
+        case 0:
+          assert_equals(iframe.contentWindow.document.URL,
+                        location.href.replace(location.pathname, URL),
+                        "iframe url (" + count + ")");
+          assert_equals(iframe.contentDocument.body.textContent, "",
+                        "text of blank page");
+          iframe.contentWindow.location = JS_URL;
+          iframe.contentWindow.location = URL2;
+          break;
+        case 1:
+          assert_equals(iframe.contentWindow.document.URL,
+                        location.href.replace(location.pathname, URL2),
+                        "iframe url (" + count + ")");
+          assert_equals(iframe.contentDocument.body.textContent,
+                        JS_URL_TEXT, "text of js generated page");
+          iframe.contentWindow.location.reload();
+          break;
+        case 2:
+          assert_equals(iframe.contentWindow.document.URL,
+                          location.href.replace(location.pathname, URL2),
+                          "iframe url (" + count + ")");
+          assert_equals(iframe.contentDocument.body.textContent, "",
+                        "text of blank page");
+          t.done();
+          break;
+        }
+        count++;
+      });
+      iframe.src = URL;
+    });
+    </script>
+
+  </body>
+</html>
index d2738ac..56397f0 100644 (file)
@@ -1,6 +1,6 @@
 def main(request, response):
-    headers = [("Content-Type", "text/html")]
-    return headers, '''
+    headers = [(b"Content-Type", b"text/html")]
+    return headers, u'''
         <script>
             onload = function() {opener.next()}
             document.write(Math.random());
index cdacfb1..da4dbe1 100644 (file)
@@ -51,6 +51,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_protocol.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload-iframe.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_replace.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_search.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/no-browsing-context.window.js
index f92c511..c364bff 100644 (file)
@@ -1,5 +1,5 @@
 def main(request, response):
-    type = request.GET['type']
-    if request.GET['type'] == 'fallingback':
-        return 404, [('Content-Type', 'text/plain')], "Page not found"
-    return [('Content-Type', 'text/plain')], type
+    type = request.GET[b'type']
+    if request.GET[b'type'] == b'fallingback':
+        return 404, [(b'Content-Type', b'text/plain')], u"Page not found"
+    return [(b'Content-Type', b'text/plain')], type
index bc82788..6a5fd59 100644 (file)
@@ -1,4 +1,4 @@
-script = '''
+script = b'''
 <script>
 function fetchCachedFileTest() {
   return fetch('appcache-data.py?type=cached')
@@ -37,7 +37,7 @@ fetchCachedFileTest()
 '''
 
 def main(request, response):
-    type = request.GET['type']
-    if request.GET['type'] == 'fallingback':
-        return 404, [('Content-Type', 'text/plain')], "Page not found"
-    return [('Content-Type', 'text/html')], script % type
+    type = request.GET[b'type']
+    if request.GET[b'type'] == b'fallingback':
+        return 404, [(b'Content-Type', b'text/plain')], u"Page not found"
+    return [(b'Content-Type', b'text/html')], script % type
index f92c511..c364bff 100644 (file)
@@ -1,5 +1,5 @@
 def main(request, response):
-    type = request.GET['type']
-    if request.GET['type'] == 'fallingback':
-        return 404, [('Content-Type', 'text/plain')], "Page not found"
-    return [('Content-Type', 'text/plain')], type
+    type = request.GET[b'type']
+    if request.GET[b'type'] == b'fallingback':
+        return 404, [(b'Content-Type', b'text/plain')], u"Page not found"
+    return [(b'Content-Type', b'text/plain')], type
index 650975b..73ccbc3 100644 (file)
@@ -1,7 +1,7 @@
-script = 'info = \'Set by the %s script\';'
+script = b'info = \'Set by the %s script\';'
 
 def main(request, response):
-    type = request.GET['type']
-    if request.GET['type'] == 'fallingback':
-        return 404, [('Content-Type', 'text/plain')], "Page not found"
-    return [('Content-Type', 'text/javascript')], script % type
+    type = request.GET[b'type']
+    if request.GET[b'type'] == b'fallingback':
+        return 404, [(b'Content-Type', b'text/plain')], u"Page not found"
+    return [(b'Content-Type', b'text/javascript')], script % type
index 1064321..4f99038 100644 (file)
@@ -1,4 +1,4 @@
-script = '''
+script = b'''
 var initPromise = Promise.resolve();
 
 if ('SharedWorkerGlobalScope' in self &&
@@ -97,7 +97,7 @@ initPromise
 '''
 
 def main(request, response):
-    type = request.GET['type']
-    if request.GET['type'] == 'fallingback':
-        return 404, [('Content-Type', 'text/plain')], "Page not found"
-    return [('Content-Type', 'text/javascript')], script % type
+    type = request.GET[b'type']
+    if request.GET[b'type'] == b'fallingback':
+        return 404, [(b'Content-Type', b'text/plain')], u"Page not found"
+    return [(b'Content-Type', b'text/javascript')], script % type
index 02e7b3c..4e069d7 100644 (file)
@@ -12,7 +12,7 @@
       var cache = window.applicationCache;
 
       test(function() {
-        assert_throws("INVALID_STATE_ERR", function(){cache.swapCache();});
+        assert_throws_dom("INVALID_STATE_ERR", function(){cache.swapCache();});
       }, "INVALID_STATE_ERR error test")
     </script>
   </body>
index 469baea..4638693 100644 (file)
@@ -11,7 +11,7 @@
     <script>
       var cache = window.applicationCache;
       test(function() {
-        assert_throws("INVALID_STATE_ERR", function(){cache.update();});
+        assert_throws_dom("INVALID_STATE_ERR", function(){cache.update();});
       }, "INVALID_STATE_ERR error test")
     </script>
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only-expected.txt
new file mode 100644 (file)
index 0000000..838f350
--- /dev/null
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://localhost:8800". The frame being accessed set "document.domain" to "localhost", but the frame requesting access did not. Both must set "document.domain" to the same value to allow access.
+
+PASS Cross-origin due to document.domain 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html
new file mode 100644 (file)
index 0000000..425374f
--- /dev/null
@@ -0,0 +1,33 @@
+<!doctype html>
+<title>Cross-origin due to document.domain</title>
+<meta charset=utf-8>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<iframe src=resources/cross-origin-due-to-document-domain-only-helper.html></iframe>
+<script>
+async_test(t => {
+  onload = t.step_func_done(() => {
+    const frame = document.querySelector("iframe");
+    const innerSelf = self[0];
+    const innerLocation = innerSelf.location;
+    const innerDocument = innerSelf.document;
+    assert_equals(innerLocation.host, location.host);
+    assert_true(innerSelf.expandosForever);
+    assert_true(innerLocation.expandosForever);
+    assert_equals(frame.contentWindow, innerSelf);
+    assert_equals(frame.contentDocument, innerDocument);
+    innerSelf.setDocumentDomain();
+    assert_throws_dom("SecurityError", () => innerSelf.expandosForever);
+    assert_throws_dom("SecurityError", () => innerLocation.expandosForever);
+    assert_throws_dom("SecurityError", () => innerLocation.host);
+    assert_equals(innerSelf.parent, self);
+    assert_throws_dom("SecurityError", () => innerSelf.frameElement);
+    assert_throws_dom("SecurityError", () => innerLocation.reload());
+    assert_equals(frame.contentWindow, innerSelf);
+    assert_equals(frame.contentDocument, null);
+    // Cross-origin Document object obtained before it became cross-origin has no protections
+    assert_equals(innerDocument.URL, frame.src);
+  });
+});
+</script>
index da912b5..009890a 100644 (file)
@@ -21,12 +21,12 @@ CONSOLE MESSAGE: Unable to post message to http://localhost:8800. Recipient has
 PASS Basic sanity-checking (cross-origin) 
 PASS Basic sanity-checking (same-origin + document.domain) 
 PASS Basic sanity-checking (cross-site) 
-PASS Only whitelisted properties are accessible cross-origin (cross-origin) 
-PASS Only whitelisted properties are accessible cross-origin (same-origin + document.domain) 
-PASS Only whitelisted properties are accessible cross-origin (cross-site) 
-PASS Only whitelisted properties are usable as cross-origin this objects (cross-origin) 
-PASS Only whitelisted properties are usable as cross-origin this objects (same-origin + document.domain) 
-PASS Only whitelisted properties are usable as cross-origin this objects (cross-site) 
+PASS Only certain properties are accessible cross-origin (cross-origin) 
+PASS Only certain properties are accessible cross-origin (same-origin + document.domain) 
+PASS Only certain properties are accessible cross-origin (cross-site) 
+PASS Only certain properties are usable as cross-origin this objects (cross-origin) 
+PASS Only certain properties are usable as cross-origin this objects (same-origin + document.domain) 
+PASS Only certain properties are usable as cross-origin this objects (cross-site) 
 PASS [[GetPrototypeOf]] should return null (cross-origin) 
 PASS [[GetPrototypeOf]] should return null (same-origin + document.domain) 
 PASS [[GetPrototypeOf]] should return null (cross-site) 
index f16a18d..1d45606 100644 (file)
@@ -135,7 +135,7 @@ function addPromiseThenTest(func, desc) {
 }
 
 /*
- * Basic sanity testing.
+ * Basic smoke tests for same-origin and cross-origin behaviors.
  */
 
 addTest(function(win) {
@@ -145,7 +145,7 @@ addTest(function(win) {
   assert_equals(B.parent, window, "window.parent works same-origin");
   assert_equals(win.parent, window, "window.parent works cross-origin");
   assert_equals(B.location.pathname, path, "location.href works same-origin");
-  assert_throws("SecurityError", function() { win.location.pathname; }, "location.pathname throws cross-origin");
+  assert_throws_dom("SecurityError", function() { win.location.pathname; }, "location.pathname throws cross-origin");
   assert_equals(B.frames, 'override', "Overrides visible in the same-origin case");
   assert_equals(win.frames, win, "Overrides invisible in the cross-origin case");
   assert_equals(B.focus, 'override', "Overrides visible in the same-origin case");
@@ -154,14 +154,14 @@ addTest(function(win) {
 }, "Basic sanity-checking");
 
 /*
- * Whitelist behavior.
+ * Tests regarding which properties are allowed cross-origin.
  *
  * Also tests for [[GetOwnProperty]] and [[HasOwnProperty]] behavior.
  */
 
-var whitelistedSymbols = [Symbol.toStringTag, Symbol.hasInstance,
+var allowedSymbols = [Symbol.toStringTag, Symbol.hasInstance,
                           Symbol.isConcatSpreadable];
-var windowWhitelists = {
+var windowAllowlists = {
   namedFrames: ['donotleakme'],
   indices: ['0', '1'],
   getters: ['location', 'window', 'frames', 'self', 'top', 'parent',
@@ -174,22 +174,22 @@ var windowWhitelists = {
   // otherwise throw. They are not, however, cross-origin accessible.
   promiseMethods: ['createImageBitmap', 'fetch'],
 }
-windowWhitelists.propNames = Array.from(new Set([...windowWhitelists.indices,
-                                                 ...windowWhitelists.getters,
-                                                 ...windowWhitelists.setters,
-                                                 ...windowWhitelists.methods,
+windowAllowlists.propNames = Array.from(new Set([...windowAllowlists.indices,
+                                                 ...windowAllowlists.getters,
+                                                 ...windowAllowlists.setters,
+                                                 ...windowAllowlists.methods,
                                                  'then'])).sort();
-windowWhitelists.props = windowWhitelists.propNames.concat(whitelistedSymbols);
+windowAllowlists.props = windowAllowlists.propNames.concat(allowedSymbols);
 
-var locationWhitelists = {
+var locationAllowlists = {
   getters: [],
   setters: ['href'],
   methods: ['replace'],
   promiseMethods: [],
 }
-locationWhitelists.propNames = Array.from(new Set([...locationWhitelists.getters,
-                                                   ...locationWhitelists.setters,
-                                                   ...locationWhitelists.methods,
+locationAllowlists.propNames = Array.from(new Set([...locationAllowlists.getters,
+                                                   ...locationAllowlists.setters,
+                                                   ...locationAllowlists.methods,
                                                    'then'])).sort();
 
 // Define various sets of arguments to call cross-origin methods with. Arguments
@@ -216,21 +216,21 @@ var methodArgs = new Map(Object.entries({
 
 addTest(function(win) {
   for (var prop in window) {
-    if (windowWhitelists.props.indexOf(prop) != -1) {
+    if (windowAllowlists.props.indexOf(prop) != -1) {
       win[prop]; // Shouldn't throw.
       Object.getOwnPropertyDescriptor(win, prop); // Shouldn't throw.
       assert_true(Object.prototype.hasOwnProperty.call(win, prop), "hasOwnProperty for " + String(prop));
     } else {
-      assert_throws("SecurityError", function() { win[prop]; }, "Should throw when accessing " + String(prop) + " on Window");
-      assert_throws("SecurityError", function() { Object.getOwnPropertyDescriptor(win, prop); },
-                    "Should throw when accessing property descriptor for " + prop + " on Window");
-      assert_throws("SecurityError", function() { Object.prototype.hasOwnProperty.call(win, prop); },
-                    "Should throw when invoking hasOwnProperty for " + prop + " on Window");
+      assert_throws_dom("SecurityError", function() { win[prop]; }, "Should throw when accessing " + String(prop) + " on Window");
+      assert_throws_dom("SecurityError", function() { Object.getOwnPropertyDescriptor(win, prop); },
+                        "Should throw when accessing property descriptor for " + prop + " on Window");
+      assert_throws_dom("SecurityError", function() { Object.prototype.hasOwnProperty.call(win, prop); },
+                        "Should throw when invoking hasOwnProperty for " + prop + " on Window");
     }
     if (prop != 'location')
-      assert_throws("SecurityError", function() { win[prop] = undefined; }, "Should throw when writing to " + prop + " on Window");
+      assert_throws_dom("SecurityError", function() { win[prop] = undefined; }, "Should throw when writing to " + prop + " on Window");
   }
-  for (var prop of windowWhitelists.namedFrames) {
+  for (var prop of windowAllowlists.namedFrames) {
     win[prop]; // Shouldn't throw.
     Object.getOwnPropertyDescriptor(win, prop); // Shouldn't throw.
     assert_true(Object.prototype.hasOwnProperty.call(win, prop), "hasOwnProperty for " + String(prop));
@@ -240,27 +240,27 @@ addTest(function(win) {
       win.location[prop]; // Shouldn't throw.
       Object.getOwnPropertyDescriptor(win.location, prop); // Shouldn't throw.
       assert_true(Object.prototype.hasOwnProperty.call(win.location, prop), "hasOwnProperty for " + prop);
-      assert_throws("SecurityError", function() { win.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
+      assert_throws_dom("SecurityError", function() { win.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
     }
     else if (prop == 'href') {
       Object.getOwnPropertyDescriptor(win.location, prop); // Shouldn't throw.
       assert_true(Object.prototype.hasOwnProperty.call(win.location, prop), "hasOwnProperty for " + prop);
-      assert_throws("SecurityError", function() { win.location[prop] },
-                    "Should throw reading href on Location");
+      assert_throws_dom("SecurityError", function() { win.location[prop] },
+                        "Should throw reading href on Location");
     }
     else {
-      assert_throws("SecurityError", function() { win.location[prop]; }, "Should throw when accessing " + prop + " on Location");
-      assert_throws("SecurityError", function() { Object.getOwnPropertyDescriptor(win.location, prop); },
-                    "Should throw when accessing property descriptor for " + prop + " on Location");
-      assert_throws("SecurityError", function() { Object.prototype.hasOwnProperty.call(win.location, prop); },
-                    "Should throw when invoking hasOwnProperty for " + prop + " on Location");
-      assert_throws("SecurityError", function() { win.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
+      assert_throws_dom("SecurityError", function() { win.location[prop]; }, "Should throw when accessing " + prop + " on Location");
+      assert_throws_dom("SecurityError", function() { Object.getOwnPropertyDescriptor(win.location, prop); },
+                        "Should throw when accessing property descriptor for " + prop + " on Location");
+      assert_throws_dom("SecurityError", function() { Object.prototype.hasOwnProperty.call(win.location, prop); },
+                        "Should throw when invoking hasOwnProperty for " + prop + " on Location");
+      assert_throws_dom("SecurityError", function() { win.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
     }
   }
-}, "Only whitelisted properties are accessible cross-origin");
+}, "Only certain properties are accessible cross-origin");
 
 addPromiseTest(async function(win, test_obj) {
-  async function checkProperties(objName, whitelists) {
+  async function checkProperties(objName, allowedlists) {
     var localObj = window[objName];
     var otherObj = win[objName];
 
@@ -273,13 +273,13 @@ addPromiseTest(async function(win, test_obj) {
 
       if ("value" in desc) {
         if (typeof desc.value === "function" && String(desc.value).includes("[native code]")) {
-          if (whitelists.promiseMethods.includes(prop)) {
-            await promise_rejects(test_obj, "SecurityError", desc.value.call(otherObj),
+          if (allowedlists.promiseMethods.includes(prop)) {
+            await promise_rejects_dom(test_obj, "SecurityError", desc.value.call(otherObj),
                                   `Should throw when calling ${objName}.${prop} with cross-origin this object`);
-          } else if (!whitelists.methods.includes(prop)) {
+          } else if (!allowedlists.methods.includes(prop)) {
             for (let args of methodArgs.get(prop) || [[]]) {
-              assert_throws("SecurityError", desc.value.bind(otherObj, ...args),
-                            `Should throw when calling ${objName}.${prop} with cross-origin this object`);
+              assert_throws_dom("SecurityError", desc.value.bind(otherObj, ...args),
+                                `Should throw when calling ${objName}.${prop} with cross-origin this object`);
             }
 
           } else {
@@ -290,28 +290,28 @@ addPromiseTest(async function(win, test_obj) {
         }
       } else {
         if (desc.get) {
-          if (whitelists.getters.includes(prop)) {
+          if (allowedlists.getters.includes(prop)) {
             desc.get.call(otherObj); // Shouldn't throw.
           } else {
-            assert_throws("SecurityError", desc.get.bind(otherObj),
-                          `Should throw when calling ${objName}.${prop} getter with cross-origin this object`);
+            assert_throws_dom("SecurityError", desc.get.bind(otherObj),
+                              `Should throw when calling ${objName}.${prop} getter with cross-origin this object`);
           }
         }
         if (desc.set) {
-          if (whitelists.setters.includes(prop)) {
+          if (allowedlists.setters.includes(prop)) {
             desc.set.call(otherObj, "javascript:undefined"); // Shouldn't throw.
           } else {
-            assert_throws("SecurityError", desc.set.bind(otherObj, "foo"),
-                          `Should throw when calling ${objName}.${prop} setter with cross-origin this object`);
+            assert_throws_dom("SecurityError", desc.set.bind(otherObj, "foo"),
+                              `Should throw when calling ${objName}.${prop} setter with cross-origin this object`);
           }
         }
       }
     }
   }
 
-  await checkProperties("location", locationWhitelists);
-  await checkProperties("window", windowWhitelists);
-}, "Only whitelisted properties are usable as cross-origin this objects");
+  await checkProperties("location", locationAllowlists);
+  await checkProperties("window", windowAllowlists);
+}, "Only certain properties are usable as cross-origin this objects");
 
 /*
  * ES Internal Methods.
@@ -326,8 +326,8 @@ addTest(function(win) {
   var protoGetter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').get;
   assert_equals(protoGetter.call(win), null, "cross-origin Window proto is null");
   assert_equals(protoGetter.call(win.location), null, "cross-origin Location proto is null (__proto__)");
-  assert_throws("SecurityError", function() { win.__proto__; }, "__proto__ property not available cross-origin");
-  assert_throws("SecurityError", function() { win.location.__proto__; }, "__proto__ property not available cross-origin");
+  assert_throws_dom("SecurityError", function() { win.__proto__; }, "__proto__ property not available cross-origin");
+  assert_throws_dom("SecurityError", function() { win.location.__proto__; }, "__proto__ property not available cross-origin");
 
 }, "[[GetPrototypeOf]] should return null");
 
@@ -335,14 +335,14 @@ addTest(function(win) {
  * [[SetPrototypeOf]]
  */
 addTest(function(win) {
-  assert_throws("SecurityError", function() { win.__proto__ = new Object(); }, "proto set on cross-origin Window");
-  assert_throws("SecurityError", function() { win.location.__proto__ = new Object(); }, "proto set on cross-origin Location");
+  assert_throws_dom("SecurityError", function() { win.__proto__ = new Object(); }, "proto set on cross-origin Window");
+  assert_throws_dom("SecurityError", function() { win.location.__proto__ = new Object(); }, "proto set on cross-origin Location");
   var setters = [Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set];
   if (Object.setPrototypeOf)
     setters.push(function(p) { Object.setPrototypeOf(this, p); });
   setters.forEach(function(protoSetter) {
-    assert_throws(new TypeError, function() { protoSetter.call(win, new Object()); }, "proto setter |call| on cross-origin Window");
-    assert_throws(new TypeError, function() { protoSetter.call(win.location, new Object()); }, "proto setter |call| on cross-origin Location");
+    assert_throws_js(TypeError, function() { protoSetter.call(win, new Object()); }, "proto setter |call| on cross-origin Window");
+    assert_throws_js(TypeError, function() { protoSetter.call(win.location, new Object()); }, "proto setter |call| on cross-origin Location");
   });
   // Hack to avoid "duplicate test name" harness issues.
   setters.forEach(function(protoSetter) {
@@ -375,10 +375,10 @@ addTest(function(win) {
  * [[PreventExtensions]]
  */
 addTest(function(win) {
-  assert_throws(new TypeError, function() { Object.preventExtensions(win) },
-                "preventExtensions on cross-origin Window should throw");
-  assert_throws(new TypeError, function() { Object.preventExtensions(win.location) },
-                "preventExtensions on cross-origin Location should throw");
+  assert_throws_js(TypeError, function() { Object.preventExtensions(win) },
+                   "preventExtensions on cross-origin Window should throw");
+  assert_throws_js(TypeError, function() { Object.preventExtensions(win.location) },
+                   "preventExtensions on cross-origin Location should throw");
 }, "[[PreventExtensions]] should throw for cross-origin objects");
 
 /*
@@ -418,14 +418,14 @@ function checkPropertyDescriptor(desc, propName, expectWritable) {
 }
 
 addTest(function(win) {
-  windowWhitelists.props.forEach(function(prop) {
+  windowAllowlists.props.forEach(function(prop) {
     var desc = Object.getOwnPropertyDescriptor(win, prop);
     checkPropertyDescriptor(desc, prop, prop == 'location');
   });
   checkPropertyDescriptor(Object.getOwnPropertyDescriptor(win.location, 'replace'), 'replace', false);
   checkPropertyDescriptor(Object.getOwnPropertyDescriptor(win.location, 'href'), 'href', true);
   assert_equals(typeof Object.getOwnPropertyDescriptor(win.location, 'href').get, 'undefined', "Cross-origin location should have no href getter");
-  whitelistedSymbols.forEach(function(prop) {
+  allowedSymbols.forEach(function(prop) {
     var desc = Object.getOwnPropertyDescriptor(win.location, prop);
     checkPropertyDescriptor(desc, prop, false);
   });
@@ -443,7 +443,7 @@ addThenTest(function(win) {
 addTest(function(win) {
   assert_equals(typeof Object.getOwnPropertyDescriptor(win, '0').value, "object");
   assert_equals(typeof Object.getOwnPropertyDescriptor(win, '1').value, "object");
-  assert_throws("SecurityError", function() {
+  assert_throws_dom("SecurityError", function() {
     Object.getOwnPropertyDescriptor(win, '2');
   });
 }, "[[GetOwnProperty]] - Should be able to get a property descriptor for an indexed property only if it corresponds to a child window.");
@@ -452,17 +452,17 @@ addTest(function(win) {
  * [[Delete]]
  */
 addTest(function(win) {
-  assert_throws("SecurityError", function() { delete win[0]; }, "Can't delete cross-origin indexed property");
-  assert_throws("SecurityError", function() { delete win[100]; }, "Can't delete cross-origin indexed property");
-  assert_throws("SecurityError", function() { delete win.location; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.parent; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.length; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.document; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.foopy; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.location.href; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.location.replace; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.location.port; }, "Can't delete cross-origin property");
-  assert_throws("SecurityError", function() { delete win.location.foopy; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win[0]; }, "Can't delete cross-origin indexed property");
+  assert_throws_dom("SecurityError", function() { delete win[100]; }, "Can't delete cross-origin indexed property");
+  assert_throws_dom("SecurityError", function() { delete win.location; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.parent; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.length; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.document; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.foopy; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.location.href; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.location.replace; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.location.port; }, "Can't delete cross-origin property");
+  assert_throws_dom("SecurityError", function() { delete win.location.foopy; }, "Can't delete cross-origin property");
 }, "[[Delete]] Should throw on cross-origin objects");
 
 /*
@@ -471,8 +471,8 @@ addTest(function(win) {
 function checkDefine(obj, prop) {
   var valueDesc = { configurable: true, enumerable: false, writable: false, value: 2 };
   var accessorDesc = { configurable: true, enumerable: false, get: function() {} };
-  assert_throws("SecurityError", function() { Object.defineProperty(obj, prop, valueDesc); }, "Can't define cross-origin value property " + prop);
-  assert_throws("SecurityError", function() { Object.defineProperty(obj, prop, accessorDesc); }, "Can't define cross-origin accessor property " + prop);
+  assert_throws_dom("SecurityError", function() { Object.defineProperty(obj, prop, valueDesc); }, "Can't define cross-origin value property " + prop);
+  assert_throws_dom("SecurityError", function() { Object.defineProperty(obj, prop, accessorDesc); }, "Can't define cross-origin accessor property " + prop);
 }
 addTest(function(win) {
   checkDefine(win, 'length');
@@ -494,9 +494,9 @@ addTest(function(win) {
   let i = 0;
   for (var prop in win) {
     i++;
-    assert_true(windowWhitelists.indices.includes(prop), prop + " is not safelisted for a cross-origin Window");
+    assert_true(windowAllowlists.indices.includes(prop), prop + " is not safelisted for a cross-origin Window");
   }
-  assert_equals(i, windowWhitelists.indices.length, "Enumerate all enumerable safelisted cross-origin Window properties");
+  assert_equals(i, windowAllowlists.indices.length, "Enumerate all enumerable safelisted cross-origin Window properties");
   i = 0;
   for (var prop in win.location) {
     i++;
@@ -510,48 +510,48 @@ addTest(function(win) {
 
 addTest(function(win) {
   assert_array_equals(Object.getOwnPropertyNames(win).sort(),
-                      windowWhitelists.propNames,
+                      windowAllowlists.propNames,
                       "Object.getOwnPropertyNames() gives the right answer for cross-origin Window");
   assert_array_equals(Object.keys(win).sort(),
-                      windowWhitelists.indices,
+                      windowAllowlists.indices,
                       "Object.keys() gives the right answer for cross-origin Window");
   assert_array_equals(Object.getOwnPropertyNames(win.location).sort(),
-                      locationWhitelists.propNames,
+                      locationAllowlists.propNames,
                       "Object.getOwnPropertyNames() gives the right answer for cross-origin Location");
   assert_equals(Object.keys(win.location).length, 0,
                       "Object.keys() gives the right answer for cross-origin Location");
 }, "[[OwnPropertyKeys]] should return all properties from cross-origin objects");
 
 addTest(function(win) {
-  assert_array_equals(Object.getOwnPropertySymbols(win), whitelistedSymbols,
+  assert_array_equals(Object.getOwnPropertySymbols(win), allowedSymbols,
     "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Window");
   assert_array_equals(Object.getOwnPropertySymbols(win.location),
-                      whitelistedSymbols,
+                      allowedSymbols,
     "Object.getOwnPropertySymbols() should return the three symbol-named properties that are exposed on a cross-origin Location");
 }, "[[OwnPropertyKeys]] should return the right symbol-named properties for cross-origin objects");
 
 addTest(function(win) {
   var allWindowProps = Reflect.ownKeys(win);
-  indexedWindowProps = allWindowProps.slice(0, windowWhitelists.indices.length);
-  stringWindowProps = allWindowProps.slice(0, -1 * whitelistedSymbols.length);
-  symbolWindowProps = allWindowProps.slice(-1 * whitelistedSymbols.length);
+  indexedWindowProps = allWindowProps.slice(0, windowAllowlists.indices.length);
+  stringWindowProps = allWindowProps.slice(0, -1 * allowedSymbols.length);
+  symbolWindowProps = allWindowProps.slice(-1 * allowedSymbols.length);
   // stringWindowProps should have "then" last in this case.  Do this
   // check before we call stringWindowProps.sort() below.
   assert_equals(stringWindowProps[stringWindowProps.length - 1], "then",
                 "'then' property should be added to the end of the string list if not there");
-  assert_array_equals(indexedWindowProps, windowWhitelists.indices,
+  assert_array_equals(indexedWindowProps, windowAllowlists.indices,
                       "Reflect.ownKeys should start with the indices exposed on the cross-origin window.");
-  assert_array_equals(stringWindowProps.sort(), windowWhitelists.propNames,
+  assert_array_equals(stringWindowProps.sort(), windowAllowlists.propNames,
                       "Reflect.ownKeys should continue with the cross-origin window properties for a cross-origin Window.");
-  assert_array_equals(symbolWindowProps, whitelistedSymbols,
+  assert_array_equals(symbolWindowProps, allowedSymbols,
                       "Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Window.");
 
   var allLocationProps = Reflect.ownKeys(win.location);
-  stringLocationProps = allLocationProps.slice(0, -1 * whitelistedSymbols.length);
-  symbolLocationProps = allLocationProps.slice(-1 * whitelistedSymbols.length);
-  assert_array_equals(stringLocationProps.sort(), locationWhitelists.propNames,
+  stringLocationProps = allLocationProps.slice(0, -1 * allowedSymbols.length);
+  symbolLocationProps = allLocationProps.slice(-1 * allowedSymbols.length);
+  assert_array_equals(stringLocationProps.sort(), locationAllowlists.propNames,
                       "Reflect.ownKeys should start with the cross-origin window properties for a cross-origin Location.")
-  assert_array_equals(symbolLocationProps, whitelistedSymbols,
+  assert_array_equals(symbolLocationProps, allowedSymbols,
                       "Reflect.ownKeys should end with the cross-origin symbols for a cross-origin Location.")
 }, "[[OwnPropertyKeys]] should place the symbols after the property names after the subframe indices");
 
@@ -670,10 +670,10 @@ addTest(function(win) {
 
   // Check that applying it to a cross-origin window throws instead of doing
   // the [LenientThis] behavior.
-  assert_throws("SecurityError", () => {
+  assert_throws_dom("SecurityError", () => {
     desc.get.call(win);
   }, "Should throw when getting cross-origin");
-  assert_throws("SecurityError", () => {
+  assert_throws_dom("SecurityError", () => {
     desc.set.call(win, f);
   }, "Should throw when setting cross-origin");
 }, "LenientThis behavior");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html
new file mode 100644 (file)
index 0000000..10ac8ec
--- /dev/null
@@ -0,0 +1,9 @@
+<!doctype html>
+<meta charset=utf-8>
+<script>
+self.expandosForever = true
+self.location.expandosForever = true
+function setDocumentDomain() {
+  document.domain = document.domain
+}
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/w3c-import.log
new file mode 100644 (file)
index 0000000..56c12de
--- /dev/null
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html
index 7bc5af1..df7b8f2 100644 (file)
@@ -14,6 +14,7 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/frame-with-then.html
index d6b6d53..448f47f 100644 (file)
@@ -17,7 +17,7 @@
 
         window.addEventListener("message", t.step_func_done(function (e) {
           assert_equals(e.origin, "null", "Messages sent from a 'data:' URL should have an opaque origin (which serializes to 'null').");
-          assert_throws("SecurityError", function () {
+          assert_throws_dom("SecurityError", function () {
             var couldAccessCrossOriginProperty = e.source.location.href;
           }, "The 'data:' frame should be cross-origin: 'window.location.href'");
           assert_equals(i.contentDocument, null, "The 'data:' iframe should be unable to access its contentDocument.");
index 690973e..0cb69de 100644 (file)
@@ -3,7 +3,7 @@ CONSOLE MESSAGE: Blocked a frame with origin "http://localhost:8800" from access
 CONSOLE MESSAGE: Blocked a frame with origin "http://localhost:8800" from accessing a frame with origin "http://127.0.0.1:8800". The frame requesting access set "document.domain" to "localhost", but the frame being accessed did not. Both must set "document.domain" to the same value to allow access.
 
 
-FAIL failed setting of document.domain assert_throws: function "function () { document.domain = SUFFIX_HOST; }" did not throw
+FAIL failed setting of document.domain assert_throws_dom: function "function () { document.domain = SUFFIX_HOST; }" did not throw
 FAIL same-origin-domain iframe null is not an object (evaluating 'iframe.contentDocument.domain')
 PASS failed setting of document.domain for documents without browsing context 
 
index a55d85d..2539528 100644 (file)
       iframe.src = iframe_url;
 
       test(function() {
-        assert_throws("SecurityError", function() { document.domain = SUFFIX_HOST; });
-        assert_throws("SecurityError", function() { document.domain = "." + SUFFIX_HOST; });
-        assert_throws("SecurityError", function() { document.domain = REMOTE_HOST; });
-        assert_throws("SecurityError", function() { document.domain = "example.com"; });
+        assert_throws_dom("SecurityError", function() { document.domain = SUFFIX_HOST; });
+        assert_throws_dom("SecurityError", function() { document.domain = "." + SUFFIX_HOST; });
+        assert_throws_dom("SecurityError", function() { document.domain = REMOTE_HOST; });
+        assert_throws_dom("SecurityError", function() { document.domain = "example.com"; });
       }, "failed setting of document.domain");
 
       async_test(function(t) {
           // Before setting document.domain, the iframe is not
           // same-origin-domain, so security checks fail.
           assert_equals(iframe.contentDocument, null);
-          assert_throws("SecurityError", () => iframe.contentWindow.frameElement);
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.origin; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.href; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.protocol; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.host; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.port; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.hostname; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.pathname; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.hash; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.search; });
-          assert_throws("SecurityError", function() { iframe.contentWindow.location.toString(); });
+          assert_throws_dom("SecurityError", () => iframe.contentWindow.frameElement);
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.origin; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.href; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.protocol; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.host; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.port; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.hostname; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.pathname; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.hash; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.search; });
+          assert_throws_dom("SecurityError", function() { iframe.contentWindow.location.toString(); });
           // Set document.domain
           document.domain = ORIGINAL_HOST;
           // After setting document.domain, the iframe is
           assert_equals(iframe.contentWindow.location.toString(), iframe_url.toString());
           // document.open checks for same-origin, not same-origin-domain,
           // https://github.com/whatwg/html/issues/2282
-          assert_throws("SecurityError", function() { iframe.contentDocument.open(); });
+          assert_throws_dom("SecurityError", iframe.contentWindow.DOMException,
+                            function() { iframe.contentDocument.open(); });
         }));
       }, "same-origin-domain iframe");
 
       test(() => {
-        assert_throws("SecurityError", () => { (new Document).domain = document.domain });
-        assert_throws("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain });
-        assert_throws("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain });
+        assert_throws_dom("SecurityError", () => { (new Document).domain = document.domain });
+        assert_throws_dom("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain });
+        assert_throws_dom("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain });
       }, "failed setting of document.domain for documents without browsing context");
     </script>
   </body>
index 824795f..ae1a0cc 100644 (file)
@@ -4,18 +4,18 @@
 <script src="/resources/testharnessreport.js"></script>
 <script>
   test(() => {
-    assert_throws("SecurityError", () => { document.domain = document.domain });
+    assert_throws_dom("SecurityError", () => { document.domain = document.domain });
   });
   test(() => {
-    assert_throws("SecurityError", () => { (new Document).domain = document.domain });
+    assert_throws_dom("SecurityError", () => { (new Document).domain = document.domain });
   });
   test(() => {
-    assert_throws("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain });
+    assert_throws_dom("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain });
   });
   test(() => {
-    assert_throws("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain });
+    assert_throws_dom("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain });
   });
   test(() => {
-    assert_throws("SecurityError", () => { document.createElement("template").content.ownerDocument.domain = document.domain });
+    assert_throws_dom("SecurityError", () => { document.createElement("template").content.ownerDocument.domain = document.domain });
   });
 </script>
index d1bd007..0dae013 100644 (file)
@@ -19,7 +19,7 @@
       }
       function loaded() {
         t.step(() => {
-          assert_throws("SecurityError", () => {
+          assert_throws_dom("SecurityError", () => {
             document.getElementById('sandboxedframe').contentWindow.document;
           });
           assert_equals(called, 0);
index 0bb98c5..3c8c0b3 100644 (file)
@@ -6,9 +6,9 @@
     async_test(t => {
       let i = document.createElement('iframe');
       i.sandbox = "allow-same-origin allow-popups allow-popups-to-escape-sandbox";
-      i.srcdoc = `<a target='_blank'
+      i.srcdoc = `<a target='_blank' rel='opener'
                      href="javascript:window.opener.top.postMessage('FAIL', '*');">Click me!</a>
-                  <a target='_blank'
+                  <a target='_blank' rel='opener'
                      href="./resources/post-done-to-opener.html">Click me next!</a>`;
 
       i.onload = _ => {
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor-expected.txt
new file mode 100644 (file)
index 0000000..2701584
--- /dev/null
@@ -0,0 +1,9 @@
+
+PASS Window target, no trap, "name" attribute 
+PASS Window target, forwarding trap, [Unforgeable] "document" attribute 
+PASS Window proxy target, custom trap, "onclick" event handler attribute 
+PASS Document target, forwarding trap, [Unforgeable] "location" attribute 
+PASS Document proxy target, custom trap, non-existent value attribute 
+PASS Location target, no trap, [Unforgeable] "hash" attribute 
+PASS Location proxy target, forwarding trap, [Unforgeable] "reload" method 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html
new file mode 100644 (file)
index 0000000..c3db82f
--- /dev/null
@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>getOwnPropertyDescriptor() is correct for Proxy with host object target</title>
+  <link rel="help" href="https://html.spec.whatwg.org/multipage/#window">
+  <link rel="help" href="https://heycam.github.io/webidl/#Unforgeable">
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+'use strict';
+
+const assert_accessor_descriptor_equals = (actual, expected) => {
+  assert_equals(actual.get, expected.get, 'get');
+  assert_equals(actual.set, expected.set, 'set');
+  assert_equals(actual.enumerable, expected.enumerable, 'enumerable');
+  assert_equals(actual.configurable, expected.configurable, 'configurable');
+};
+
+const assert_data_descriptor_equals = (actual, expected) => {
+  assert_equals(actual.value, expected.value, 'value');
+  assert_equals(actual.writable, expected.writable, 'writable');
+  assert_equals(actual.enumerable, expected.enumerable, 'enumerable');
+  assert_equals(actual.configurable, expected.configurable, 'configurable');
+};
+
+test(() => {
+  const windowProxy = new Proxy(window, {});
+  name = 'old_name';
+  const descriptor = Object.getOwnPropertyDescriptor(windowProxy, 'name');
+
+  assert_equals(descriptor.get.call(window), 'old_name');
+  descriptor.set.call(window, 'new_name');
+  assert_equals(name, 'new_name');
+  assert_true(descriptor.enumerable);
+  assert_true(descriptor.configurable);
+}, 'Window target, no trap, "name" attribute');
+
+test(() => {
+  let trapCalls = 0;
+  const windowProxy = new Proxy(window, {
+    getOwnPropertyDescriptor(...args) {
+      trapCalls++;
+      return Reflect.getOwnPropertyDescriptor(...args);
+    },
+  });
+
+  assert_accessor_descriptor_equals(
+    Object.getOwnPropertyDescriptor(windowProxy, 'document'),
+    Object.getOwnPropertyDescriptor(window, 'document')
+  );
+  assert_equals(trapCalls, 1);
+}, 'Window target, forwarding trap, [Unforgeable] "document" attribute');
+
+test(() => {
+  const trapResult = {get() {}, set(_val) {}, enumerable: false, configurable: true};
+  const windowProxy = new Proxy(new Proxy(window, {}), {
+    getOwnPropertyDescriptor: () => trapResult,
+  });
+
+  assert_accessor_descriptor_equals(
+    Object.getOwnPropertyDescriptor(windowProxy, 'onclick'),
+    trapResult
+  );
+}, 'Window proxy target, custom trap, "onclick" event handler attribute');
+
+test(() => {
+  let trapCalls = 0;
+  const documentProxy = new Proxy(document, {
+    getOwnPropertyDescriptor(...args) {
+      trapCalls++;
+      return Reflect.getOwnPropertyDescriptor(...args);
+    },
+  });
+
+  assert_accessor_descriptor_equals(
+    Object.getOwnPropertyDescriptor(documentProxy, 'location'),
+    Object.getOwnPropertyDescriptor(document, 'location')
+  );
+  assert_equals(trapCalls, 1);
+}, 'Document target, forwarding trap, [Unforgeable] "location" attribute');
+
+test(() => {
+  const trapResult = {value: 4, writable: false, enumerable: true, configurable: true};
+  const documentProxy = new Proxy(new Proxy(document, {}), {
+    getOwnPropertyDescriptor: () => trapResult,
+  });
+
+  assert_data_descriptor_equals(
+    Object.getOwnPropertyDescriptor(documentProxy, 'foo'),
+    trapResult
+  );
+}, 'Document proxy target, custom trap, non-existent value attribute');
+
+test(() => {
+  const locationProxy = new Proxy(location, {});
+  location.hash = '#old';
+  const descriptor = Object.getOwnPropertyDescriptor(locationProxy, 'hash');
+
+  assert_equals(descriptor.get.call(location), '#old');
+  descriptor.set.call(location, '#new');
+  assert_equals(location.hash, '#new');
+  assert_true(descriptor.enumerable);
+  assert_false(descriptor.configurable);
+}, 'Location target, no trap, [Unforgeable] "hash" attribute');
+
+test(() => {
+  let trapCalls = 0;
+  const locationProxy = new Proxy(new Proxy(location, {}), {
+    getOwnPropertyDescriptor(...args) {
+      trapCalls++;
+      return Reflect.getOwnPropertyDescriptor(...args);
+    },
+  });
+
+  assert_data_descriptor_equals(
+    Object.getOwnPropertyDescriptor(locationProxy, 'reload'),
+    Object.getOwnPropertyDescriptor(location, 'reload')
+  );
+  assert_equals(trapCalls, 1);
+}, 'Location proxy target, forwarding trap, [Unforgeable] "reload" method');
+</script>
+</body>
+</html>
index 1fb0ed7..ad8f177 100644 (file)
@@ -139,7 +139,7 @@ function fr_load() {
     ].forEach(function (item) {
       test(function () {
         assert_true(item.name in window, "window." + item.name + " should exist.");
-        assert_throws("SecurityError", function () {
+        assert_throws_dom("SecurityError", function () {
           if (item.isMethod)
             if (item.args)
               fr.contentWindow[item.name](item.args[0], item.args[1]);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/same-origin-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/same-origin-iframe.html
new file mode 100644 (file)
index 0000000..763d9e4
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script>
+      window.addEventListener('load', () => { window.didLoadFrame = true; });
+    </script>
+  </head>
+</html>
index 7e8d26e..0109f18 100644 (file)
@@ -18,4 +18,5 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/closed.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noopener-target.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/noreferrer-target.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/same-origin-iframe.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/sizing-target.html
index 5c39862..dbf886d 100644 (file)
@@ -26,6 +26,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/name-attribute.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/self-et-al.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-aliases.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-indexed-properties-strict.html
@@ -35,3 +36,4 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noreferrer.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-properties.https.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html
index 8a8c16f..2f6c22e 100644 (file)
@@ -1,7 +1,7 @@
 
 PASS Indexed properties of the window object (non-strict mode) 
 PASS Ensure indexed properties have the correct configuration 
-FAIL Indexed properties of the window object (non-strict mode) 1 assert_throws: function "() => Object.defineProperty(window, 0, { value: "bar" })" did not throw
-FAIL Indexed properties of the window object (non-strict mode) 2 assert_throws: function "() => Object.defineProperty(window, 1, { value: "bar" })" did not throw
+FAIL Indexed properties of the window object (non-strict mode) 1 assert_throws_js: function "() => Object.defineProperty(window, 0, { value: "bar" })" did not throw
+FAIL Indexed properties of the window object (non-strict mode) 2 assert_throws_js: function "() => Object.defineProperty(window, 1, { value: "bar" })" did not throw
 PASS Indexed properties of the window object (non-strict mode) 3 
 
index 77d962d..4035906 100644 (file)
@@ -1,9 +1,9 @@
 
 PASS Indexed properties of the window object (strict mode) 
-FAIL Indexed properties of the window object (strict mode) 1 assert_throws: function "function () {
+FAIL Indexed properties of the window object (strict mode) 1 assert_throws_js: function "function () {
     window[0] = "foo";
   }" did not throw
-FAIL Indexed properties of the window object (strict mode) 2 assert_throws: function "function () {
+FAIL Indexed properties of the window object (strict mode) 2 assert_throws_js: function "function () {
     window[1] = "foo";
   }" did not throw
 PASS Indexed properties of the window object (strict mode) 3 
index e059b12..faf214d 100644 (file)
@@ -20,24 +20,24 @@ test(function() {
 });
 test(function() {
   "use strict";
-  assert_throws(new TypeError(), function() {
+  assert_throws_js(TypeError, function() {
     window[0] = "foo";
   });
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { value: "bar" }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { get() { return "baz" } }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { set(v) { return "qux" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 0, { value: "bar" }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 0, { get() { return "baz" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 0, { set(v) { return "qux" } }))
   assert_equals(window[0],
                 document.getElementsByTagName("iframe")[0].contentWindow);
-  assert_throws(new TypeError(), () => delete window[0]);
+  assert_throws_js(TypeError, () => delete window[0]);
 });
 test(function() {
   "use strict";
-  assert_throws(new TypeError(), function() {
+  assert_throws_js(TypeError, function() {
     window[1] = "foo";
   });
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { value: "bar" }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { get() { return "baz" } }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { set(v) { return "qux" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 1, { value: "bar" }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 1, { get() { return "baz" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 1, { set(v) { return "qux" } }))
   assert_equals(window[1], undefined);
   assert_equals(Object.getOwnPropertyDescriptor(window, 1), undefined);
   assert_equals(delete window[1], true);
index 4924717..0f896cb 100644 (file)
@@ -25,18 +25,18 @@ test(() => {
 }, "Ensure indexed properties have the correct configuration");
 test(function() {
   window[0] = "foo";
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { value: "bar" }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { get() { return "baz" } }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { set() { return "quz" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 0, { value: "bar" }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 0, { get() { return "baz" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 0, { set() { return "quz" } }))
   assert_equals(window[0],
                 document.getElementsByTagName("iframe")[0].contentWindow);
   assert_equals(delete window[0], false);
 });
 test(function() {
   window[1] = "foo";
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { value: "bar" }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { get() { return "baz" } }))
-  assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { set(v) { return "quz" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 1, { value: "bar" }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 1, { get() { return "baz" } }))
+  assert_throws_js(TypeError, () => Object.defineProperty(window, 1, { set(v) { return "quz" } }))
   assert_equals(window[1], undefined);
   assert_equals(Object.getOwnPropertyDescriptor(window, 1), undefined);
   assert_equals(delete window[1], true);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative-expected.txt
new file mode 100644 (file)
index 0000000..0c4a09c
--- /dev/null
@@ -0,0 +1,9 @@
+
+FAIL synchronously navigate iframe with no initial src. assert_true: Not expecting event, but got load event expected true got false
+FAIL after the first iframe load event, navigate iframe with no initial src. assert_true: Not expecting event, but got load event expected true got false
+FAIL synchronously navigate iframe with initial src == "". assert_true: Not expecting event, but got load event expected true got false
+FAIL after the first iframe load event, navigate iframe with initial src == "". assert_true: Not expecting event, but got load event expected true got false
+FAIL synchronously navigate iframe with initial src == "about:blank". assert_true: Not expecting event, but got load event expected true got false
+FAIL after the first iframe load event, navigate iframe with initial src == "about:blank". assert_true: Not expecting event, but got load event expected true got false
+PASS iframe with initial src == same-origin resource. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html
new file mode 100644 (file)
index 0000000..0cd2fce
--- /dev/null
@@ -0,0 +1,158 @@
+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+const setupIframe = (t, attrs) => {
+  const iframe = document.createElement('iframe');
+  for (const [key, value] of Object.entries(attrs))
+    iframe[key] = value;
+  const watcher = new EventWatcher(t, iframe, ['load']);
+  document.body.appendChild(iframe);
+  return {iframe, watcher};
+};
+
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {});
+
+  // Per https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes,
+  // the task to perform the "iframe load event steps" should still be queued.
+  // If a browser already fired a load event, the test will fail here since
+  // EventWatcher will have received an unexpected load event.
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  iframe.src = 'support/same-origin-iframe.html';
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // The <iframe>'s session history has only one Document, and that Document is
+  // the initial:blank Document. The Window object should be reused per
+  // https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes.
+  assert_equals(iframe.contentWindow.persistedString, 'Hello world!');
+}, 'synchronously navigate iframe with no initial src.');
+
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {});
+
+  // Per https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes,
+  // the task to perform the "iframe load event steps" should still be queued.
+  await watcher.wait_for(['load']);
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  iframe.src = 'support/same-origin-iframe.html';
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // The <iframe>'s session history has only one Document, and that Document is
+  // the initial:blank Document. The Window object should be reused per
+  // https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes.
+  assert_equals(iframe.contentWindow.persistedString, 'Hello world!');
+}, 'after the first iframe load event, navigate iframe with no initial src.');
+
+// Per https://whatwg.org/c/iframe-embed-object.html#otherwise-steps-for-iframe-or-frame-elements,
+// setting the <iframe> src to an empty string before inserting the <iframe>
+// into the document should begin an attempt to navigate to a resource with
+// url == "about:blank".
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {src: ''});
+
+  // Per https://whatwg.org/c/browsing-the-web.html#navigate, the "about:blank"
+  // resource should be obtained "in parallel". If a browser performs this step
+  // synchronously, the test will fail here since EventWatcher will have
+  // received an unexpected load event.
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  // An attempt to navigate to "about:blank" already exists but should not have
+  // matured yet since the resource should be obtained "in parallel". The new
+  // navigation attempt will cancel the preexisting attempt.
+  iframe.src = 'support/same-origin-iframe.html';
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // The navigation attempt to "about:blank" was cancelled, so the <iframe>'s
+  // session history has only one Document, and that Document is the
+  // initial:blank Document. The Window object should be reused per
+  // https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes.
+  assert_equals(iframe.contentWindow.persistedString, 'Hello world!');
+}, 'synchronously navigate iframe with initial src == "".');
+
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {src: ''});
+
+  // Per https://whatwg.org/c/browsing-the-web.html#navigate, the "about:blank"
+  // resource should be obtained "in parallel".
+  await watcher.wait_for(['load']);
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  iframe.src = 'support/same-origin-iframe.html';
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // A non-initial navigation to about:blank was committed, so the <iframe>
+  // element is no longer displaying the initial about:blank Document. Per
+  // https://whatwg.org/c/browsing-the-web.html#initialise-the-document-object,
+  // the Window object must not be reused.
+  assert_equals(iframe.contentWindow.persistedString, undefined);
+}, 'after the first iframe load event, navigate iframe with initial src == "".');
+
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {src: 'about:blank'});
+
+  // Per https://whatwg.org/c/browsing-the-web.html#navigate, the "about:blank"
+  // resource should be obtained "in parallel". If a browser performs this step
+  // synchronously, the test will fail here since EventWatcher will have
+  // received an unexpected load event.
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  // An attempt to navigate to "about:blank" already exists but should not have
+  // matured yet since the resource should be obtained "in parallel". The new
+  // navigation attempt will cancel the preexisting attempt.
+  iframe.src = 'support/same-origin-iframe.html';
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // The navigation attempt to "about:blank" was cancelled, so the <iframe>'s
+  // session history has only one Document, and that Document is the
+  // initial:blank Document. The Window object should be reused per
+  // https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes.
+  assert_equals(iframe.contentWindow.persistedString, 'Hello world!');
+}, 'synchronously navigate iframe with initial src == "about:blank".');
+
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {src: 'about:blank'});
+
+  // Per https://whatwg.org/c/browsing-the-web.html#navigate, the "about:blank"
+  // resource should be obtained "in parallel".
+  await watcher.wait_for(['load']);
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  iframe.src = 'support/same-origin-iframe.html';
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // A non-initial navigation to about:blank was committed, so the <iframe>
+  // element is no longer displaying the initial about:blank Document. Per
+  // https://whatwg.org/c/browsing-the-web.html#initialise-the-document-object,
+  // the Window object must not be reused.
+  assert_equals(iframe.contentWindow.persistedString, undefined);
+}, 'after the first iframe load event, navigate iframe with initial src == "about:blank".');
+
+// Per https://whatwg.org/c/iframe-embed-object.html#otherwise-steps-for-iframe-or-frame-elements,
+// setting <iframe> src before inserting the <iframe> into the document should
+// begin an attempt to navigate to the value of the src attribute.
+promise_test(async t => {
+  const {iframe, watcher} = setupIframe(t, {src: 'support/same-origin-iframe.html'});
+
+  iframe.contentWindow.persistedString = 'Hello world!';
+  // Completion of the attempt to navigate happens "in parallel".
+  await watcher.wait_for(['load']);
+
+  assert_true(iframe.contentWindow.didLoadFrame);
+  // The <iframe>'s session history has only one Document, and that Document is
+  // the initial:blank Document. The Window object should be reused per
+  // https://whatwg.org/c/iframe-embed-object.html#process-the-iframe-attributes.
+  assert_equals(iframe.contentWindow.persistedString, 'Hello world!');
+}, 'iframe with initial src == same-origin resource.');
+</script>
index 6e5cf16..cc8ec86 100644 (file)
@@ -1,16 +1,9 @@
 CONSOLE MESSAGE: SecurityError: Attempted to use a non-registrable domain.
+CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
 
 
+Harness Error (FAIL), message = SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
+
 FAIL Same-origin-domain prerequisite check: the original prototype is accessible assert_not_equals: got disallowed value null
 PASS Same-origin-domain: setting the prototype to an empty object via Object.setPrototypeOf should throw a TypeError 
-FAIL Same-origin-domain: setting the prototype to an empty object via __proto__ should throw a TypeError assert_throws_js: function "function () {
-      target.__proto__ = newValue;
-    }" threw object "SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match." ("SecurityError") expected instance of function "function TypeError() {
-    [native code]
-}" ("TypeError")
-PASS Same-origin-domain: setting the prototype to an empty object via Reflect.setPrototypeOf should return false 
-PASS Same-origin-domain: the prototype must still be null 
-PASS Same-origin-domain: setting the prototype to null via Object.setPrototypeOf should not throw 
-FAIL Same-origin-domain: setting the prototype to null via __proto__ should not throw Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
-PASS Same-origin-domain: setting the prototype to null via Reflect.setPrototypeOf should return true 
 
index d3d10f1..530bc75 100644 (file)
@@ -23,7 +23,7 @@ window.onload = () => {
     assert_not_equals(origProto, null);
   }, "Same-origin-domain prerequisite check: the original prototype is accessible");
 
-  testSettingImmutablePrototype("Same-origin-domain", target, origProto, { isSameOriginDomain: true });
+  testSettingImmutablePrototype("Same-origin-domain", target, origProto, { isSameOriginDomain: true }, frames[0]);
 
   done();
 };
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative-expected.txt
new file mode 100644 (file)
index 0000000..32a854a
--- /dev/null
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www1.localhost:8800/html/browsers/windows/document-access/resources/cross_origin_intermediate_child.sub.html
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Check that a grandchild can access window.top Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative.html
new file mode 100644 (file)
index 0000000..3812246
--- /dev/null
@@ -0,0 +1,18 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Check that a grandchild can access window.top</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+  <script>
+    // Assert that the grandchild can't access window.location.href and send it back to us.
+    // It should indicate noaccess.
+    async_test(function(test) {
+        window.addEventListener('message', test.step_func((e) => {
+          assert_equals(e.data, 'noaccess');
+          test.done();
+        }));
+    });
+  </script>
+  <iframe disallowdocumentaccess src="http://{{domains[www1]}}:{{ports[http][0]}}/html/browsers/windows/document-access/resources/cross_origin_intermediate_child.sub.html"></iframe>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative-expected.txt
new file mode 100644 (file)
index 0000000..58f1814
--- /dev/null
@@ -0,0 +1,7 @@
+Blocked access to external URL http://www1.localhost:8800/html/browsers/windows/document-access/resources/cross_origin_intermediate_child_remote.sub.html
+
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Check that a grandchild can access window.top Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative.html
new file mode 100644 (file)
index 0000000..22370e7
--- /dev/null
@@ -0,0 +1,19 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Check that a grandchild can access window.top</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+  <script>
+    // Assert that the grandchild can't access window.location.href and send it back to us.
+    // This test is slightly different than cross_origin_intermediate_acess because the
+    // disallowdocumentaccess is on a remote frame. The test should indicate noaccess.
+    async_test(function(test) {
+        window.addEventListener('message', test.step_func((e) => {
+          assert_equals(e.data, 'noaccess');
+          test.done();
+        }));
+    });
+  </script>
+  <iframe src="http://{{domains[www1]}}:{{ports[http][0]}}/html/browsers/windows/document-access/resources/cross_origin_intermediate_child_remote.sub.html"></iframe>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child.sub.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child.sub.html
new file mode 100644 (file)
index 0000000..9386a2f
--- /dev/null
@@ -0,0 +1,8 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Add a grandchild that is the same origin as window.top</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+  <iframe src="http://{{host}}:{{ports[http][0]}}/html/browsers/windows/document-access/resources/cross_origin_intermediate_grandchild.html"></iframe>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child_remote.sub.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child_remote.sub.html
new file mode 100644 (file)
index 0000000..93f6da9
--- /dev/null
@@ -0,0 +1,9 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Add a grandchild that is the same origin as window.top</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+  <!-- Set disallowdocumentaccess here for the grandchild. It will be a remote frame to this embedder -->
+  <iframe disallowdocumentaccess src="http://{{host}}:{{ports[http][0]}}/html/browsers/windows/document-access/resources/cross_origin_intermediate_grandchild.html"></iframe>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_grandchild.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_grandchild.html
new file mode 100644 (file)
index 0000000..d91a234
--- /dev/null
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Grandchild that posts a message to the window.top</title>
+<script>
+  var top_location = '';
+  var result = '';
+  try {
+      top_location = window.top.location.href;
+      result = 'allowed';
+  } catch (err) {
+      result = 'noaccess';
+  }
+  window.top.postMessage(result, '*');
+</script>
index b06bc27..5327e74 100644 (file)
@@ -15,3 +15,6 @@ None
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/child.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child.sub.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_child_remote.sub.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/resources/cross_origin_intermediate_grandchild.html
index 972a838..bc661b5 100644 (file)
@@ -14,4 +14,6 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access.sub.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/cross_origin_intermediate_access_remote.sub.tentative.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-access/document_access_parent_access.tentative.html
index b639c81..f51eed5 100644 (file)
@@ -6,7 +6,7 @@ async_test(t => {
   document.domain = document.domain;
   frame.src = "/common/blank.html";
   frame.onload = t.step_func(() => {
-    assert_throws("SecurityError", () => window[0].document);
+    assert_throws_dom("SecurityError", () => window[0].document);
     frame.src = "about:blank";
     frame.onload = t.step_func_done(() => {
       // Ensure we can access the child browsing context after navigation to non-initial about:blank
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe-expected.txt
new file mode 100644 (file)
index 0000000..4ac39b2
--- /dev/null
@@ -0,0 +1,6 @@
+
+PASS No removal, no document.domain 
+PASS Removal, no document.domain 
+PASS No removal, document.domain 
+PASS Removal, document.domain 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe.html
new file mode 100644 (file)
index 0000000..7403ebf
--- /dev/null
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>document.domain and removed iframe interaction</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<!-- This is a test for https://crbug.com/1095145 where window
+     properties become undefined for document.domain-using removed
+     iframes -->
+
+<div id="log"></div>
+
+<script>
+"use strict";
+
+promise_test(t => {
+  return new Promise(resolve => {
+    const iframe = document.createElement("iframe");
+    iframe.onload = t.step_func(() => {
+      const { contentWindow } = iframe;
+      assert_equals(contentWindow.status, "");
+      resolve();
+    });
+    iframe.src = "/common/blank.html";
+    document.body.append(iframe);
+  });
+}, "No removal, no document.domain");
+
+promise_test(t => {
+  return new Promise(resolve => {
+    const iframe = document.createElement("iframe");
+    iframe.onload = t.step_func(() => {
+      const { contentWindow } = iframe;
+      iframe.remove();
+      assert_equals(contentWindow.status, "");
+      resolve();
+    });
+    iframe.src = "/common/blank.html";
+    document.body.append(iframe);
+  });
+}, "Removal, no document.domain");
+
+promise_test(t => {
+  return new Promise(resolve => {
+    const iframe = document.createElement("iframe");
+    iframe.onload = t.step_func(() => {
+      document.domain = document.domain;
+      const { contentWindow } = iframe;
+      assert_equals(contentWindow.status, "");
+      resolve();
+    });
+    iframe.src = "resources/document-domain-setter.html";
+    document.body.append(iframe);
+  });
+}, "No removal, document.domain");
+
+promise_test(t => {
+  return new Promise(resolve => {
+    const iframe = document.createElement("iframe");
+    iframe.onload = t.step_func(() => {
+      document.domain = document.domain; // technically we already did this above
+      const { contentWindow } = iframe;
+      iframe.remove();
+      assert_equals(contentWindow.status, "");
+      resolve();
+    });
+    iframe.src = "resources/document-domain-setter.html";
+    document.body.append(iframe);
+  });
+}, "Removal, document.domain");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub-expected.txt
new file mode 100644 (file)
index 0000000..36ce003
--- /dev/null
@@ -0,0 +1,8 @@
+Blocked access to external URL http://www.localhost:8800/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT it must give a "SecurityError" DOMException if the pages are different-origin domain Test timed out
+NOTRUN it must return the iframe element if the pages are same-origin domain 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html
new file mode 100644 (file)
index 0000000..0c814d2
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>window.frameElement access to a same-origin-domain sibling</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<iframe src="//{{hosts[][]}}:{{ports[http][0]}}/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html"></iframe>
+<iframe src="//{{hosts[][www]}}:{{ports[http][0]}}/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html"></iframe>
+
+<script>
+"use strict";
+setup({ explicit_done: true });
+
+window.onload = () => {
+  promise_test(async () => {
+    frames[1].postMessage({}, "*");
+    const result = await waitForMessage();
+
+    assert_equals(result, "SecurityError");
+  }, "it must give a \"SecurityError\" DOMException if the pages are different-origin domain");
+
+  promise_test(async () => {
+    document.domain = document.domain;
+
+    frames[0].postMessage({ newDocumentDomain: document.domain }, "*");
+    assert_equals(await waitForMessage(), "done");
+
+    frames[1].postMessage({ newDocumentDomain: document.domain }, "*");
+    const result = await waitForMessage();
+
+    assert_equals(result, "HTMLIFrameElement");
+  }, "it must return the iframe element if the pages are same-origin domain");
+
+  done();
+};
+
+function waitForMessage() {
+  return new Promise(resolve => {
+    window.addEventListener("message", e => resolve(e.data), { once: true });
+  });
+}
+</script>
index 2f5b1c4..7ea1182 100644 (file)
@@ -41,7 +41,7 @@
 
       var t2 = async_test("The SecurityError must be thrown if the window accesses to frameElement attribute of a Window which does not have the same effective script origin");
       window.addEventListener("load", t2.step_func_done(function() {
-        assert_throws("SecurityError", function() {
+        assert_throws_dom("SecurityError", function() {
             frames["iframe_2"].frameElement;
           },
           "The SecurityError exception should be thrown.");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html
new file mode 100644 (file)
index 0000000..1524598
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>This page will set its document.domain on request so that its sibling can access it</title>
+
+<h1>I did get loaded</h1>
+
+<script>
+"use strict";
+
+window.onmessage = e => {
+  const { newDocumentDomain } = e.data;
+  document.domain = newDocumentDomain;
+
+  parent.postMessage("done", "*");
+};
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html
new file mode 100644 (file)
index 0000000..4b4c7a8
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>This page will attempt to access the frameElement of its sibling and report the results on request</title>
+
+<h1>I did get loaded</h1>
+
+<script>
+"use strict";
+
+window.onmessage = e => {
+  const { newDocumentDomain } = e.data;
+  if (newDocumentDomain) {
+    document.domain = newDocumentDomain;
+  }
+
+  const siblingWindow = parent.frames[0];
+
+  try {
+    const { frameElement } = siblingWindow;
+
+    let result = "something wierd happened";
+    if (frameElement === null) {
+      result = "null";
+    } else if (frameElement.constructor) {
+      result = frameElement.constructor.name;
+    }
+
+    parent.postMessage(result, "*");
+  } catch (e) {
+    parent.postMessage(e.name, "*");
+  }
+};
+</script>
index 9506f29..0a4b693 100644 (file)
@@ -15,6 +15,8 @@ None
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-opener.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-parent.html
index 5961f00..07eba34 100644 (file)
@@ -14,6 +14,7 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/name-attribute.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/nested-browsing-contexts/window-parent-null.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/document-domain-setter.html b/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/document-domain-setter.html
new file mode 100644 (file)
index 0000000..3b14255
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Helper page that sets document.domain</title>
+<script>
+"use strict";
+document.domain = document.domain;
+</script>
index 01b7280..8321f9c 100644 (file)
@@ -15,6 +15,7 @@ None
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/browsing-context-window.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/document-domain-setter.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/echo-window-name.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/message-parent.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/resources/nested-post-to-opener.html
index 6467099..b35a1e3 100644 (file)
@@ -19,6 +19,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-nested-navigate.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-nested-set.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-nested.window.js
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/document-domain-removed-iframe.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/embedded-opener-a-form.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/embedded-opener-remove-frame.html
 /LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/embedded-opener.html
index 2465acc..dba1568 100644 (file)
     "imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html": [
         "slow"
     ],
+    "imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html": [
+        "slow"
+    ],
     "imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html": [
         "slow"
     ],