From 004549da9f931fca7020c7ebe61acc29a31a6c63 Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Mon, 9 Apr 2018 21:41:20 -0500 Subject: [PATCH 1/2] Update pipeline activity before closing pipelines --- components/constellation/constellation.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 9b3e2e8a160..9217939ee2c 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -2438,12 +2438,13 @@ impl Constellation .collect::>() }; + self.update_activity(old_pipeline_id); + self.update_activity(change.new_pipeline_id); + for pipeline_id in pipelines_to_close { self.close_pipeline(pipeline_id, DiscardBrowsingContext::No, ExitPipelineMode::Normal); } - self.update_activity(old_pipeline_id); - self.update_activity(change.new_pipeline_id); self.notify_history_changed(change.top_level_browsing_context_id); } } From 5f85824ab3a10e9aa1725304afd54faf721e0e4f Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Fri, 6 Apr 2018 20:09:55 -0500 Subject: [PATCH 2/2] Replace initial about:blank loads --- components/script/dom/htmliframeelement.rs | 11 ++++++++++- .../joint-session-history-only-fully-active.html.ini | 5 ----- .../location_assign_about_blank.html.ini | 5 ----- 3 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 tests/wpt/metadata/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html.ini delete mode 100644 tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign_about_blank.html.ini diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 4fcd21c6cf1..373aa9c254f 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -71,6 +71,7 @@ pub struct HTMLIFrameElement { browsing_context_id: Cell>, pipeline_id: Cell>, pending_pipeline_id: Cell>, + about_blank_pipeline_id: Cell>, sandbox: MutNullableDom, sandbox_allowance: Cell>, load_blocker: DomRefCell>, @@ -164,6 +165,8 @@ impl HTMLIFrameElement { NavigationType::InitialAboutBlank => { let (pipeline_sender, pipeline_receiver) = ipc::channel().unwrap(); + self.about_blank_pipeline_id.set(Some(new_pipeline_id)); + global_scope .script_to_constellation_chan() .send(ScriptMsg::ScriptNewIFrame(load_info, pipeline_sender)) @@ -231,7 +234,11 @@ impl HTMLIFrameElement { let document = document_from_node(self); let load_data = LoadData::new(url, creator_pipeline_id, document.get_referrer_policy(), Some(document.url())); - self.navigate_or_reload_child_browsing_context(Some(load_data), NavigationType::Regular, false); + + let pipeline_id = self.pipeline_id(); + // If the initial `about:blank` page is the current page, load with replacement enabled. + let replace = pipeline_id.is_some() && pipeline_id == self.about_blank_pipeline_id.get(); + self.navigate_or_reload_child_browsing_context(Some(load_data), NavigationType::Regular, replace); } fn create_nested_browsing_context(&self) { @@ -253,6 +260,7 @@ impl HTMLIFrameElement { fn destroy_nested_browsing_context(&self) { self.pipeline_id.set(None); self.pending_pipeline_id.set(None); + self.about_blank_pipeline_id.set(None); self.top_level_browsing_context_id.set(None); self.browsing_context_id.set(None); } @@ -285,6 +293,7 @@ impl HTMLIFrameElement { top_level_browsing_context_id: Cell::new(None), pipeline_id: Cell::new(None), pending_pipeline_id: Cell::new(None), + about_blank_pipeline_id: Cell::new(None), sandbox: Default::default(), sandbox_allowance: Cell::new(None), load_blocker: DomRefCell::new(None), diff --git a/tests/wpt/metadata/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html.ini b/tests/wpt/metadata/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html.ini deleted file mode 100644 index c8cb7c63612..00000000000 --- a/tests/wpt/metadata/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[joint-session-history-only-fully-active.html] - type: testharness - [Do only fully active documents count for session history?] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign_about_blank.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign_about_blank.html.ini deleted file mode 100644 index c144ee2f49f..00000000000 --- a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign_about_blank.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[location_assign_about_blank.html] - type: testharness - [location.assign with initial about:blank browsing context] - expected: FAIL -