diff options
Diffstat (limited to 'components/shared/script_layout')
-rw-r--r-- | components/shared/script_layout/Cargo.toml | 1 | ||||
-rw-r--r-- | components/shared/script_layout/lib.rs | 18 |
2 files changed, 15 insertions, 4 deletions
diff --git a/components/shared/script_layout/Cargo.toml b/components/shared/script_layout/Cargo.toml index 5de7c95f9c7..1dee24a3107 100644 --- a/components/shared/script_layout/Cargo.toml +++ b/components/shared/script_layout/Cargo.toml @@ -18,6 +18,7 @@ atomic_refcell = { workspace = true } canvas_traits = { workspace = true } crossbeam-channel = { workspace = true } euclid = { workspace = true } +fnv = { workspace = true } fonts = { path = "../../fonts" } fonts_traits = { workspace = true } html5ever = { workspace = true } diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs index 591e356320c..f8643e866e7 100644 --- a/components/shared/script_layout/lib.rs +++ b/components/shared/script_layout/lib.rs @@ -23,6 +23,7 @@ use base::Epoch; use canvas_traits::canvas::{CanvasId, CanvasMsg}; use euclid::default::{Point2D, Rect}; use euclid::Size2D; +use fnv::FnvHashMap; use fonts::SystemFontServiceProxy; use ipc_channel::ipc::IpcSender; use libc::c_void; @@ -257,10 +258,6 @@ pub trait Layout { fn query_content_boxes(&self, node: OpaqueNode) -> Vec<Rect<Au>>; fn query_client_rect(&self, node: OpaqueNode) -> Rect<i32>; fn query_element_inner_outer_text(&self, node: TrustedNodeAddress) -> String; - fn query_inner_window_dimension( - &self, - context: BrowsingContextId, - ) -> Option<Size2D<f32, CSSPixel>>; fn query_nodes_from_point( &self, point: Point2D<f32>, @@ -400,11 +397,24 @@ pub struct Reflow { pub page_clip_rect: Rect<Au>, } +#[derive(Clone, Debug, MallocSizeOf)] +pub struct IFrameSize { + pub browsing_context_id: BrowsingContextId, + pub pipeline_id: PipelineId, + pub size: Size2D<f32, CSSPixel>, +} + +pub type IFrameSizes = FnvHashMap<BrowsingContextId, IFrameSize>; + /// Information derived from a layout pass that needs to be returned to the script thread. #[derive(Debug, Default)] pub struct ReflowResult { /// The list of images that were encountered that are in progress. pub pending_images: Vec<PendingImage>, + /// The list of iframes in this layout and their sizes, used in order + /// to communicate them with the Constellation and also the `Window` + /// element of their content pages. + pub iframe_sizes: IFrameSizes, } /// Information needed for a script-initiated reflow. |