aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/query.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-11-06 15:55:11 -0500
committerJosh Matthews <josh@joshmatthews.net>2019-11-06 16:13:55 -0500
commitfd260f78c80a070727ba88d7b5f7cc40eb7efb5a (patch)
treee5d20c19d3a8e3a79f88e9ceff0e8b8f772568a9 /components/layout_2020/query.rs
parent38e4ae0833fbc15c8579d40bca7fc87e9d37cb03 (diff)
downloadservo-fd260f78c80a070727ba88d7b5f7cc40eb7efb5a.tar.gz
servo-fd260f78c80a070727ba88d7b5f7cc40eb7efb5a.zip
dom: Calculate the viewport size of iframes when they are first added to the tree.
Diffstat (limited to 'components/layout_2020/query.rs')
-rw-r--r--components/layout_2020/query.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs
index 23816521c70..1317759b33b 100644
--- a/components/layout_2020/query.rs
+++ b/components/layout_2020/query.rs
@@ -7,6 +7,7 @@
use crate::context::LayoutContext;
use app_units::Au;
use euclid::default::{Point2D, Rect};
+use euclid::Size2D;
use euclid::Vector2D;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId;
@@ -22,6 +23,7 @@ use std::sync::{Arc, Mutex};
use style::dom::OpaqueNode;
use style::properties::PropertyId;
use style::selector_parser::PseudoElement;
+use style_traits::CSSPixel;
use webrender_api::units::LayoutPixel;
use webrender_api::ExternalScrollId;
@@ -70,6 +72,9 @@ pub struct LayoutThreadData {
/// A queued response for the inner text of a given element.
pub element_inner_text_response: String,
+
+ /// A queued response for the viewport dimensions for a given browsing context.
+ pub inner_window_dimensions_response: Option<Size2D<f32, CSSPixel>>,
}
pub struct LayoutRPCImpl(pub Arc<Mutex<LayoutThreadData>>);
@@ -150,6 +155,12 @@ impl LayoutRPC for LayoutRPCImpl {
let rw_data = rw_data.lock().unwrap();
rw_data.element_inner_text_response.clone()
}
+
+ fn inner_window_dimensions(&self) -> Option<Size2D<f32, CSSPixel>> {
+ let &LayoutRPCImpl(ref rw_data) = self;
+ let rw_data = rw_data.lock().unwrap();
+ rw_data.inner_window_dimensions_response.clone()
+ }
}
pub fn process_content_box_request(_requested_node: OpaqueNode) -> Option<Rect<Au>> {