mirror of
https://github.com/servo/servo.git
synced 2025-06-20 23:28:59 +01:00
Move border computation into unpruned traversal. Get rid of extraneous explicit initial reflow. Fixes #935.
This commit is contained in:
parent
4f58545fd6
commit
7b239bd246
4 changed files with 28 additions and 18 deletions
|
@ -292,6 +292,8 @@ impl Page {
|
|||
self.damage(MatchSelectorsDocumentDamage);
|
||||
}
|
||||
|
||||
//FIXME: In the case where an initial reflow is required, we should always
|
||||
// ReflowForDisplay, regardless of the original goal.
|
||||
self.reflow(goal, script_chan, compositor)
|
||||
}
|
||||
|
||||
|
@ -661,11 +663,6 @@ impl ScriptTask {
|
|||
});
|
||||
page.url = Some((url.clone(), true));
|
||||
|
||||
// Tie the root into the document.
|
||||
do root.with_mut_base |base| {
|
||||
base.add_to_doc(document)
|
||||
}
|
||||
|
||||
// Send style sheets over to layout.
|
||||
//
|
||||
// FIXME: These should be streamed to layout as they're parsed. We don't need to stop here
|
||||
|
@ -698,19 +695,21 @@ impl ScriptTask {
|
|||
}
|
||||
}
|
||||
|
||||
// Tie the root into the document. This will kick off the initial reflow
|
||||
// of the page.
|
||||
// FIXME: We have no way to ensure that the first reflow performed is a
|
||||
// ReflowForDisplay operation.
|
||||
do root.with_mut_base |base| {
|
||||
base.add_to_doc(document)
|
||||
}
|
||||
// No more reflow required
|
||||
page.url = Some((url, false));
|
||||
|
||||
// Receive the JavaScript scripts.
|
||||
assert!(js_scripts.is_some());
|
||||
let js_scripts = js_scripts.take_unwrap();
|
||||
debug!("js_scripts: %?", js_scripts);
|
||||
|
||||
// Perform the initial reflow.
|
||||
page.damage = Some(DocumentDamage {
|
||||
root: root,
|
||||
level: MatchSelectorsDocumentDamage,
|
||||
});
|
||||
page.reflow(ReflowForDisplay, self.chan.clone(), self.compositor);
|
||||
page.url = Some((url, false));
|
||||
|
||||
// Define debug functions.
|
||||
let compartment = page.js_info.get_ref().js_compartment;
|
||||
let cx = page.js_info.get_ref().js_context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue