diff options
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index f5a820458c2..e58e65ea5bb 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -28,7 +28,6 @@ use crate::dom::windowproxy::WindowProxy; use crate::script_thread::ScriptThread; use crate::task_source::TaskSource; use dom_struct::dom_struct; -use euclid::Size2D; use html5ever::{LocalName, Prefix}; use ipc_channel::ipc; use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId}; @@ -173,6 +172,13 @@ impl HTMLIFrameElement { replace: replace, }; + let window_size = WindowSizeData { + initial_viewport: window + .inner_window_dimensions_query(browsing_context_id) + .unwrap_or_default(), + device_pixel_ratio: window.device_pixel_ratio(), + }; + match nav_type { NavigationType::InitialAboutBlank => { let (pipeline_sender, pipeline_receiver) = ipc::channel().unwrap(); @@ -184,6 +190,7 @@ impl HTMLIFrameElement { load_data: load_data.clone(), old_pipeline_id: old_pipeline_id, sandbox: sandboxed, + window_size, }; global_scope .script_to_constellation_chan() @@ -198,13 +205,7 @@ impl HTMLIFrameElement { opener: None, load_data: load_data, pipeline_port: pipeline_receiver, - window_size: WindowSizeData { - initial_viewport: { - let rect = self.upcast::<Node>().bounding_content_box_or_zero(); - Size2D::new(rect.size.width.to_f32_px(), rect.size.height.to_f32_px()) - }, - device_pixel_ratio: window.device_pixel_ratio(), - }, + window_size, }; self.pipeline_id.set(Some(new_pipeline_id)); @@ -216,6 +217,7 @@ impl HTMLIFrameElement { load_data: load_data, old_pipeline_id: old_pipeline_id, sandbox: sandboxed, + window_size, }; global_scope .script_to_constellation_chan() |