Call non-functional pseudo-elements simple pseudo-element. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Mon, 10 Jul 2017 22:28:06 +1000
changeset 606467 a4bfda6861dd85f64f056d47e48a4d2eef82ee8a
parent 606466 f982ef87e7b7091d2b1ad2de90a4d9b790c06583
child 606468 c25e86c75cab3d31236e760468e3ddedaa47083b
child 606498 31ff0cb3adf6a831ef783eac757b1bf396913c14
push id67706
push userxquan@mozilla.com
push dateMon, 10 Jul 2017 23:54:14 +0000
reviewersheycam
milestone56.0a1
Call non-functional pseudo-elements simple pseudo-element. r?heycam MozReview-Commit-ID: AEIogq7QTsk
servo/components/style/gecko/pseudo_element_definition.mako.rs
servo/components/style/gecko/selector_parser.rs
servo/components/style/selector_parser.rs
servo/components/style/servo/selector_parser.rs
--- a/servo/components/style/gecko/pseudo_element_definition.mako.rs
+++ b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -19,18 +19,19 @@ pub const EAGER_PSEUDO_COUNT: usize = ${
 /// The list of eager pseudos.
 pub const EAGER_PSEUDOS: [PseudoElement; EAGER_PSEUDO_COUNT] = [
     % for eager_pseudo_name in EAGER_PSEUDOS:
     PseudoElement::${eager_pseudo_name},
     % endfor
 ];
 
 impl PseudoElement {
-    /// Executes a closure with each pseudo-element as an argument.
-    pub fn each<F>(mut fun: F)
+    /// Executes a closure with each simple (not functional)
+    /// pseudo-element as an argument.
+    pub fn each_simple<F>(mut fun: F)
         where F: FnMut(Self),
     {
         % for pseudo in PSEUDOS:
             fun(PseudoElement::${pseudo.capitalized()});
         % endfor
     }
 
     /// Get the pseudo-element as an atom.
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -362,21 +362,21 @@ impl SelectorImpl {
     {
         for pseudo in &EAGER_PSEUDOS {
             fun(pseudo.clone())
         }
     }
 
 
     #[inline]
-    /// Executes a function for each pseudo-element.
-    pub fn each_pseudo_element<F>(fun: F)
+    /// Executes a function for each simple (not functional) pseudo-element.
+    pub fn each_simple_pseudo_element<F>(fun: F)
         where F: FnMut(PseudoElement),
     {
-        PseudoElement::each(fun)
+        PseudoElement::each_simple(fun)
     }
 
     #[inline]
     /// Returns the relevant state flag for a given non-tree-structural
     /// pseudo-class.
     pub fn pseudo_class_state_flag(pc: &NonTSPseudoClass) -> ElementState {
         pc.state_flag()
     }
--- a/servo/components/style/selector_parser.rs
+++ b/servo/components/style/selector_parser.rs
@@ -116,15 +116,15 @@ impl SelectorImpl {
     /// it.
     ///
     /// The optimization comment in `each_eagerly_cascaded_pseudo_element` also
     /// applies here.
     #[inline]
     pub fn each_precomputed_pseudo_element<F>(mut fun: F)
         where F: FnMut(PseudoElement),
     {
-        Self::each_pseudo_element(|pseudo| {
+        Self::each_simple_pseudo_element(|pseudo| {
             if pseudo.is_precomputed() {
                 fun(pseudo)
             }
         })
     }
 }
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -23,17 +23,17 @@ use std::borrow::Cow;
 use std::fmt;
 use std::fmt::Debug;
 use std::mem;
 use std::ops::{Deref, DerefMut};
 use style_traits::{ParseError, StyleParseError};
 
 /// A pseudo-element, both public and private.
 ///
-/// NB: If you add to this list, be sure to update `each_pseudo_element` too.
+/// NB: If you add to this list, be sure to update `each_simple_pseudo_element` too.
 #[derive(Clone, Debug, PartialEq, Eq, Hash)]
 #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
 #[allow(missing_docs)]
 #[repr(usize)]
 pub enum PseudoElement {
     // Eager pseudos. Keep these first so that eager_index() works.
     After = 0,
     Before,
@@ -480,17 +480,17 @@ impl SelectorImpl {
     {
         for i in 0..EAGER_PSEUDO_COUNT {
             fun(PseudoElement::from_eager_index(i));
         }
     }
 
     /// Executes `fun` for each pseudo-element.
     #[inline]
-    pub fn each_pseudo_element<F>(mut fun: F)
+    pub fn each_simple_pseudo_element<F>(mut fun: F)
         where F: FnMut(PseudoElement),
     {
         fun(PseudoElement::Before);
         fun(PseudoElement::After);
         fun(PseudoElement::DetailsContent);
         fun(PseudoElement::DetailsSummary);
         fun(PseudoElement::Selection);
         fun(PseudoElement::ServoText);