diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 3b9622b3cfb..83f9502f885 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -98,6 +98,7 @@ struct XHRContext { gen_id: GenerationId, sync_status: DomRefCell>, resource_timing: ResourceFetchTiming, + url: ServoUrl, } #[derive(Clone)] @@ -284,10 +285,7 @@ impl XMLHttpRequest { impl ResourceTimingListener for XHRContext { fn resource_timing_information(&self) -> (InitiatorType, ServoUrl) { - ( - InitiatorType::XMLHttpRequest, - self.resource_timing_global().get_url().clone(), - ) + (InitiatorType::XMLHttpRequest, self.url.clone()) } fn resource_timing_global(&self) -> DomRoot { @@ -1466,6 +1464,7 @@ impl XMLHttpRequest { gen_id: self.generation_id.get(), sync_status: DomRefCell::new(None), resource_timing: ResourceFetchTiming::new(ResourceTimingType::Resource), + url: init.url.clone(), })); let (task_source, script_port) = if self.sync.get() { diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index f12353058f9..62a698c4155 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -1,5 +1,11 @@ { "items": { + "conformancechecker": { + "mozilla/xmlhttprequest_url.html": [] + }, + "manual": { + "mozilla/xmlhttprequest_url.html": [] + }, "reftest": { "css/abs-overflow-stackingcontext.html": [ [ @@ -7624,7 +7630,8 @@ ], {} ] - ] + ], + "mozilla/xmlhttprequest_url.html": [] }, "reftest_node": { "css/border_black_groove.html": [ @@ -7638,7 +7645,11 @@ ], {} ] - ] + ], + "mozilla/xmlhttprequest_url.html": [] + }, + "stub": { + "mozilla/xmlhttprequest_url.html": [] }, "support": { ".gitignore": [ @@ -11210,7 +11221,8 @@ [ {} ] - ] + ], + "mozilla/xmlhttprequest_url.html": [] }, "testharness": { "bluetooth/advertisingEvent/watchAdvertisements-succeeds.html": [ @@ -13909,7 +13921,19 @@ "mozilla/worklets/test_worklet.html", {} ] + ], + "mozilla/xmlhttprequest_url.html": [ + [ + "mozilla/xmlhttprequest_url.html", + {} + ] ] + }, + "visual": { + "mozilla/xmlhttprequest_url.html": [] + }, + "wdspec": { + "mozilla/xmlhttprequest_url.html": [] } }, "paths": { @@ -21084,6 +21108,10 @@ "mozilla/worklets/throw_exception.js": [ "6ca4f80fc2728c00848bb4474b62fa3596ed2f18", "support" + ], + "mozilla/xmlhttprequest_url.html": [ + "e5d10f27c06e1febd3bb70f8f128194fc3f63861", + "testharness" ] }, "url_base": "/_mozilla/", diff --git a/tests/wpt/mozilla/tests/mozilla/xmlhttprequest_url.html b/tests/wpt/mozilla/tests/mozilla/xmlhttprequest_url.html new file mode 100644 index 00000000000..e5d10f27c06 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/xmlhttprequest_url.html @@ -0,0 +1,26 @@ + + +XMLHttpRequest Origin + + +