Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: Reflow 200 milliseconds after the `<body>` is parsed, like Gecko does. #6028

Merged
merged 2 commits into from May 26, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

script: Address review comments

  • Loading branch information
pcwalton committed May 26, 2015
commit 05bf2ffd0257626a1dca33922794e0f8db580fdd
@@ -372,7 +372,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
/// page content during parsing.
fn set_reflow_timeout(self, timeout: u64) {
if let Some(existing_timeout) = self.reflow_timeout.get() {
if existing_timeout > timeout {
if existing_timeout < timeout {
return
}
}
@@ -100,6 +100,10 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLBodyElement> {
s.bind_to_tree(tree_in_doc);
}

if !tree_in_doc {
return
}

let window = window_from_node(*self).root();
let document = window.r().Document().root();
document.r().set_reflow_timeout(time::precise_time_ns() + INITIAL_REFLOW_DELAY);
@@ -303,10 +303,8 @@ impl<'a> PrivateServoHTMLParserHelpers for JSRef<'a, ServoHTMLParser> {
break;
}

{
let document = self.document.root();
document.r().reflow_if_reflow_timer_expired();
}
let document = self.document.root();
document.r().reflow_if_reflow_timer_expired();

let mut pending_input = self.pending_input.borrow_mut();
if !pending_input.is_empty() {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.