From 31c013858ff25e14f6984d4caa4d696d6aea33f8 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sat, 21 Nov 2015 15:44:16 -0800 Subject: Make the needs_reflow method actually work correctly. The document node is always dirty because layout never clears the bit; instead, check the dirty bit of the root element. --- components/script/dom/document.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'components/script/dom/document.rs') diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 34a7846b543..1fda0761c66 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -329,9 +329,16 @@ impl Document { } pub fn needs_reflow(&self) -> bool { - self.GetDocumentElement().is_some() && - (self.upcast::().get_has_dirty_descendants() || - !self.modified_elements.borrow().is_empty()) + // FIXME: This should check the dirty bit on the document, + // not the document element. Needs some layout changes to make + // that workable. + match self.GetDocumentElement() { + Some(root) => { + root.upcast::().get_has_dirty_descendants() || + !self.modified_elements.borrow().is_empty() + } + None => false, + } } /// Returns the first `base` element in the DOM that has an `href` attribute. -- cgit v1.2.3