mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Convert RemoveIFrame message to use pipeline id.
This commit is contained in:
parent
736730f2e7
commit
8d312b0f0c
3 changed files with 17 additions and 23 deletions
|
@ -512,9 +512,9 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
let is_ready = self.handle_is_ready_to_save_image(pipeline_states);
|
let is_ready = self.handle_is_ready_to_save_image(pipeline_states);
|
||||||
self.compositor_proxy.send(CompositorMsg::IsReadyToSaveImageReply(is_ready));
|
self.compositor_proxy.send(CompositorMsg::IsReadyToSaveImageReply(is_ready));
|
||||||
}
|
}
|
||||||
ConstellationMsg::RemoveIFrame(containing_pipeline_id, subpage_id) => {
|
ConstellationMsg::RemoveIFrame(pipeline_id) => {
|
||||||
debug!("constellation got remove iframe message");
|
debug!("constellation got remove iframe message");
|
||||||
self.handle_remove_iframe_msg(containing_pipeline_id, subpage_id);
|
self.handle_remove_iframe_msg(pipeline_id);
|
||||||
}
|
}
|
||||||
ConstellationMsg::NewFavicon(url) => {
|
ConstellationMsg::NewFavicon(url) => {
|
||||||
debug!("constellation got new favicon message");
|
debug!("constellation got new favicon message");
|
||||||
|
@ -947,10 +947,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
self.focus_parent_pipeline(pipeline_id);
|
self.focus_parent_pipeline(pipeline_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_remove_iframe_msg(&mut self,
|
fn handle_remove_iframe_msg(&mut self, pipeline_id: PipelineId) {
|
||||||
containing_pipeline_id: PipelineId,
|
|
||||||
subpage_id: SubpageId) {
|
|
||||||
let pipeline_id = self.find_subpage(containing_pipeline_id, subpage_id).id;
|
|
||||||
let frame_id = self.pipeline_to_frame_map.get(&pipeline_id).map(|id| *id);
|
let frame_id = self.pipeline_to_frame_map.get(&pipeline_id).map(|id| *id);
|
||||||
match frame_id {
|
match frame_id {
|
||||||
Some(frame_id) => {
|
Some(frame_id) => {
|
||||||
|
|
|
@ -276,7 +276,7 @@ pub enum Msg {
|
||||||
/// Query the constellation to see if the current compositor output is stable
|
/// Query the constellation to see if the current compositor output is stable
|
||||||
IsReadyToSaveImage(HashMap<PipelineId, Epoch>),
|
IsReadyToSaveImage(HashMap<PipelineId, Epoch>),
|
||||||
/// Notification that this iframe should be removed.
|
/// Notification that this iframe should be removed.
|
||||||
RemoveIFrame(PipelineId, SubpageId),
|
RemoveIFrame(PipelineId),
|
||||||
/// Favicon detected
|
/// Favicon detected
|
||||||
NewFavicon(Url),
|
NewFavicon(Url),
|
||||||
/// <head> tag finished parsing
|
/// <head> tag finished parsing
|
||||||
|
|
|
@ -431,14 +431,12 @@ impl VirtualMethods for HTMLIFrameElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#a-browsing-context-is-discarded
|
// https://html.spec.whatwg.org/multipage/#a-browsing-context-is-discarded
|
||||||
match (self.containing_page_pipeline_id(), self.subpage_id()) {
|
if let Some(pipeline_id) = self.pipeline_id.get() {
|
||||||
(Some(containing_pipeline_id), Some(subpage_id)) => {
|
|
||||||
let window = window_from_node(self);
|
let window = window_from_node(self);
|
||||||
let window = window.r();
|
let window = window.r();
|
||||||
|
|
||||||
let ConstellationChan(ref chan) = window.constellation_chan();
|
let ConstellationChan(ref chan) = window.constellation_chan();
|
||||||
let msg = ConstellationMsg::RemoveIFrame(containing_pipeline_id,
|
let msg = ConstellationMsg::RemoveIFrame(pipeline_id);
|
||||||
subpage_id);
|
|
||||||
chan.send(msg).unwrap();
|
chan.send(msg).unwrap();
|
||||||
|
|
||||||
// Resetting the subpage id to None is required here so that
|
// Resetting the subpage id to None is required here so that
|
||||||
|
@ -447,8 +445,7 @@ impl VirtualMethods for HTMLIFrameElement {
|
||||||
// a new iframe. Without this, the constellation gets very
|
// a new iframe. Without this, the constellation gets very
|
||||||
// confused.
|
// confused.
|
||||||
self.subpage_id.set(None);
|
self.subpage_id.set(None);
|
||||||
}
|
self.pipeline_id.set(None);
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue