diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2015-12-17 16:21:29 -0800 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2015-12-29 11:50:03 -0800 |
commit | 47059d2d26f14f71e5b7212fa8bc01608eca11b5 (patch) | |
tree | d0693fb9987a7113323c7d6fb5502cb5621d8f15 /components/layout/traversal.rs | |
parent | 89ab368258eb827b0dcc8d6e6deecd3ed3c1de71 (diff) | |
download | servo-47059d2d26f14f71e5b7212fa8bc01608eca11b5.tar.gz servo-47059d2d26f14f71e5b7212fa8bc01608eca11b5.zip |
Separate style+layout and layout-specific wrapper functionality.
This patch does a number of things, unfortunately all at once:
* Hoists a large subset of the layout wrapper functionality into the style system.
* Merges TElementAttributes into the newly-created TElement.
* Reorganizes LayoutData by style vs layout, and removes LayoutDataShared.
* Simplifies the API for borrowing style/layout data.
There's still more to do to make the style system usable standalone, but
this is a good start.
Diffstat (limited to 'components/layout/traversal.rs')
-rw-r--r-- | components/layout/traversal.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index cf3be1b9d94..007b3a3626d 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -15,10 +15,10 @@ use script::layout_interface::ReflowGoal; use selectors::bloom::BloomFilter; use std::cell::RefCell; use std::mem; +use style::dom::UnsafeNode; use util::opts; use util::tid::tid; -use wrapper::{LayoutNode, UnsafeLayoutNode}; -use wrapper::{ThreadSafeLayoutNode}; +use wrapper::{LayoutNode, ThreadSafeLayoutNode}; /// Every time we do another layout, the old bloom filters are invalid. This is /// detected by ticking a generation number every layout. @@ -45,7 +45,7 @@ type Generation = u32; /// will no longer be the for the parent of the node we're currently on. When /// this happens, the task local bloom filter will be thrown away and rebuilt. thread_local!( - static STYLE_BLOOM: RefCell<Option<(Box<BloomFilter>, UnsafeLayoutNode, Generation)>> = RefCell::new(None)); + static STYLE_BLOOM: RefCell<Option<(Box<BloomFilter>, UnsafeNode, Generation)>> = RefCell::new(None)); /// Returns the task local bloom filter. /// @@ -88,7 +88,7 @@ fn take_task_local_bloom_filter<'ln, N>(parent_node: Option<N>, } fn put_task_local_bloom_filter(bf: Box<BloomFilter>, - unsafe_node: &UnsafeLayoutNode, + unsafe_node: &UnsafeNode, layout_context: &LayoutContext) { STYLE_BLOOM.with(move |style_bloom| { assert!(style_bloom.borrow().is_none(), @@ -153,7 +153,7 @@ impl<'a, 'ln, ConcreteLayoutNode> PreorderDomTraversal<'ln, ConcreteLayoutNode> // // FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML // parser. - node.initialize_layout_data(); + node.initialize_data(); // Get the parent node. let parent_opt = node.layout_parent_node(self.root); |