aboutsummaryrefslogtreecommitdiffstats
path: root/components/style
diff options
context:
space:
mode:
authorCameron McCormack <cam@mcc.id.au>2016-05-25 10:41:27 +1000
committerCameron McCormack <cam@mcc.id.au>2016-05-25 11:52:42 +1000
commit2c9cfae83096cffe1887019c37e84f655430d768 (patch)
tree0c27fdc62c1dce054a4be06fea033cc1ecd65045 /components/style
parenta04e30d2471a92e4214d81302f46bcaed9503b3c (diff)
downloadservo-2c9cfae83096cffe1887019c37e84f655430d768.tar.gz
servo-2c9cfae83096cffe1887019c37e84f655430d768.zip
Look past restyle root for parent node when restyling.
Currently when traversing a the tree to restyle, we look at whether a given element to restyle is the root. This seems to always be the root of the entire document, since we start our processing from the top. If the current element being restyled is the root of the restyle, then we use None as the parent node for restyling purposes. In stylo we want to invoke restyling starting from an arbitrary node in the document, not just the root of the document, so this change looks for the parent element regardless of whether we're at the root of the restyle.
Diffstat (limited to 'components/style')
-rw-r--r--components/style/traversal.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/style/traversal.rs b/components/style/traversal.rs
index c7ba825acbd..386af02e5ef 100644
--- a/components/style/traversal.rs
+++ b/components/style/traversal.rs
@@ -132,7 +132,10 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C,
node.initialize_data();
// Get the parent node.
- let parent_opt = node.layout_parent_node(root);
+ let parent_opt = match node.parent_node() {
+ Some(parent) if parent.is_element() => Some(parent),
+ _ => None,
+ };
// Get the style bloom filter.
let mut bf = take_thread_local_bloom_filter(parent_opt, root, context.shared_context());