Skip to content

Commit

Permalink
Replace initial about:blank loads
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrewster committed Apr 10, 2018
1 parent 13a358f commit c3c6c3e
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 14 deletions.
11 changes: 10 additions & 1 deletion components/script/dom/htmliframeelement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub struct HTMLIFrameElement {
browsing_context_id: Cell<Option<BrowsingContextId>>,
pipeline_id: Cell<Option<PipelineId>>,
pending_pipeline_id: Cell<Option<PipelineId>>,
about_blank_pipeline_id: Cell<Option<PipelineId>>,
sandbox: MutNullableDom<DOMTokenList>,
sandbox_allowance: Cell<Option<SandboxAllowance>>,
load_blocker: DomRefCell<Option<LoadBlocker>>,
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}
Expand Down Expand Up @@ -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),
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[iframe_sandbox_block_modals-1.html]
expected: TIMEOUT
[Frames without `allow-modals` should not be able to open modal dialogs]
bug: https://github.com/servo/servo/issues/20604
expected: TIMEOUT

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[access-control-basic-allow-access-control-origin-header-data-url.htm]
type: testharness
expected: TIMEOUT
[Access granted to null-origin iframe]
expected: FAIL
bug: https://github.com/servo/servo/issues/20604
expected: TIMEOUT

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[access-control-sandboxed-iframe-allow-origin-null.htm]
expected: TIMEOUT
[Tests that sandboxed iframe has CORS XHR access to a server that accepts null domain]
bug: https://github.com/servo/servo/issues/20604
expected: TIMEOUT

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[access-control-sandboxed-iframe-allow.htm]
expected: TIMEOUT
[Tests that sandboxed iframe has CORS XHR access to a server that accepts all domains]
bug: https://github.com/servo/servo/issues/20604
expected: TIMEOUT

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[access-control-sandboxed-iframe-denied-without-wildcard.htm]
type: testharness
expected: TIMEOUT
[Sandboxed iframe is denied CORS access to server that allows parent origin]
expected: FAIL
bug: https://github.com/servo/servo/issues/20604
expected: TIMEOUT

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[access-control-sandboxed-iframe-denied.htm]
type: testharness
expected: TIMEOUT
[Sandboxed iframe is denied access to path]
expected: FAIL
bug: https://github.com/servo/servo/issues/20604
expected: TIMEOUT

0 comments on commit c3c6c3e

Please sign in to comment.