Bug 1416282 - Back out diagnostics for not being helpful enough at diagnosing.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 27 Oct 2018 13:10:57 +0200
changeset 443253 7f654e4a9a64e8431a64fa432ca768bec09c13cd
parent 443252 cd47bdbd4efa6bda0dc86c3eec25d1ea92e2518a
child 443254 e11449a47b08244567e6252a662950f9d1e44edc
push id34947
push userdluca@mozilla.com
push dateSat, 27 Oct 2018 21:53:25 +0000
treeherdermozilla-central@6d7686f1082f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1416282
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1416282 - 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.
servo/components/selectors/builder.rs
--- a/servo/components/selectors/builder.rs
+++ b/servo/components/selectors/builder.rs
@@ -100,17 +100,17 @@ impl<Impl: SelectorImpl> SelectorBuilder
     /// Consumes the builder, producing a Selector.
     #[inline(always)]
     pub fn build(
         &mut self,
         parsed_pseudo: bool,
         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;
         }
 
         if parsed_slotted {
             spec.0 |= HAS_SLOTTED_BIT;
         }
 
@@ -276,43 +276,36 @@ impl From<Specificity> for u32 {
     #[inline]
     fn from(specificity: Specificity) -> u32 {
         cmp::min(specificity.id_selectors, MAX_10BIT) << 20 |
             cmp::min(specificity.class_like_selectors, MAX_10BIT) << 10 |
             cmp::min(specificity.element_selectors, MAX_10BIT)
     }
 }
 
-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
             },
             Component::Slotted(ref selector) => {
                 specificity.element_selectors += 1;
                 // Note that due to the way ::slotted works we only compete with
                 // other ::slotted rules, so the above rule doesn't really
@@ -356,20 +349,20 @@ where
             Component::ExplicitAnyNamespace |
             Component::ExplicitNoNamespace |
             Component::DefaultNamespace(..) |
             Component::Namespace(..) => {
                 // Does not affect specificity
             },
             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
 }