From bfd9bbe82a8fd74a2fa91e0a5538c8839141ebdd Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 29 Jul 2019 19:23:48 -0400 Subject: [PATCH] Use origin of final HTTP response as document origin. --- components/script/script_thread.rs | 4 +-- tests/wpt/mozilla/meta/MANIFEST.json | 17 ++++++++++ .../mozilla/document_origin_redirect.html | 22 +++++++++++++ .../document_origin_redirect_subpage.html | 32 +++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 tests/wpt/mozilla/tests/mozilla/document_origin_redirect.html create mode 100644 tests/wpt/mozilla/tests/mozilla/document_origin_redirect_subpage.html diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 77e037406f7..f6bcff56177 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -3128,7 +3128,7 @@ impl ScriptThread { incomplete.pipeline_id, incomplete.parent_info, incomplete.window_size, - origin, + origin.clone(), incomplete.navigation_start, incomplete.navigation_start_precise, self.webgl_chan.as_ref().map(|chan| chan.channel()), @@ -3212,7 +3212,7 @@ impl ScriptThread { &window, HasBrowsingContext::Yes, Some(final_url.clone()), - incomplete.origin, + origin, is_html_document, content_type, last_modified, diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 39eaca61b93..1ac3961804f 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -9534,6 +9534,9 @@ "mozilla/details_ui_opened_ref.html": [ [] ], + "mozilla/document_origin_redirect_subpage.html": [ + [] + ], "mozilla/duplicated_scroll_ids_ref.html": [ [] ], @@ -11527,6 +11530,12 @@ {} ] ], + "mozilla/document_origin_redirect.html": [ + [ + "mozilla/document_origin_redirect.html", + {} + ] + ], "mozilla/document_readystate.html": [ [ "mozilla/document_readystate.html", @@ -18601,6 +18610,14 @@ "3a0172826d4ff2d9a754ffb6a437055bb2cf6ec9", "testharness" ], + "mozilla/document_origin_redirect.html": [ + "009c899a45482b835dad186a822859f12e0e53fd", + "testharness" + ], + "mozilla/document_origin_redirect_subpage.html": [ + "3e68ff395f5475e2b618147f270117f576a5b7bd", + "support" + ], "mozilla/document_readystate.html": [ "7ff8f66cdf74430f86ed7028294530229809d8de", "testharness" diff --git a/tests/wpt/mozilla/tests/mozilla/document_origin_redirect.html b/tests/wpt/mozilla/tests/mozilla/document_origin_redirect.html new file mode 100644 index 00000000000..009c899a454 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/document_origin_redirect.html @@ -0,0 +1,22 @@ + + +A document's origin should match the origin of the final HTTP response + + + + + diff --git a/tests/wpt/mozilla/tests/mozilla/document_origin_redirect_subpage.html b/tests/wpt/mozilla/tests/mozilla/document_origin_redirect_subpage.html new file mode 100644 index 00000000000..3e68ff395f5 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/document_origin_redirect_subpage.html @@ -0,0 +1,32 @@ + + + + +