layout: Reference count ComputedValues structures like Gecko does.

This has no difference in CSS selector matching performance and results
in a 31% speedup in constraint solving on the rainbow page.
This commit is contained in:
Patrick Walton 2013-12-11 19:58:27 -08:00
parent 511d2b11d4
commit 4c8383c38b
8 changed files with 66 additions and 53 deletions

View file

@ -472,7 +472,10 @@ impl<'self> PostorderNodeMutTraversal for FlowConstructor<'self> {
fn process(&mut self, node: AbstractNode<LayoutView>) -> bool {
// Get the `display` property for this node, and determine whether this node is floated.
let (display, float) = match node.type_id() {
ElementNodeTypeId(_) => (node.style().Box.display, node.style().Box.float),
ElementNodeTypeId(_) => {
let style = node.style().get();
(style.Box.display, style.Box.float)
}
TextNodeTypeId => (display::inline, float::none),
CommentNodeTypeId |
DoctypeNodeTypeId |