mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Replace initial about:blank loads
This commit is contained in:
parent
004549da9f
commit
5f85824ab3
3 changed files with 10 additions and 11 deletions
|
@ -71,6 +71,7 @@ pub struct HTMLIFrameElement {
|
||||||
browsing_context_id: Cell<Option<BrowsingContextId>>,
|
browsing_context_id: Cell<Option<BrowsingContextId>>,
|
||||||
pipeline_id: Cell<Option<PipelineId>>,
|
pipeline_id: Cell<Option<PipelineId>>,
|
||||||
pending_pipeline_id: Cell<Option<PipelineId>>,
|
pending_pipeline_id: Cell<Option<PipelineId>>,
|
||||||
|
about_blank_pipeline_id: Cell<Option<PipelineId>>,
|
||||||
sandbox: MutNullableDom<DOMTokenList>,
|
sandbox: MutNullableDom<DOMTokenList>,
|
||||||
sandbox_allowance: Cell<Option<SandboxAllowance>>,
|
sandbox_allowance: Cell<Option<SandboxAllowance>>,
|
||||||
load_blocker: DomRefCell<Option<LoadBlocker>>,
|
load_blocker: DomRefCell<Option<LoadBlocker>>,
|
||||||
|
@ -164,6 +165,8 @@ impl HTMLIFrameElement {
|
||||||
NavigationType::InitialAboutBlank => {
|
NavigationType::InitialAboutBlank => {
|
||||||
let (pipeline_sender, pipeline_receiver) = ipc::channel().unwrap();
|
let (pipeline_sender, pipeline_receiver) = ipc::channel().unwrap();
|
||||||
|
|
||||||
|
self.about_blank_pipeline_id.set(Some(new_pipeline_id));
|
||||||
|
|
||||||
global_scope
|
global_scope
|
||||||
.script_to_constellation_chan()
|
.script_to_constellation_chan()
|
||||||
.send(ScriptMsg::ScriptNewIFrame(load_info, pipeline_sender))
|
.send(ScriptMsg::ScriptNewIFrame(load_info, pipeline_sender))
|
||||||
|
@ -231,7 +234,11 @@ impl HTMLIFrameElement {
|
||||||
|
|
||||||
let document = document_from_node(self);
|
let document = document_from_node(self);
|
||||||
let load_data = LoadData::new(url, creator_pipeline_id, document.get_referrer_policy(), Some(document.url()));
|
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) {
|
fn create_nested_browsing_context(&self) {
|
||||||
|
@ -253,6 +260,7 @@ impl HTMLIFrameElement {
|
||||||
fn destroy_nested_browsing_context(&self) {
|
fn destroy_nested_browsing_context(&self) {
|
||||||
self.pipeline_id.set(None);
|
self.pipeline_id.set(None);
|
||||||
self.pending_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.top_level_browsing_context_id.set(None);
|
||||||
self.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),
|
top_level_browsing_context_id: Cell::new(None),
|
||||||
pipeline_id: Cell::new(None),
|
pipeline_id: Cell::new(None),
|
||||||
pending_pipeline_id: Cell::new(None),
|
pending_pipeline_id: Cell::new(None),
|
||||||
|
about_blank_pipeline_id: Cell::new(None),
|
||||||
sandbox: Default::default(),
|
sandbox: Default::default(),
|
||||||
sandbox_allowance: Cell::new(None),
|
sandbox_allowance: Cell::new(None),
|
||||||
load_blocker: DomRefCell::new(None),
|
load_blocker: DomRefCell::new(None),
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[joint-session-history-only-fully-active.html]
|
|
||||||
type: testharness
|
|
||||||
[Do only fully active documents count for session history?]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[location_assign_about_blank.html]
|
|
||||||
type: testharness
|
|
||||||
[location.assign with initial about:blank browsing context]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue