layout: Implement basic style sharing.

No improvement on the rainbow page, but necessary for some other
optimizations we want to do.
This commit is contained in:
Patrick Walton 2014-02-07 15:15:56 -08:00
parent cf8203848a
commit 1678cc9a88
16 changed files with 502 additions and 274 deletions

View file

@ -628,7 +628,7 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
let (display, float, position) = match node.type_id() {
ElementNodeTypeId(_) => {
let style = node.style().get();
(style.Box.display, style.Box.float, style.Box.position)
(style.Box.get().display, style.Box.get().float, style.Box.get().position)
}
TextNodeTypeId => (display::inline, float::none, position::static_),
CommentNodeTypeId |
@ -730,7 +730,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
//
// If you implement other values for this property, you will almost certainly
// want to update this check.
match self.style().get().InheritedText.white_space {
match self.style().get().InheritedText.get().white_space {
white_space::normal => true,
_ => false,
}