mirror of
https://github.com/servo/servo.git
synced 2025-07-15 11:23:39 +01:00
Move the TNode::initialize_data() call from recalc_style_at to its callers.
This will allow us to make it an inherent method.
This commit is contained in:
parent
e32b2c9ddf
commit
ae5cb0ceb0
3 changed files with 16 additions and 8 deletions
|
@ -65,7 +65,14 @@ impl<'lc, 'ln> DomTraversalContext<ServoLayoutNode<'ln>> for RecalcStyleAndConst
|
|||
}
|
||||
}
|
||||
|
||||
fn process_preorder(&self, node: ServoLayoutNode<'ln>) { recalc_style_at(&self.context, self.root, node); }
|
||||
fn process_preorder(&self, node: ServoLayoutNode<'ln>) {
|
||||
// FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML
|
||||
// parser.
|
||||
node.initialize_data();
|
||||
|
||||
recalc_style_at(&self.context, self.root, node);
|
||||
}
|
||||
|
||||
fn process_postorder(&self, node: ServoLayoutNode<'ln>) { construct_flows_at(&self.context, self.root, node); }
|
||||
}
|
||||
|
||||
|
|
|
@ -125,12 +125,6 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C,
|
|||
where N: TNode,
|
||||
C: StyleContext<'a, <N::ConcreteElement as Element>::Impl>,
|
||||
<N::ConcreteElement as Element>::Impl: SelectorImplExt<ComputedValues=N::ConcreteComputedValues> + 'a {
|
||||
// Initialize layout data.
|
||||
//
|
||||
// FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML
|
||||
// parser.
|
||||
node.initialize_data();
|
||||
|
||||
// Get the parent node.
|
||||
let parent_opt = match node.parent_node() {
|
||||
Some(parent) if parent.is_element() => Some(parent),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue