aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/window.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2013-09-16 23:41:34 -0400
committerJosh Matthews <josh@joshmatthews.net>2013-09-16 23:41:34 -0400
commitd465abdb1c2162ca9eeb72f391ea4a721332500a (patch)
treec353291226b29d8156c840062c03d62a596fa325 /src/components/script/dom/window.rs
parent37787d55d0008879fd776b012b5d7994cff99fe9 (diff)
downloadservo-d465abdb1c2162ca9eeb72f391ea4a721332500a.tar.gz
servo-d465abdb1c2162ca9eeb72f391ea4a721332500a.zip
Make all DOM manipulation wait until it's safe to do so (ie. all reflows for the page have completed). Fix a race where a newly-initiated reflow would be considered complete when receiving the completion notice for the previous reflow.
Diffstat (limited to 'src/components/script/dom/window.rs')
-rw-r--r--src/components/script/dom/window.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/script/dom/window.rs b/src/components/script/dom/window.rs
index 5c27aa83d00..ec2db1bf4ac 100644
--- a/src/components/script/dom/window.rs
+++ b/src/components/script/dom/window.rs
@@ -173,6 +173,12 @@ impl Window {
self.page.reflow_all(ReflowForDisplay, self.script_chan.clone(), self.compositor);
}
+ pub fn wait_until_safe_to_modify_dom(&self) {
+ // FIXME: This disables concurrent layout while we are modifying the DOM, since
+ // our current architecture is entirely unsafe in the presence of races.
+ self.page.join_layout();
+ }
+
#[fixed_stack_segment]
pub fn new(cx: *JSContext,
page: @mut Page,