diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-22 05:44:08 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-22 05:44:08 +0530 |
commit | a2be34365ae3b3e9a4f7da7a0fb5ed2dbf8426eb (patch) | |
tree | a64bde3397631bd5deddf9c90ac11055aa864922 /components/script/dom/document.rs | |
parent | d339d6d3d9242b66831b17cd5513b3e363ee58cc (diff) | |
parent | 31c013858ff25e14f6984d4caa4d696d6aea33f8 (diff) | |
download | servo-a2be34365ae3b3e9a4f7da7a0fb5ed2dbf8426eb.tar.gz servo-a2be34365ae3b3e9a4f7da7a0fb5ed2dbf8426eb.zip |
Auto merge of #8441 - eefriedman:needs-reflow, r=bholley
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.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8441)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 13 |
1 files changed, 10 insertions, 3 deletions
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::<Node>().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::<Node>().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. |