script: Fix O(n^2) dirty bit marking when setting style on all immediate

children of a node.
This commit is contained in:
Patrick Walton 2015-03-27 19:00:50 -07:00
parent 55f9bd5d6f
commit 0fcaa3ce03

View file

@ -700,6 +700,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
// //
// TODO(cgaebel): This is a very conservative way to account for sibling // TODO(cgaebel): This is a very conservative way to account for sibling
// selectors. Maybe we can do something smarter in the future. // selectors. Maybe we can do something smarter in the future.
if !self.get_has_dirty_siblings() {
let parent = let parent =
match self.parent_node() { match self.parent_node() {
None => return, None => return,
@ -709,6 +710,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
for sibling in parent.root().r().children() { for sibling in parent.root().r().children() {
sibling.set_has_dirty_siblings(true); sibling.set_has_dirty_siblings(true);
} }
}
// 4. Dirty ancestors. // 4. Dirty ancestors.
for ancestor in self.ancestors() { for ancestor in self.ancestors() {