layout: Perform aux initialization in parallel.

Brings aux initialization time down to essentially zero (!)
This commit is contained in:
Patrick Walton 2014-01-29 11:12:47 -08:00
parent 6c2e48f04d
commit 94ab4f5086
3 changed files with 19 additions and 4 deletions

View file

@ -8,6 +8,7 @@
use css::matching::MatchMethods;
use layout::context::LayoutContext;
use layout::extra::LayoutAuxMethods;
use layout::flow::{Flow, FlowLeafSet, PostorderFlowTraversal};
use layout::flow;
use layout::layout_task::{AssignHeightsAndStoreOverflowTraversal, BubbleWidthsTraversal};
@ -130,6 +131,12 @@ fn match_and_cascade_node(unsafe_layout_node: UnsafeLayoutNode,
// Get a real layout node.
let node: LayoutNode = cast::transmute(unsafe_layout_node);
// Initialize layout data.
//
// FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML
// parser.
node.initialize_layout_data(layout_context.layout_chan.clone());
if node.is_element() {
// Perform the CSS selector matching.
let stylist: &Stylist = cast::transmute(layout_context.stylist);