aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/traversal.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-12-30 11:01:23 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-12-30 11:01:23 +0530
commit3f407ea3d620e381b3adf6352cc09f9912db26b3 (patch)
treedd0a2b4015221a4293c05cd8123956b449c4262f /components/layout/traversal.rs
parent0f5c614609fd8867a9e7c27b8a398ea7d877c714 (diff)
parenta05d7f1dfd8500d299007af99861cc86fada9386 (diff)
downloadservo-3f407ea3d620e381b3adf6352cc09f9912db26b3.tar.gz
servo-3f407ea3d620e381b3adf6352cc09f9912db26b3.zip
Auto merge of #9077 - bholley:split_layout_context_etc, r=SimonSapin
Split the style-related bits out of LayoutContext and hoist more stuff into style/ <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9077) <!-- Reviewable:end -->
Diffstat (limited to 'components/layout/traversal.rs')
-rw-r--r--components/layout/traversal.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index 007b3a3626d..c5bf7d482f3 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -6,7 +6,7 @@
use construct::FlowConstructor;
use context::LayoutContext;
-use css::matching::{ApplicableDeclarations, ElementMatchMethods, MatchMethods, StyleSharingResult};
+use css::matching::{ElementMatchMethods, MatchMethods, StyleSharingResult};
use flow::{PostorderFlowTraversal, PreorderFlowTraversal};
use flow::{self, Flow};
use gfx::display_list::OpaqueNode;
@@ -15,7 +15,9 @@ use script::layout_interface::ReflowGoal;
use selectors::bloom::BloomFilter;
use std::cell::RefCell;
use std::mem;
+use style::context::StyleContext;
use style::dom::UnsafeNode;
+use style::matching::ApplicableDeclarations;
use util::opts;
use util::tid::tid;
use wrapper::{LayoutNode, ThreadSafeLayoutNode};
@@ -72,7 +74,7 @@ fn take_task_local_bloom_filter<'ln, N>(parent_node: Option<N>,
// Found cached bloom filter.
(Some(parent), Some((mut bloom_filter, old_node, old_generation))) => {
if old_node == parent.to_unsafe() &&
- old_generation == layout_context.shared.generation {
+ old_generation == layout_context.shared_context().generation {
// Hey, the cached parent is our parent! We can reuse the bloom filter.
debug!("[{}] Parent matches (={}). Reusing bloom filter.", tid(), old_node.0);
} else {
@@ -93,7 +95,7 @@ fn put_task_local_bloom_filter(bf: Box<BloomFilter>,
STYLE_BLOOM.with(move |style_bloom| {
assert!(style_bloom.borrow().is_none(),
"Putting into a never-taken task-local bloom filter");
- *style_bloom.borrow_mut() = Some((bf, *unsafe_node, layout_context.shared.generation));
+ *style_bloom.borrow_mut() = Some((bf, *unsafe_node, layout_context.shared_context().generation));
})
}
@@ -192,7 +194,7 @@ impl<'a, 'ln, ConcreteLayoutNode> PreorderDomTraversal<'ln, ConcreteLayoutNode>
let shareable_element = match node.as_element() {
Some(element) => {
// Perform the CSS selector matching.
- let stylist = unsafe { &*self.layout_context.shared.stylist.0 };
+ let stylist = unsafe { &*self.layout_context.shared_context().stylist.0 };
if element.match_element(stylist,
Some(&*bf),
&mut applicable_declarations) {
@@ -216,7 +218,7 @@ impl<'a, 'ln, ConcreteLayoutNode> PreorderDomTraversal<'ln, ConcreteLayoutNode>
parent_opt,
&applicable_declarations,
&mut self.layout_context.applicable_declarations_cache(),
- &self.layout_context.shared.new_animations_sender);
+ &self.layout_context.shared_context().new_animations_sender);
}
// Add ourselves to the LRU cache.
@@ -292,7 +294,7 @@ impl<'a, 'ln, ConcreteLayoutNode> PostorderDomTraversal<'ln, ConcreteLayoutNode>
});
assert_eq!(old_node, unsafe_layout_node);
- assert_eq!(old_generation, self.layout_context.shared.generation);
+ assert_eq!(old_generation, self.layout_context.shared_context().generation);
match node.layout_parent_node(self.root) {
None => {
@@ -401,6 +403,6 @@ impl<'a> PostorderFlowTraversal for BuildDisplayList<'a> {
#[inline]
fn should_process(&self, _: &mut Flow) -> bool {
- self.layout_context.shared.goal == ReflowGoal::ForDisplay
+ self.layout_context.shared_context().goal == ReflowGoal::ForDisplay
}
}