style: Assert we don't try to do dumb stuff.
draft
--- a/servo/components/style/stylesheet_set.rs
+++ b/servo/components/style/stylesheet_set.rs
@@ -362,16 +362,19 @@ where
// Inserting stylesheets somewhere but at the end changes the validity
// of the cascade data, but not the invalidation data.
self.set_data_validity_at_least(OriginValidity::CascadeInvalid);
self.entries.insert(index, StylesheetSetEntry::new(sheet));
}
fn set_data_validity_at_least(&mut self, validity: OriginValidity) {
use std::cmp;
+
+ debug_assert_ne!(validity, OriginValidity::Valid);
+
self.dirty = true;
self.data_validity = cmp::max(validity, self.data_validity);
}
fn prepend(&mut self, sheet: S) {
debug_assert!(!self.contains(&sheet));
// Inserting stylesheets somewhere but at the end changes the validity
// of the cascade data, but not the invalidation data.