diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-28 08:52:06 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-28 08:52:06 -0600 |
commit | 5833dea7338f1331a36ca3e792bf7656f2d67bf9 (patch) | |
tree | 153aa1224f5e217936a33d5c263d95ce292a4175 | |
parent | 55f9bd5d6f95cde282909c9128c00e9644332729 (diff) | |
parent | 0fcaa3ce0393b713e38850ee8c83c3e105015daa (diff) | |
download | servo-5833dea7338f1331a36ca3e792bf7656f2d67bf9.tar.gz servo-5833dea7338f1331a36ca3e792bf7656f2d67bf9.zip |
auto merge of #5427 : pcwalton/servo/accidentally-quadratic, r=Ms2ger
r? @jdm
-rw-r--r-- | components/script/dom/node.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 67bb5279f32..ae79327e7da 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -700,14 +700,16 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { // // TODO(cgaebel): This is a very conservative way to account for sibling // selectors. Maybe we can do something smarter in the future. - let parent = - match self.parent_node() { - None => return, - Some(parent) => parent, - }; - - for sibling in parent.root().r().children() { - sibling.set_has_dirty_siblings(true); + if !self.get_has_dirty_siblings() { + let parent = + match self.parent_node() { + None => return, + Some(parent) => parent, + }; + + for sibling in parent.root().r().children() { + sibling.set_has_dirty_siblings(true); + } } // 4. Dirty ancestors. |