Repository: servo/servo (language: python)

Issue:
Use real values in WorkerScriptLoadOrigin for DOM worker constructor
We pass None for the referrer policy and referrer urls in [this code](https://github.com/servo/servo/blob/e1cc38bea8a701108b6f2fa809f341769613b55f/components/script/dom/worker.rs#L93-L97). We should obtain the real values from the global scope instead. It probably makes sense to fix https://github.com/servo/servo/issues/11863 at the same time, so whatever API we add to GlobalScope to return a referrer policy returns a real value in workers.


Discussion / hints:

Fix patch:
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 194e2439d7e5f..47ace9c8455c0 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -50,7 +50,7 @@ use net_traits::request::{Referrer, RequestBuilder};
 use net_traits::response::HttpsState;
 use net_traits::{
     fetch_async, CoreResourceMsg, CoreResourceThread, FetchResponseListener, IpcSend,
-    ResourceThreads,
+    ReferrerPolicy, ResourceThreads,
 };
 use profile_traits::{ipc as profile_ipc, mem as profile_mem, time as profile_time};
 use script_traits::serializable::{BlobData, BlobImpl, FileBlob};
@@ -2418,6 +2418,21 @@ impl GlobalScope {
         unreachable!();
     }
 
+    /// Get the Referrer Policy for this global scope.
+    pub fn get_referrer_policy(&self) -> Option<ReferrerPolicy> {
+        if let Some(window) = self.downcast::<Window>() {
+            let document = window.Document();
+
+            return document.get_referrer_policy();
+        }
+        if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
+            let policy_container = worker.policy_container().to_owned();
+
+            return Some(policy_container.referrer_policy);
+        }
+        unreachable!();
+    }
+
     /// Determine the Referrer for a request whose Referrer is "client"
     pub fn get_referrer(&self) -> Referrer {
         // Step 3 of https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
diff --git a/components/script/dom/serviceworkerregistration.rs b/components/script/dom/serviceworkerregistration.rs
index c37071f761ac1..bd617942e07a7 100644
--- a/components/script/dom/serviceworkerregistration.rs
+++ b/components/script/dom/serviceworkerregistration.rs
@@ -118,7 +118,7 @@ impl ServiceWorkerRegistration {
                 Referrer::ReferrerUrl(url) => Some(url),
                 _ => None,
             },
-            referrer_policy: Some(global.policy_container().referrer_policy),
+            referrer_policy: global.get_referrer_policy(),
             pipeline_id: global.pipeline_id(),
         };
 
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index b62e7d14fd846..94a23496596f7 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -13,6 +13,7 @@ use ipc_channel::ipc;
 use js::jsapi::{Heap, JSObject};
 use js::jsval::UndefinedValue;
 use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleObject, HandleValue};
+use net_traits::request::Referrer;
 use script_traits::{StructuredSerializedData, WorkerScriptLoadOrigin};
 use uuid::Uuid;
 
@@ -178,8 +179,12 @@ impl WorkerMethods for Worker {
         let worker_ref = Trusted::new(&*worker);
 
         let worker_load_origin = WorkerScriptLoadOrigin {
-            referrer_url: None,
-            referrer_policy: None,
+            referrer_url: match global.get_referrer() {
+                Referrer::Client(url) => Some(url),
+                Referrer::ReferrerUrl(url) => Some(url),
+                _ => None,
+            },
+            referrer_policy: global.get_referrer_policy(),
             pipeline_id: global.pipeline_id(),
         };
 
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index 0432794531304..401157ce5a89a 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -174,14 +174,6 @@ pub struct XMLHttpRequest {
 
 impl XMLHttpRequest {
     fn new_inherited(global: &GlobalScope) -> XMLHttpRequest {
-        //TODO - update this when referrer policy implemented for workers
-        let referrer_policy = if let Some(window) = global.downcast::<Window>() {
-            let document = window.Document();
-            document.get_referrer_policy()
-        } else {
-            None
-        };
-
         XMLHttpRequest {
             eventtarget: XMLHttpRequestEventTarget::new_inherited(),
             ready_state: Cell::new(XMLHttpRequestState::Unsent),
@@ -213,7 +205,7 @@ impl XMLHttpRequest {
             generation_id: Cell::new(GenerationId(0)),
             response_status: Cell::new(Ok(())),
             referrer: global.get_referrer(),
-            referrer_policy,
+            referrer_policy: global.get_referrer_policy(),
             canceller: DomRefCell::new(Default::default()),
         }
     }


Test patch:
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/never/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/never/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/never/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/never/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/never/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/never/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/never/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/never/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/never/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/never/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/never/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/never/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 3f63d9987a145..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html.ini b/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index e0395cc4c98bb..0000000000000
--- a/tests/wpt/meta-legacy-layout/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index 0ee04ecc28756..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index b39a24f52cde5..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.http-rp/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/never/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/never/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/never/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/never/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/never/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/never/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index 0ee04ecc28756..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index b39a24f52cde5..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/iframe.meta/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index 0ee04ecc28756..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.http-rp/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index b39a24f52cde5..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.http-rp/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.http-rp/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.http-rp/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.http-rp/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.http-rp/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/never/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/never/worker-classic.http.html.ini
deleted file mode 100644
index db93e5a5f2e47..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/never/worker-classic.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/never/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/never/worker-module.http.html.ini
deleted file mode 100644
index 4d3fd09145f04..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/never/worker-module.http.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
-
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html.ini
deleted file mode 100644
index 0ee04ecc28756..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/no-referrer/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html.ini
deleted file mode 100644
index b39a24f52cde5..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/no-referrer/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects omitted for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html.ini
deleted file mode 100644
index 783d005597d8c..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/strict-origin/worker-classic.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-classic.http.html]
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-classic to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL
diff --git a/tests/wpt/meta/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html.ini b/tests/wpt/meta/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html.ini
deleted file mode 100644
index bb2fbf4d8c25d..0000000000000
--- a/tests/wpt/meta/referrer-policy/gen/top.meta/strict-origin/worker-module.http.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[worker-module.http.html]
-  [Referrer Policy: Expects origin for worker-module to same-http origin and keep-origin redirection from http context.]
-    expected: FAIL
-
-  [Referrer Policy: Expects origin for worker-module to same-http origin and no-redirect redirection from http context.]
-    expected: FAIL