diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2015-10-12 17:43:49 -0700 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2015-10-27 12:41:16 -0700 |
commit | 441c84d75d412d24281b67821662ee50e8b1152b (patch) | |
tree | a9d05524b441a863382aed6f0f6cbc8496a4de59 /components/script/dom | |
parent | 85596b55106775d1eef948c39708c1b02499a9a4 (diff) | |
download | servo-441c84d75d412d24281b67821662ee50e8b1152b.tar.gz servo-441c84d75d412d24281b67821662ee50e8b1152b.zip |
Pass the document instead of the documentElement to reflow.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/document.rs | 5 | ||||
-rw-r--r-- | components/script/dom/window.rs | 10 |
2 files changed, 3 insertions, 12 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index a05679086e9..b8819fc4c86 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -1175,15 +1175,14 @@ pub enum DocumentSource { NotFromParser, } +#[allow(unsafe_code)] pub trait LayoutDocumentHelpers { - #[allow(unsafe_code)] unsafe fn is_html_document_for_layout(&self) -> bool; } +#[allow(unsafe_code)] impl LayoutDocumentHelpers for LayoutJS<Document> { - #[allow(unrooted_must_root)] #[inline] - #[allow(unsafe_code)] unsafe fn is_html_document_for_layout(&self) -> bool { (*self.unsafe_get()).is_html_document } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index afae2923bf5..761ede6edf8 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -885,14 +885,6 @@ impl Window { /// /// TODO(pcwalton): Only wait for style recalc, since we have off-main-thread layout. pub fn force_reflow(&self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason) { - let document = self.Document(); - let root = document.r().GetDocumentElement(); - let root = match root.r() { - Some(root) => root, - None => return, - }; - let root = root.upcast::<Node>(); - let window_size = match self.window_size.get() { Some(window_size) => window_size, None => return, @@ -923,7 +915,7 @@ impl Window { goal: goal, page_clip_rect: self.page_clip_rect.get(), }, - document_root: root.to_trusted_node_address(), + document: self.Document().r().upcast::<Node>().to_trusted_node_address(), window_size: window_size, script_chan: self.control_chan.clone(), script_join_chan: join_chan, |