(&self)
| 134 | |
| 135 | impl<'a> ToSpecificity for SelectorComponent<'a> { |
| 136 | fn specificity(&self) -> Specificity { |
| 137 | match self { |
| 138 | Self::Id(_) => Specificity(1, 0, 0), |
| 139 | Self::Class(_) | Self::Attribute(_) | Self::PseudoClass(_) => Specificity(0, 1, 0), |
| 140 | Self::Tag(_) | Self::PseudoElement(_) | Self::LegacyPseudoElement(_) => Specificity(0, 0, 1), |
| 141 | Self::FunctionalPseudoElement(_) => Specificity(0, 0, 1), |
| 142 | Self::Combinator(_) | Self::Namespace(_) | Self::Wildcard(_) => Specificity(0, 0, 0), |
| 143 | Self::FunctionalPseudoClass(f) => f.specificity(), |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | impl<'a> ToSpecificity for CompoundSelector<'a> { |
nothing calls this directly
no test coverage detected