aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2015-11-21 15:44:16 -0800
committerEli Friedman <eli.friedman@gmail.com>2015-11-21 15:49:58 -0800
commit31c013858ff25e14f6984d4caa4d696d6aea33f8 (patch)
tree91bf66a562cd60c35229c917b5f50b510ca76977 /components/script/dom/window.rs
parentea690a2dff64d1cb4eb668473d62f1bbcb19f7c8 (diff)
downloadservo-31c013858ff25e14f6984d4caa4d696d6aea33f8.tar.gz
servo-31c013858ff25e14f6984d4caa4d696d6aea33f8.zip
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.
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 4cf2bbe881f..2910632a76f 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -966,7 +966,11 @@ impl Window {
return
}
- self.force_reflow(goal, query_type, reason)
+ self.force_reflow(goal, query_type, reason);
+
+ // If window_size is `None`, we don't reflow, so the document stays dirty.
+ // Otherwise, we shouldn't need a reflow immediately after a reflow.
+ assert!(!self.Document().needs_reflow() || self.window_size.get().is_none());
}
pub fn layout(&self) -> &LayoutRPC {