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

@ -477,8 +477,8 @@ impl LayoutTask {
for child in node.traverse_preorder() {
if child.type_id() == ElementNodeTypeId(HTMLHtmlElementTypeId) ||
child.type_id() == ElementNodeTypeId(HTMLBodyElementTypeId) {
let element_bg_color = child.style().resolve_color(
child.style().Background.background_color
let element_bg_color = child.style().get().resolve_color(
child.style().get().Background.background_color
).to_gfx_color();
match element_bg_color {
color::rgba(0., 0., 0., 0.) => {}