diff options
author | Michael Howell <michael@notriddle.com> | 2016-04-16 14:04:03 -0700 |
---|---|---|
committer | Michael Howell <michael@notriddle.com> | 2016-04-22 13:36:43 -0700 |
commit | 7940b22158d892293641aa25df7720316db7e573 (patch) | |
tree | 97b68c98d0b163ebadad58e793ecb0ba623dcd52 /components/script/dom/window.rs | |
parent | 75d99eec0ff02718f1ec8d1b6fd58fff7c2d6fb3 (diff) | |
download | servo-7940b22158d892293641aa25df7720316db7e573.tar.gz servo-7940b22158d892293641aa25df7720316db7e573.zip |
compositing/script: Do not dispatch the resize event when initially loading.
No bug report corresponds to this, but I noticed it while trying to
reduce #10593
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 82bfee7e279..d5abbfbcc3a 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -43,7 +43,8 @@ use js::rust::Runtime; use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowQueryType, MarginStyleResponse}; use libc; -use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId, SubpageId, WindowSizeData}; +use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId, SubpageId}; +use msg::constellation_msg::{WindowSizeData, WindowSizeType}; use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use net_traits::ResourceThread; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread}; @@ -181,7 +182,7 @@ pub struct Window { next_subpage_id: Cell<SubpageId>, /// Pending resize event, if any. - resize_event: Cell<Option<WindowSizeData>>, + resize_event: Cell<Option<(WindowSizeData, WindowSizeType)>>, /// Pipeline id associated with this page. id: PipelineId, @@ -1280,11 +1281,11 @@ impl Window { self.pending_reflow_count.set(self.pending_reflow_count.get() + 1); } - pub fn set_resize_event(&self, event: WindowSizeData) { - self.resize_event.set(Some(event)); + pub fn set_resize_event(&self, event: WindowSizeData, event_type: WindowSizeType) { + self.resize_event.set(Some((event, event_type))); } - pub fn steal_resize_event(&self) -> Option<WindowSizeData> { + pub fn steal_resize_event(&self) -> Option<(WindowSizeData, WindowSizeType)> { let event = self.resize_event.get(); self.resize_event.set(None); event |