mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
script: Address review comments
This commit is contained in:
parent
9e34e82aec
commit
05bf2ffd02
3 changed files with 7 additions and 5 deletions
|
@ -372,7 +372,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
||||||
/// page content during parsing.
|
/// page content during parsing.
|
||||||
fn set_reflow_timeout(self, timeout: u64) {
|
fn set_reflow_timeout(self, timeout: u64) {
|
||||||
if let Some(existing_timeout) = self.reflow_timeout.get() {
|
if let Some(existing_timeout) = self.reflow_timeout.get() {
|
||||||
if existing_timeout > timeout {
|
if existing_timeout < timeout {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,10 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLBodyElement> {
|
||||||
s.bind_to_tree(tree_in_doc);
|
s.bind_to_tree(tree_in_doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !tree_in_doc {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let window = window_from_node(*self).root();
|
let window = window_from_node(*self).root();
|
||||||
let document = window.r().Document().root();
|
let document = window.r().Document().root();
|
||||||
document.r().set_reflow_timeout(time::precise_time_ns() + INITIAL_REFLOW_DELAY);
|
document.r().set_reflow_timeout(time::precise_time_ns() + INITIAL_REFLOW_DELAY);
|
||||||
|
|
|
@ -303,10 +303,8 @@ impl<'a> PrivateServoHTMLParserHelpers for JSRef<'a, ServoHTMLParser> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
let document = self.document.root();
|
||||||
let document = self.document.root();
|
document.r().reflow_if_reflow_timer_expired();
|
||||||
document.r().reflow_if_reflow_timer_expired();
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut pending_input = self.pending_input.borrow_mut();
|
let mut pending_input = self.pending_input.borrow_mut();
|
||||||
if !pending_input.is_empty() {
|
if !pending_input.is_empty() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue