aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/selector_parser.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2017-03-31 17:46:48 -0700
committerBobby Holley <bobbyholley@gmail.com>2017-04-03 12:35:14 -0700
commit1ff008caa3f96953d77bb714bd46cc39b2a5841d (patch)
tree24e583364a8b61dd32e071debb1e1dc7308b85df /components/style/selector_parser.rs
parente8ed3e0b7f5fefffa7fa8c73846bdcb6673bf36e (diff)
downloadservo-1ff008caa3f96953d77bb714bd46cc39b2a5841d.tar.gz
servo-1ff008caa3f96953d77bb714bd46cc39b2a5841d.zip
Improve some ergonomics around pseudo-elements.
I think a lot of the current indirection predates the crate merge. MozReview-Commit-ID: FM28dgZa5go
Diffstat (limited to 'components/style/selector_parser.rs')
-rw-r--r--components/style/selector_parser.rs24
1 files changed, 2 insertions, 22 deletions
diff --git a/components/style/selector_parser.rs b/components/style/selector_parser.rs
index e8ed76bd01f..936cf121b3f 100644
--- a/components/style/selector_parser.rs
+++ b/components/style/selector_parser.rs
@@ -102,26 +102,6 @@ pub enum PseudoElementCascadeType {
Precomputed,
}
-impl PseudoElementCascadeType {
- /// Simple accessor to check whether the cascade type is eager.
- #[inline]
- pub fn is_eager(&self) -> bool {
- *self == PseudoElementCascadeType::Eager
- }
-
- /// Simple accessor to check whether the cascade type is lazy.
- #[inline]
- pub fn is_lazy(&self) -> bool {
- *self == PseudoElementCascadeType::Lazy
- }
-
- /// Simple accessor to check whether the cascade type is precomputed.
- #[inline]
- pub fn is_precomputed(&self) -> bool {
- *self == PseudoElementCascadeType::Precomputed
- }
-}
-
/// An extension to rust-selector's `Element` trait.
pub trait ElementExt: Element<Impl=SelectorImpl> + Debug {
/// Whether this element is a `link`.
@@ -144,7 +124,7 @@ impl SelectorImpl {
where F: FnMut(PseudoElement),
{
Self::each_pseudo_element(|pseudo| {
- if Self::pseudo_element_cascade_type(&pseudo).is_eager() {
+ if pseudo.is_eager() {
fun(pseudo)
}
})
@@ -160,7 +140,7 @@ impl SelectorImpl {
where F: FnMut(PseudoElement),
{
Self::each_pseudo_element(|pseudo| {
- if Self::pseudo_element_cascade_type(&pseudo).is_precomputed() {
+ if pseudo.is_precomputed() {
fun(pseudo)
}
})