From 851568f59e458d5b24c9a75f5675c366e764d065 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Sat, 10 Dec 2016 17:09:14 -1000 Subject: [PATCH] Bug 1322945 - Only assert against _restyling_ roots with later siblings. r=heycam The problem is with restyles, so we should leave the door open on initial styling if that ends up making sense. MozReview-Commit-ID: 5GOFBEUZhDe --- components/style/traversal.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 5e0712f2114..1fa35ed3605 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -157,11 +157,11 @@ pub trait DomTraversalContext { // we need a special case for the root. // // Expanding snapshots here may create a LATER_SIBLINGS restyle hint, which - // we will drop on the floor. This is fine, because we don't traverse roots - // with siblings. - debug_assert!(root.next_sibling_element().is_none()); + // we will drop on the floor. To prevent missed restyles, we assert against + // restyling a root with later siblings. if let Some(mut data) = root.mutate_data() { if let Some(r) = data.as_restyle_mut() { + debug_assert!(root.next_sibling_element().is_none()); let _later_siblings = r.expand_snapshot(root, stylist); } }