mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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.
This commit is contained in:
parent
37787d55d0
commit
d465abdb1c
7 changed files with 49 additions and 10 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue