mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Back out diagnostics for not being helpful enough at diagnosing.
The selectors that crash seem just corrupted data structures, none of the selectors from crash dumps make sense, and the ones for which I could trace the source found no issue.
This commit is contained in:
parent
0c057d9299
commit
e7261d51e9
1 changed files with 9 additions and 16 deletions
|
@ -105,7 +105,7 @@ impl<Impl: SelectorImpl> SelectorBuilder<Impl> {
|
|||
parsed_slotted: bool,
|
||||
) -> ThinArc<SpecificityAndFlags, Component<Impl>> {
|
||||
// Compute the specificity and flags.
|
||||
let mut spec = SpecificityAndFlags(specificity(&*self, self.simple_selectors.iter()));
|
||||
let mut spec = SpecificityAndFlags(specificity(self.simple_selectors.iter()));
|
||||
if parsed_pseudo {
|
||||
spec.0 |= HAS_PSEUDO_BIT;
|
||||
}
|
||||
|
@ -281,33 +281,26 @@ impl From<Specificity> for u32 {
|
|||
}
|
||||
}
|
||||
|
||||
fn specificity<Impl>(builder: &SelectorBuilder<Impl>, iter: slice::Iter<Component<Impl>>) -> u32
|
||||
fn specificity<Impl>(iter: slice::Iter<Component<Impl>>) -> u32
|
||||
where
|
||||
Impl: SelectorImpl,
|
||||
{
|
||||
complex_selector_specificity(builder, iter).into()
|
||||
complex_selector_specificity(iter).into()
|
||||
}
|
||||
|
||||
fn complex_selector_specificity<Impl>(
|
||||
builder: &SelectorBuilder<Impl>,
|
||||
mut iter: slice::Iter<Component<Impl>>,
|
||||
) -> Specificity
|
||||
fn complex_selector_specificity<Impl>(iter: slice::Iter<Component<Impl>>) -> Specificity
|
||||
where
|
||||
Impl: SelectorImpl,
|
||||
{
|
||||
fn simple_selector_specificity<Impl>(
|
||||
builder: &SelectorBuilder<Impl>,
|
||||
simple_selector: &Component<Impl>,
|
||||
specificity: &mut Specificity,
|
||||
) where
|
||||
Impl: SelectorImpl,
|
||||
{
|
||||
match *simple_selector {
|
||||
Component::Combinator(ref combinator) => {
|
||||
unreachable!(
|
||||
"Found combinator {:?} in simple selectors vector? {:?}",
|
||||
combinator, builder,
|
||||
);
|
||||
Component::Combinator(..) => {
|
||||
unreachable!("Found combinator in simple selectors vector?");
|
||||
},
|
||||
Component::PseudoElement(..) | Component::LocalName(..) => {
|
||||
specificity.element_selectors += 1
|
||||
|
@ -361,15 +354,15 @@ where
|
|||
},
|
||||
Component::Negation(ref negated) => {
|
||||
for ss in negated.iter() {
|
||||
simple_selector_specificity(builder, &ss, specificity);
|
||||
simple_selector_specificity(&ss, specificity);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
let mut specificity = Default::default();
|
||||
for simple_selector in &mut iter {
|
||||
simple_selector_specificity(builder, &simple_selector, &mut specificity);
|
||||
for simple_selector in iter {
|
||||
simple_selector_specificity(&simple_selector, &mut specificity);
|
||||
}
|
||||
specificity
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue