mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Consistently use parent_pipeline_id
Instead of containing_pipeline_id, use parent_pipeline_id because it is more clear that it refers to the immediate parent.
This commit is contained in:
parent
9d097e7d15
commit
b9b25b6f82
6 changed files with 56 additions and 56 deletions
|
@ -1342,8 +1342,8 @@ impl Document {
|
|||
|
||||
pub fn trigger_mozbrowser_event(&self, event: MozBrowserEvent) {
|
||||
if PREFS.is_mozbrowser_enabled() {
|
||||
if let Some((containing_pipeline_id, subpage_id, _)) = self.window.parent_info() {
|
||||
let event = ConstellationMsg::MozBrowserEvent(containing_pipeline_id,
|
||||
if let Some((parent_pipeline_id, subpage_id, _)) = self.window.parent_info() {
|
||||
let event = ConstellationMsg::MozBrowserEvent(parent_pipeline_id,
|
||||
Some(subpage_id),
|
||||
event);
|
||||
self.window.constellation_chan().send(event).unwrap();
|
||||
|
|
|
@ -133,7 +133,7 @@ impl HTMLIFrameElement {
|
|||
|
||||
let load_info = IFrameLoadInfo {
|
||||
load_data: load_data,
|
||||
containing_pipeline_id: window.pipeline_id(),
|
||||
parent_pipeline_id: window.pipeline_id(),
|
||||
new_subpage_id: new_subpage_id,
|
||||
old_subpage_id: old_subpage_id,
|
||||
new_pipeline_id: new_pipeline_id,
|
||||
|
|
|
@ -877,8 +877,8 @@ impl ScriptThread {
|
|||
|
||||
fn handle_msg_from_constellation(&self, msg: ConstellationControlMsg) {
|
||||
match msg {
|
||||
ConstellationControlMsg::Navigate(pipeline_id, subpage_id, load_data) =>
|
||||
self.handle_navigate(pipeline_id, Some(subpage_id), load_data),
|
||||
ConstellationControlMsg::Navigate(parent_pipeline_id, subpage_id, load_data) =>
|
||||
self.handle_navigate(parent_pipeline_id, Some(subpage_id), load_data),
|
||||
ConstellationControlMsg::SendEvent(id, event) =>
|
||||
self.handle_event(id, event),
|
||||
ConstellationControlMsg::ResizeInactive(id, new_size) =>
|
||||
|
@ -891,24 +891,24 @@ impl ScriptThread {
|
|||
self.handle_thaw_msg(pipeline_id),
|
||||
ConstellationControlMsg::ChangeFrameVisibilityStatus(pipeline_id, visible) =>
|
||||
self.handle_visibility_change_msg(pipeline_id, visible),
|
||||
ConstellationControlMsg::NotifyVisibilityChange(containing_id, pipeline_id, visible) =>
|
||||
self.handle_visibility_change_complete_msg(containing_id, pipeline_id, visible),
|
||||
ConstellationControlMsg::NotifyVisibilityChange(parent_pipeline_id, pipeline_id, visible) =>
|
||||
self.handle_visibility_change_complete_msg(parent_pipeline_id, pipeline_id, visible),
|
||||
ConstellationControlMsg::MozBrowserEvent(parent_pipeline_id,
|
||||
subpage_id,
|
||||
event) =>
|
||||
self.handle_mozbrowser_event_msg(parent_pipeline_id,
|
||||
subpage_id,
|
||||
event),
|
||||
ConstellationControlMsg::UpdateSubpageId(containing_pipeline_id,
|
||||
ConstellationControlMsg::UpdateSubpageId(parent_pipeline_id,
|
||||
old_subpage_id,
|
||||
new_subpage_id,
|
||||
new_pipeline_id) =>
|
||||
self.handle_update_subpage_id(containing_pipeline_id,
|
||||
self.handle_update_subpage_id(parent_pipeline_id,
|
||||
old_subpage_id,
|
||||
new_subpage_id,
|
||||
new_pipeline_id),
|
||||
ConstellationControlMsg::FocusIFrame(containing_pipeline_id, subpage_id) =>
|
||||
self.handle_focus_iframe_msg(containing_pipeline_id, subpage_id),
|
||||
ConstellationControlMsg::FocusIFrame(parent_pipeline_id, subpage_id) =>
|
||||
self.handle_focus_iframe_msg(parent_pipeline_id, subpage_id),
|
||||
ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, msg) =>
|
||||
self.handle_webdriver_msg(pipeline_id, msg),
|
||||
ConstellationControlMsg::TickAllAnimations(pipeline_id) =>
|
||||
|
@ -916,10 +916,10 @@ impl ScriptThread {
|
|||
ConstellationControlMsg::WebFontLoaded(pipeline_id) =>
|
||||
self.handle_web_font_loaded(pipeline_id),
|
||||
ConstellationControlMsg::DispatchFrameLoadEvent {
|
||||
target: pipeline_id, parent: containing_id } =>
|
||||
self.handle_frame_load_event(containing_id, pipeline_id),
|
||||
ConstellationControlMsg::FramedContentChanged(containing_pipeline_id, subpage_id) =>
|
||||
self.handle_framed_content_changed(containing_pipeline_id, subpage_id),
|
||||
target: pipeline_id, parent: parent_pipeline_id } =>
|
||||
self.handle_frame_load_event(parent_pipeline_id, pipeline_id),
|
||||
ConstellationControlMsg::FramedContentChanged(parent_pipeline_id, pipeline_id) =>
|
||||
self.handle_framed_content_changed(parent_pipeline_id, pipeline_id),
|
||||
ConstellationControlMsg::ReportCSSError(pipeline_id, filename, line, column, msg) =>
|
||||
self.handle_css_error_reporting(pipeline_id, filename, line, column, msg),
|
||||
ConstellationControlMsg::Reload(pipeline_id) =>
|
||||
|
@ -935,8 +935,8 @@ impl ScriptThread {
|
|||
|
||||
fn handle_msg_from_script(&self, msg: MainThreadScriptMsg) {
|
||||
match msg {
|
||||
MainThreadScriptMsg::Navigate(id, load_data) =>
|
||||
self.handle_navigate(id, None, load_data),
|
||||
MainThreadScriptMsg::Navigate(parent_pipeline_id, load_data) =>
|
||||
self.handle_navigate(parent_pipeline_id, None, load_data),
|
||||
MainThreadScriptMsg::ExitWindow(id) =>
|
||||
self.handle_exit_window_msg(id),
|
||||
MainThreadScriptMsg::DocumentLoadsComplete(id) =>
|
||||
|
@ -1128,7 +1128,7 @@ impl ScriptThread {
|
|||
|
||||
fn handle_new_layout(&self, new_layout_info: NewLayoutInfo) {
|
||||
let NewLayoutInfo {
|
||||
containing_pipeline_id,
|
||||
parent_pipeline_id,
|
||||
new_pipeline_id,
|
||||
subpage_id,
|
||||
frame_type,
|
||||
|
@ -1158,7 +1158,7 @@ impl ScriptThread {
|
|||
};
|
||||
|
||||
let context = self.root_browsing_context();
|
||||
let parent_context = context.find(containing_pipeline_id).expect("ScriptThread: received a layout
|
||||
let parent_context = context.find(parent_pipeline_id).expect("ScriptThread: received a layout
|
||||
whose parent has a PipelineId which does not correspond to a pipeline in the script
|
||||
thread's browsing context tree. This is a bug.");
|
||||
let parent_window = parent_context.active_window();
|
||||
|
@ -1169,7 +1169,7 @@ impl ScriptThread {
|
|||
.unwrap();
|
||||
|
||||
// Kick off the fetch for the new resource.
|
||||
let new_load = InProgressLoad::new(new_pipeline_id, Some((containing_pipeline_id, subpage_id, frame_type)),
|
||||
let new_load = InProgressLoad::new(new_pipeline_id, Some((parent_pipeline_id, subpage_id, frame_type)),
|
||||
layout_chan, parent_window.window_size(),
|
||||
load_data.url.clone());
|
||||
self.start_page_load(new_load, load_data);
|
||||
|
@ -1254,9 +1254,9 @@ impl ScriptThread {
|
|||
}
|
||||
|
||||
/// Updates iframe element after a change in visibility
|
||||
fn handle_visibility_change_complete_msg(&self, containing_id: PipelineId, id: PipelineId, visible: bool) {
|
||||
fn handle_visibility_change_complete_msg(&self, parent_pipeline_id: PipelineId, id: PipelineId, visible: bool) {
|
||||
if let Some(root_context) = self.browsing_context.get() {
|
||||
if let Some(ref inner_context) = root_context.find(containing_id) {
|
||||
if let Some(ref inner_context) = root_context.find(parent_pipeline_id) {
|
||||
if let Some(iframe) = inner_context.active_document().find_iframe_by_pipeline(id) {
|
||||
iframe.change_visibility_status(visible);
|
||||
}
|
||||
|
@ -1372,13 +1372,13 @@ impl ScriptThread {
|
|||
}
|
||||
|
||||
fn handle_update_subpage_id(&self,
|
||||
containing_pipeline_id: PipelineId,
|
||||
parent_pipeline_id: PipelineId,
|
||||
old_subpage_id: SubpageId,
|
||||
new_subpage_id: SubpageId,
|
||||
new_pipeline_id: PipelineId) {
|
||||
let borrowed_context = self.root_browsing_context();
|
||||
|
||||
let frame_element = borrowed_context.find(containing_pipeline_id).and_then(|context| {
|
||||
let frame_element = borrowed_context.find(parent_pipeline_id).and_then(|context| {
|
||||
let doc = context.active_document();
|
||||
doc.find_iframe(old_subpage_id)
|
||||
});
|
||||
|
@ -1534,10 +1534,10 @@ impl ScriptThread {
|
|||
}
|
||||
|
||||
/// Notify the containing document of a child frame that has completed loading.
|
||||
fn handle_frame_load_event(&self, containing_pipeline: PipelineId, id: PipelineId) {
|
||||
let document = match self.root_browsing_context().find(containing_pipeline) {
|
||||
fn handle_frame_load_event(&self, parent_pipeline_id: PipelineId, id: PipelineId) {
|
||||
let document = match self.root_browsing_context().find(parent_pipeline_id) {
|
||||
Some(browsing_context) => browsing_context.active_document(),
|
||||
None => return warn!("Message sent to closed pipeline {}.", containing_pipeline),
|
||||
None => return warn!("Message sent to closed pipeline {}.", parent_pipeline_id),
|
||||
};
|
||||
if let Some(iframe) = document.find_iframe_by_pipeline(id) {
|
||||
iframe.iframe_load_event_steps(id);
|
||||
|
@ -2006,19 +2006,19 @@ impl ScriptThread {
|
|||
/// https://html.spec.whatwg.org/multipage/#navigating-across-documents
|
||||
/// The entry point for content to notify that a new load has been requested
|
||||
/// for the given pipeline (specifically the "navigate" algorithm).
|
||||
fn handle_navigate(&self, pipeline_id: PipelineId, subpage_id: Option<SubpageId>, load_data: LoadData) {
|
||||
fn handle_navigate(&self, parent_pipeline_id: PipelineId, subpage_id: Option<SubpageId>, load_data: LoadData) {
|
||||
// Step 7.
|
||||
{
|
||||
let nurl = &load_data.url;
|
||||
if let Some(fragment) = nurl.fragment() {
|
||||
let document = match self.root_browsing_context().find(pipeline_id) {
|
||||
let document = match self.root_browsing_context().find(parent_pipeline_id) {
|
||||
Some(browsing_context) => browsing_context.active_document(),
|
||||
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
||||
None => return warn!("Message sent to closed pipeline {}.", parent_pipeline_id),
|
||||
};
|
||||
let url = document.url();
|
||||
if &url[..Position::AfterQuery] == &nurl[..Position::AfterQuery] &&
|
||||
load_data.method == Method::Get {
|
||||
self.check_and_scroll_fragment(fragment, pipeline_id, document.r());
|
||||
self.check_and_scroll_fragment(fragment, parent_pipeline_id, document.r());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2027,7 +2027,7 @@ impl ScriptThread {
|
|||
match subpage_id {
|
||||
Some(subpage_id) => {
|
||||
let root_context = self.root_browsing_context();
|
||||
let iframe = root_context.find(pipeline_id).and_then(|context| {
|
||||
let iframe = root_context.find(parent_pipeline_id).and_then(|context| {
|
||||
let doc = context.active_document();
|
||||
doc.find_iframe(subpage_id)
|
||||
});
|
||||
|
@ -2037,7 +2037,7 @@ impl ScriptThread {
|
|||
}
|
||||
None => {
|
||||
self.constellation_chan
|
||||
.send(ConstellationMsg::LoadUrl(pipeline_id, load_data))
|
||||
.send(ConstellationMsg::LoadUrl(parent_pipeline_id, load_data))
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue