Remove kDocumentDomain Permissions and Document Policy.
These policies were meant as a mechanism to deprecate setting
document.domain. The same goal is now being pursued with a different
mechanism, the Origin-Agent-Cluster http header. Due to this new solution these policies no longer serve a purpose and their support code can be removed.
Ref: https://groups.google.com/a/chromium.org/g/blink-dev/c/_oRc19PjpFo
Bug: 1344527
Change-Id: I8fc6886d3bf126e6939f6601b7befa56cb0f56b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3930823
Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1075782}
diff --git a/document-policy/experimental-features/document-domain/document-domain.tentative.sub.html b/document-policy/experimental-features/document-domain/document-domain.tentative.sub.html
deleted file mode 100644
index 65de95c..0000000
--- a/document-policy/experimental-features/document-domain/document-domain.tentative.sub.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html>
-
-<body>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
-
- <script>
- document.domain = "{{host}}";
-
- async_test(t => {
- const iframe = document.createElement('iframe');
- iframe.src = "//{{domains[www1]}}:{{location[port]}}/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html";
- iframe.onload = () => {
- iframe.contentWindow.postMessage({
- type: "set document.domain",
- newValue: "{{host}}"
- }, "*");
- };
-
- window.addEventListener('message', t.step_func(e => {
- if (e.source == iframe.contentWindow) {
- assert_equals(e.data.oldDomain, "{{domains[www1]}}");
- assert_equals(e.data.newDomain, "{{host}}");
- t.done();
- }
- }));
-
- document.body.appendChild(iframe);
- }, 'document.domain should be enabled in subframe.');
-
- async_test(t => {
- const iframe = document.createElement('iframe');
- iframe.src = "//{{domains[www1]}}:{{location[port]}}/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html";
- iframe.onload = () => {
- iframe.contentWindow.postMessage({
- type: "set document.domain",
- newValue: "{{host}}"
- }, "*");
- };
-
- window.addEventListener('message', t.step_func(e => {
- if (e.source == iframe.contentWindow) {
- assert_equals(e.data.oldDomain, "{{domains[www1]}}");
- assert_equals(e.data.newDomain, "{{domains[www1]}}");
- t.done();
- }
- }));
-
- document.body.appendChild(iframe);
- }, 'document.domain should be disabled in subframe.');
- </script>
-</body>
diff --git a/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html b/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html
deleted file mode 100644
index 124ee14..0000000
--- a/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<body>
- <script>
- window.onmessage = e => {
- if (e.data.type === "set document.domain") {
- oldDomain = document.domain;
- document.domain = e.data.newValue;
- e.source.postMessage({
- oldDomain,
- newDomain: document.domain
- }, "*");
- }
- };
- </script>
-</body>
diff --git a/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html.headers b/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html.headers
deleted file mode 100644
index 57b46a6..0000000
--- a/document-policy/experimental-features/document-domain/resources/document-domain-disabled.html.headers
+++ /dev/null
@@ -1 +0,0 @@
-Document-Policy: document-domain=?0
\ No newline at end of file
diff --git a/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html b/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html
deleted file mode 100644
index fe03af0..0000000
--- a/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<body>
- <script>
- window.onmessage = e => {
- if (e.data.type === "set document.domain") {
- oldDomain = document.domain;
- document.domain = e.data.newValue;
- e.source.postMessage({
- oldDomain,
- newDomain: document.domain
- }, "*");
- }
- };
- </script>
-</body>
-
diff --git a/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html.headers b/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html.headers
deleted file mode 100644
index 89ccbe7..0000000
--- a/document-policy/experimental-features/document-domain/resources/document-domain-enabled.html.headers
+++ /dev/null
@@ -1 +0,0 @@
-Document-Policy: document-domain
\ No newline at end of file
diff --git a/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_feature_policy.tentative.sub.html b/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_feature_policy.tentative.sub.html
deleted file mode 100644
index e50e5e1..0000000
--- a/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_feature_policy.tentative.sub.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<body>
- <script src=/resources/testharness.js></script>
- <script src=/resources/testharnessreport.js></script>
- <script src=/feature-policy/resources/featurepolicy.js></script>
- <script>
- run_all_fp_tests_allow_all(
- 'http://{{domains[www]}}:{{ports[http][0]}}',
- 'document-domain',
- 'SecurityError',
- () => {
- return new Promise((resolve, reject) => {
- try {
- document.domain = "{{domains[]}}";
- resolve();
- } catch(e) {
- reject(e);
- }
- });
- });
- </script>
-</body>