mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Rename LoadIframeUrlMsg to CreateIFrameAndLoadUrlMsg
This better reflects what the message does.
This commit is contained in:
parent
f4471f0602
commit
6e06a1353c
3 changed files with 23 additions and 21 deletions
|
@ -18,9 +18,9 @@ use script_traits::{ScriptControlChan, ScriptTaskFactory};
|
||||||
use servo_msg::compositor_msg::LayerId;
|
use servo_msg::compositor_msg::LayerId;
|
||||||
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, FailureMsg, Failure, FrameRectMsg};
|
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, FailureMsg, Failure, FrameRectMsg};
|
||||||
use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed, InitLoadUrlMsg};
|
use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed, InitLoadUrlMsg};
|
||||||
use servo_msg::constellation_msg::{LoadCompleteMsg, LoadIframeUrlMsg, LoadUrlMsg, Msg};
|
use servo_msg::constellation_msg::{LoadCompleteMsg, LoadUrlMsg, LoadData, Msg, NavigateMsg};
|
||||||
use servo_msg::constellation_msg::{LoadData, NavigateMsg, NavigationType, PipelineId};
|
use servo_msg::constellation_msg::{NavigationType, PipelineId, RendererReadyMsg, ResizedWindowMsg};
|
||||||
use servo_msg::constellation_msg::{RendererReadyMsg, ResizedWindowMsg, SubpageId, WindowSizeData};
|
use servo_msg::constellation_msg::{ScriptLoadedURLInIFrameMsg, SubpageId, WindowSizeData};
|
||||||
use servo_msg::constellation_msg;
|
use servo_msg::constellation_msg;
|
||||||
use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
|
use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
|
||||||
use servo_net::resource_task::ResourceTask;
|
use servo_net::resource_task::ResourceTask;
|
||||||
|
@ -382,9 +382,12 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
debug!("constellation got frame rect message");
|
debug!("constellation got frame rect message");
|
||||||
self.handle_frame_rect_msg(pipeline_id, subpage_id, Rect::from_untyped(&rect));
|
self.handle_frame_rect_msg(pipeline_id, subpage_id, Rect::from_untyped(&rect));
|
||||||
}
|
}
|
||||||
LoadIframeUrlMsg(url, source_pipeline_id, subpage_id, sandbox) => {
|
ScriptLoadedURLInIFrameMsg(url, source_pipeline_id, subpage_id, sandbox) => {
|
||||||
debug!("constellation got iframe URL load message");
|
debug!("constellation got iframe URL load message");
|
||||||
self.handle_load_iframe_url_msg(url, source_pipeline_id, subpage_id, sandbox);
|
self.handle_script_loaded_url_in_iframe_msg(url,
|
||||||
|
source_pipeline_id,
|
||||||
|
subpage_id,
|
||||||
|
sandbox);
|
||||||
}
|
}
|
||||||
// Load a new page, usually -- but not always -- from a mouse click or typed url
|
// Load a new page, usually -- but not always -- from a mouse click or typed url
|
||||||
// If there is already a pending page (self.pending_frames), it will not be overridden;
|
// If there is already a pending page (self.pending_frames), it will not be overridden;
|
||||||
|
@ -593,21 +596,20 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn handle_load_iframe_url_msg(&mut self,
|
// The script task associated with pipeline_id has loaded a URL in an iframe via script. This
|
||||||
url: Url,
|
// will result in a new pipeline being spawned and a frame tree being added to
|
||||||
source_pipeline_id: PipelineId,
|
// source_pipeline_id's frame tree's children. This message is never the result of a page
|
||||||
subpage_id: SubpageId,
|
// navigation.
|
||||||
sandbox: IFrameSandboxState) {
|
fn handle_script_loaded_url_in_iframe_msg(&mut self,
|
||||||
// A message from the script associated with pipeline_id that it has
|
url: Url,
|
||||||
// parsed an iframe during html parsing. This iframe will result in a
|
source_pipeline_id: PipelineId,
|
||||||
// new pipeline being spawned and a frame tree being added to pipeline_id's
|
subpage_id: SubpageId,
|
||||||
// frame tree's children. This message is never the result of a link clicked
|
sandbox: IFrameSandboxState) {
|
||||||
// or a new url entered.
|
// Start by finding the frame trees matching the pipeline id,
|
||||||
// Start by finding the frame trees matching the pipeline id,
|
|
||||||
// and add the new pipeline to their sub frames.
|
// and add the new pipeline to their sub frames.
|
||||||
let frame_trees = self.find_all(source_pipeline_id);
|
let frame_trees = self.find_all(source_pipeline_id);
|
||||||
if frame_trees.is_empty() {
|
if frame_trees.is_empty() {
|
||||||
fail!("Constellation: source pipeline id of LoadIframeUrlMsg is not in
|
fail!("Constellation: source pipeline id of ScriptLoadedURLInIFrameMsg is not in
|
||||||
navigation context, nor is it in a pending frame. This should be
|
navigation context, nor is it in a pending frame. This should be
|
||||||
impossible.");
|
impossible.");
|
||||||
}
|
}
|
||||||
|
@ -617,7 +619,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
// Compare the pipeline's url to the new url. If the origin is the same,
|
// Compare the pipeline's url to the new url. If the origin is the same,
|
||||||
// then reuse the script task in creating the new pipeline
|
// then reuse the script task in creating the new pipeline
|
||||||
let source_pipeline = self.pipelines.find(&source_pipeline_id).expect("Constellation:
|
let source_pipeline = self.pipelines.find(&source_pipeline_id).expect("Constellation:
|
||||||
source Id of LoadIframeUrlMsg does have an associated pipeline in
|
source Id of ScriptLoadedURLInIFrameMsg does have an associated pipeline in
|
||||||
constellation. This should be impossible.").clone();
|
constellation. This should be impossible.").clone();
|
||||||
|
|
||||||
let source_url = source_pipeline.load_data.url.clone();
|
let source_url = source_pipeline.load_data.url.clone();
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub enum Msg {
|
||||||
LoadCompleteMsg(PipelineId, Url),
|
LoadCompleteMsg(PipelineId, Url),
|
||||||
FrameRectMsg(PipelineId, SubpageId, Rect<f32>),
|
FrameRectMsg(PipelineId, SubpageId, Rect<f32>),
|
||||||
LoadUrlMsg(PipelineId, LoadData),
|
LoadUrlMsg(PipelineId, LoadData),
|
||||||
LoadIframeUrlMsg(Url, PipelineId, SubpageId, IFrameSandboxState),
|
ScriptLoadedURLInIFrameMsg(Url, PipelineId, SubpageId, IFrameSandboxState),
|
||||||
NavigateMsg(NavigationDirection),
|
NavigateMsg(NavigationDirection),
|
||||||
RendererReadyMsg(PipelineId),
|
RendererReadyMsg(PipelineId),
|
||||||
ResizedWindowMsg(WindowSizeData),
|
ResizedWindowMsg(WindowSizeData),
|
||||||
|
|
|
@ -23,7 +23,7 @@ use page::IterablePage;
|
||||||
|
|
||||||
use servo_msg::constellation_msg::{PipelineId, SubpageId};
|
use servo_msg::constellation_msg::{PipelineId, SubpageId};
|
||||||
use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed};
|
use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed};
|
||||||
use servo_msg::constellation_msg::{ConstellationChan, LoadIframeUrlMsg};
|
use servo_msg::constellation_msg::{ConstellationChan, ScriptLoadedURLInIFrameMsg};
|
||||||
use servo_util::str::DOMString;
|
use servo_util::str::DOMString;
|
||||||
|
|
||||||
use std::ascii::StrAsciiExt;
|
use std::ascii::StrAsciiExt;
|
||||||
|
@ -125,7 +125,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
|
||||||
// https://github.com/servo/servo/issues/3738
|
// https://github.com/servo/servo/issues/3738
|
||||||
// We can't handle dynamic frame tree changes in the compositor right now.
|
// We can't handle dynamic frame tree changes in the compositor right now.
|
||||||
let ConstellationChan(ref chan) = page.constellation_chan;
|
let ConstellationChan(ref chan) = page.constellation_chan;
|
||||||
chan.send(LoadIframeUrlMsg(url, page.id, subpage_id, sandboxed));
|
chan.send(ScriptLoadedURLInIFrameMsg(url, page.id, subpage_id, sandboxed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue