Remove constellation round trip for subpage mapping in compositor.

This makes use of the new functionality that allows iframes to generate their own pipeline IDs in order to remove any knowledge of subpage ids from the compositor.

(This is the first of several commits removing subpage from parts of servo).
This commit is contained in:
Glenn Watson 2015-10-07 11:18:42 +10:00
parent 5eb1c04e78
commit da881947e5
11 changed files with 47 additions and 139 deletions

View file

@ -1289,7 +1289,6 @@ impl FragmentDisplayListBuilding for Fragment {
let border_padding = self.border_padding.to_physical(self.style().writing_mode);
Some(SubpageLayerInfo {
pipeline_id: iframe_fragment_info.pipeline_id,
subpage_id: iframe_fragment_info.subpage_id,
origin: Point2D::new(border_padding.left, border_padding.top),
})
}

View file

@ -24,7 +24,7 @@ use ipc_channel::ipc::IpcSender;
use layout_debug;
use model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified};
use msg::compositor_msg::{LayerId, LayerType};
use msg::constellation_msg::{PipelineId, SubpageId};
use msg::constellation_msg::PipelineId;
use net_traits::image::base::Image;
use net_traits::image_cache_task::UsePlaceholder;
use rustc_serialize::{Encodable, Encoder};
@ -578,17 +578,14 @@ impl ReplacedImageFragmentInfo {
pub struct IframeFragmentInfo {
/// The pipeline ID of this iframe.
pub pipeline_id: PipelineId,
/// The subpage ID of this iframe.
pub subpage_id: SubpageId,
}
impl IframeFragmentInfo {
/// Creates the information specific to an iframe fragment.
pub fn new(node: &ThreadSafeLayoutNode) -> IframeFragmentInfo {
let (pipeline_id, subpage_id) = node.iframe_pipeline_and_subpage_ids();
let pipeline_id = node.iframe_pipeline_id();
IframeFragmentInfo {
pipeline_id: pipeline_id,
subpage_id: subpage_id,
}
}

View file

@ -37,7 +37,7 @@ use gfx::display_list::OpaqueNode;
use gfx::text::glyph::CharIndex;
use incremental::RestyleDamage;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{PipelineId, SubpageId};
use msg::constellation_msg::PipelineId;
use opaque_node::OpaqueNodeMethods;
use script::dom::attr::AttrValue;
use script::dom::bindings::codegen::InheritTypes::{CharacterDataCast, ElementCast};
@ -1011,14 +1011,13 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
}
}
/// If this node is an iframe element, returns its pipeline and subpage IDs. If this node is
/// If this node is an iframe element, returns its pipeline ID. If this node is
/// not an iframe element, fails.
pub fn iframe_pipeline_and_subpage_ids(&self) -> (PipelineId, SubpageId) {
pub fn iframe_pipeline_id(&self) -> PipelineId {
unsafe {
let iframe_element = HTMLIFrameElementCast::to_layout_js(self.get_jsmanaged())
.expect("not an iframe element!");
((*iframe_element.unsafe_get()).containing_page_pipeline_id().unwrap(),
(*iframe_element.unsafe_get()).subpage_id().unwrap())
(*iframe_element.unsafe_get()).pipeline_id().unwrap()
}
}
}