diff options
author | Josh Matthews <josh@joshmatthews.net> | 2020-01-15 11:09:37 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2020-01-15 11:09:37 -0500 |
commit | c385953c97d5f1eb0190487c314274c02904b7f7 (patch) | |
tree | 5f651d733950a07d2ff44a1a5f99f56bc6baabc0 /components/script | |
parent | 9a518cf7979b79b34611135d09c1dd0a96945255 (diff) | |
download | servo-jdm-revert4.tar.gz servo-jdm-revert4.zip |
Revert "Auto merge of #24677 - jdm:iframe-sizing-cleanup, r=asajeffrey"jdm-revert4
This reverts commit 9a518cf7979b79b34611135d09c1dd0a96945255, reversing
changes made to a33d493a4ff6f8a629a9b82202c49c41ecbefa49.
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 18 | ||||
-rw-r--r-- | components/script/dom/window.rs | 13 | ||||
-rw-r--r-- | components/script/script_thread.rs | 10 |
3 files changed, 9 insertions, 32 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index e58e65ea5bb..f5a820458c2 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -28,6 +28,7 @@ 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}; @@ -172,13 +173,6 @@ 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(); @@ -190,7 +184,6 @@ impl HTMLIFrameElement { load_data: load_data.clone(), old_pipeline_id: old_pipeline_id, sandbox: sandboxed, - window_size, }; global_scope .script_to_constellation_chan() @@ -205,7 +198,13 @@ impl HTMLIFrameElement { opener: None, load_data: load_data, pipeline_port: pipeline_receiver, - window_size, + 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(), + }, }; self.pipeline_id.set(Some(new_pipeline_id)); @@ -217,7 +216,6 @@ impl HTMLIFrameElement { load_data: load_data, old_pipeline_id: old_pipeline_id, sandbox: sandboxed, - window_size, }; global_scope .script_to_constellation_chan() diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 95326b46352..70099ee5866 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -89,7 +89,7 @@ use js::jsval::{JSVal, NullValue}; use js::rust::wrappers::JS_DefineProperty; use js::rust::{CustomAutoRooter, CustomAutoRooterGuard, HandleValue}; use media::WindowGLContext; -use msg::constellation_msg::{BrowsingContextId, PipelineId}; +use msg::constellation_msg::PipelineId; use net_traits::image_cache::{ImageCache, ImageResponder, ImageResponse}; use net_traits::image_cache::{PendingImageId, PendingImageResponse}; use net_traits::storage_thread::StorageType; @@ -1829,16 +1829,6 @@ impl Window { DOMString::from(resolved) } - pub fn inner_window_dimensions_query( - &self, - browsing_context: BrowsingContextId, - ) -> Option<Size2D<f32, CSSPixel>> { - if !self.layout_reflow(QueryMsg::InnerWindowDimensionsQuery(browsing_context)) { - return None; - } - self.layout_rpc.inner_window_dimensions() - } - #[allow(unsafe_code)] pub fn offset_parent_query(&self, node: &Node) -> (Option<DomRoot<Element>>, UntypedRect<Au>) { if !self.layout_reflow(QueryMsg::OffsetParentQuery(node.to_opaque())) { @@ -2369,7 +2359,6 @@ fn debug_reflow_events(id: PipelineId, reflow_goal: &ReflowGoal, reason: &Reflow &QueryMsg::StyleQuery(_n) => "\tStyleQuery", &QueryMsg::TextIndexQuery(..) => "\tTextIndexQuery", &QueryMsg::ElementInnerTextQuery(_) => "\tElementInnerTextQuery", - &QueryMsg::InnerWindowDimensionsQuery(_) => "\tInnerWindowDimensionsQuery", }, }); diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 191df335ec5..6a7a69651e7 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2392,7 +2392,6 @@ impl ScriptThread { load_data.url.clone(), ), layout_is_busy: layout_is_busy.clone(), - window_size, }); // Pick a layout thread, any layout thread @@ -3697,15 +3696,6 @@ impl ScriptThread { }; let window = document.window(); - if window.window_size() == new_size { - return; - } - debug!( - "resizing pipeline {:?} from {:?} to {:?}", - pipeline_id, - window.window_size(), - new_size - ); window.set_window_size(new_size); window.force_reflow(ReflowGoal::Full, ReflowReason::WindowResize); |