Skip to content

Commit 92d34ad

Browse files
committed
Bug 1956771 - Update rustdoc about PseudoElementCascadeType r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D243301
1 parent db43fc4 commit 92d34ad

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

servo/components/style/selector_parser.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,30 @@ impl<'a> SelectorParser<'a> {
8383
}
8484
}
8585

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.
9087
#[derive(Clone, Debug, Eq, PartialEq)]
9188
pub enum PseudoElementCascadeType {
9289
/// Eagerly cascaded pseudo-elements are "normal" pseudo-elements (i.e.
9390
/// `::before` and `::after`). They inherit styles normally as another
9491
/// 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`).
9596
Eager,
9697
/// Lazy pseudo-elements are affected by selector matching, but they're only
9798
/// 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`.
103102
Lazy,
104103
/// Precomputed pseudo-elements skip the cascade process entirely, mostly as
105104
/// an optimisation since they are private pseudo-elements (like
106105
/// `::-servo-details-content`).
107106
///
108107
/// 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.
110110
Precomputed,
111111
}
112112

0 commit comments

Comments
 (0)