mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
format components/selectors
This commit is contained in:
parent
9667298d29
commit
a28c642fc7
4 changed files with 342 additions and 401 deletions
|
@ -161,7 +161,8 @@ struct SelectorBuilderIter<'a, Impl: SelectorImpl> {
|
|||
|
||||
impl<'a, Impl: SelectorImpl> ExactSizeIterator for SelectorBuilderIter<'a, Impl> {
|
||||
fn len(&self) -> usize {
|
||||
self.current_simple_selectors.len() + self.rest_of_simple_selectors.len() +
|
||||
self.current_simple_selectors.len() +
|
||||
self.rest_of_simple_selectors.len() +
|
||||
self.combinators.len()
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +229,6 @@ struct Specificity {
|
|||
element_selectors: u32,
|
||||
}
|
||||
|
||||
|
||||
impl AddAssign for Specificity {
|
||||
#[inline]
|
||||
fn add_assign(&mut self, rhs: Self) {
|
||||
|
@ -306,10 +306,9 @@ where
|
|||
Component::Combinator(ref combinator) => {
|
||||
unreachable!(
|
||||
"Found combinator {:?} in simple selectors vector? {:?}",
|
||||
combinator,
|
||||
builder,
|
||||
combinator, builder,
|
||||
);
|
||||
}
|
||||
},
|
||||
Component::PseudoElement(..) | Component::LocalName(..) => {
|
||||
specificity.element_selectors += 1
|
||||
},
|
||||
|
@ -329,7 +328,7 @@ where
|
|||
// See: https://github.com/w3c/csswg-drafts/issues/1915
|
||||
*specificity += Specificity::from(selector.specificity());
|
||||
}
|
||||
}
|
||||
},
|
||||
Component::ID(..) => {
|
||||
specificity.id_selectors += 1;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue