Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace initial about:blank loads #20579

Merged
merged 2 commits into from Apr 11, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Replace initial about:blank loads

  • Loading branch information
cbrewster committed Apr 11, 2018
commit 5f85824ab3a10e9aa1725304afd54faf721e0e4f
@@ -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>>,
@@ -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),

This file was deleted.

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.