@@ -83,30 +83,30 @@ impl<'a> SelectorParser<'a> {
83
83
}
84
84
}
85
85
86
- /// This enumeration determines if a pseudo-element is eagerly cascaded or not.
87
- ///
88
- /// If you're implementing a public selector for `Servo` that the end-user might
89
- /// customize, then you probably need to make it eager.
86
+ /// This enumeration determines how a pseudo-element cascades.
90
87
#[ derive( Clone , Debug , Eq , PartialEq ) ]
91
88
pub enum PseudoElementCascadeType {
92
89
/// Eagerly cascaded pseudo-elements are "normal" pseudo-elements (i.e.
93
90
/// `::before` and `::after`). They inherit styles normally as another
94
91
/// selector would do, and they're computed as part of the cascade.
92
+ ///
93
+ /// These kind of pseudo-elements require more up-front computation and
94
+ /// storage and thus should used for public pseudo-elements that can be used
95
+ /// on many element types (such as `::before` and `::after`).
95
96
Eager ,
96
97
/// Lazy pseudo-elements are affected by selector matching, but they're only
97
98
/// computed when needed, and not before. They're useful for general
98
- /// pseudo-elements that are not very common.
99
- ///
100
- /// Note that in Servo lazy pseudo-elements are restricted to a subset of
101
- /// selectors, so you can't use it for public pseudo-elements. This is not
102
- /// the case with Gecko though.
99
+ /// pseudo-elements that are not very common or that do not apply to many
100
+ /// elements. For instance in Servo this is used for `::backdrop` and
101
+ /// `::marker`.
103
102
Lazy ,
104
103
/// Precomputed pseudo-elements skip the cascade process entirely, mostly as
105
104
/// an optimisation since they are private pseudo-elements (like
106
105
/// `::-servo-details-content`).
107
106
///
108
107
/// This pseudo-elements are resolved on the fly using *only* global rules
109
- /// (rules of the form `*|*`), and applying them to the parent style.
108
+ /// (rules of the form `*|*`), and applying them to the parent style so are
109
+ /// mainly useful for user-agent stylesheets.
110
110
Precomputed ,
111
111
}
112
112
0 commit comments