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
This commit is contained in:
Bobby Holley 2016-12-10 17:09:14 -10:00
parent 92d380c399
commit 851568f59e

View file

@ -157,11 +157,11 @@ pub trait DomTraversalContext<N: TNode> {
// we need a special case for the root. // we need a special case for the root.
// //
// Expanding snapshots here may create a LATER_SIBLINGS restyle hint, which // 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 // we will drop on the floor. To prevent missed restyles, we assert against
// with siblings. // restyling a root with later siblings.
debug_assert!(root.next_sibling_element().is_none());
if let Some(mut data) = root.mutate_data() { if let Some(mut data) = root.mutate_data() {
if let Some(r) = data.as_restyle_mut() { if let Some(r) = data.as_restyle_mut() {
debug_assert!(root.next_sibling_element().is_none());
let _later_siblings = r.expand_snapshot(root, stylist); let _later_siblings = r.expand_snapshot(root, stylist);
} }
} }