Bug 1369187: style: Assert that if we find an eager, element-backed pseudo, it's ::before or ::after. r?bholley
This holds because ::first-line and ::first-letter are not element-backed.
MozReview-Commit-ID: 67FU15pCLqW
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -352,16 +352,17 @@ trait PrivateMatchMethods: TElement {
// pseudo-elements, it doesn't seem worth the effort at a glance.
//
// For the same reason as described in match_primary, if we are
// computing default styles, we aren't guaranteed the parent
// will have eagerly computed our styles, so we just handled it
// below like a lazy pseudo.
let only_default_rules = context.shared.traversal_flags.for_default_styles();
if pseudo.is_eager() && !only_default_rules {
+ debug_assert!(pseudo.is_before_or_after());
let parent = self.parent_element().unwrap();
if !parent.may_have_animations() ||
primary_style.rules.get_animation_rules().is_empty() {
let parent_data = parent.borrow_data().unwrap();
let pseudo_style =
parent_data.styles().pseudos.get(&pseudo).unwrap();
let values = cascade_visited.values(pseudo_style);
return values.clone()