mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Call non-functional pseudo-elements simple pseudo-element.
This commit is contained in:
parent
01ea3cc3e3
commit
2649d0332a
4 changed files with 9 additions and 8 deletions
|
@ -24,8 +24,9 @@ pub const EAGER_PSEUDOS: [PseudoElement; EAGER_PSEUDO_COUNT] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
impl PseudoElement {
|
impl PseudoElement {
|
||||||
/// Executes a closure with each pseudo-element as an argument.
|
/// Executes a closure with each simple (not functional)
|
||||||
pub fn each<F>(mut fun: F)
|
/// pseudo-element as an argument.
|
||||||
|
pub fn each_simple<F>(mut fun: F)
|
||||||
where F: FnMut(Self),
|
where F: FnMut(Self),
|
||||||
{
|
{
|
||||||
% for pseudo in PSEUDOS:
|
% for pseudo in PSEUDOS:
|
||||||
|
|
|
@ -367,11 +367,11 @@ impl SelectorImpl {
|
||||||
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
/// Executes a function for each pseudo-element.
|
/// Executes a function for each simple (not functional) pseudo-element.
|
||||||
pub fn each_pseudo_element<F>(fun: F)
|
pub fn each_simple_pseudo_element<F>(fun: F)
|
||||||
where F: FnMut(PseudoElement),
|
where F: FnMut(PseudoElement),
|
||||||
{
|
{
|
||||||
PseudoElement::each(fun)
|
PseudoElement::each_simple(fun)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -121,7 +121,7 @@ impl SelectorImpl {
|
||||||
pub fn each_precomputed_pseudo_element<F>(mut fun: F)
|
pub fn each_precomputed_pseudo_element<F>(mut fun: F)
|
||||||
where F: FnMut(PseudoElement),
|
where F: FnMut(PseudoElement),
|
||||||
{
|
{
|
||||||
Self::each_pseudo_element(|pseudo| {
|
Self::each_simple_pseudo_element(|pseudo| {
|
||||||
if pseudo.is_precomputed() {
|
if pseudo.is_precomputed() {
|
||||||
fun(pseudo)
|
fun(pseudo)
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ use style_traits::{ParseError, StyleParseError};
|
||||||
|
|
||||||
/// A pseudo-element, both public and private.
|
/// 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)]
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
|
@ -485,7 +485,7 @@ impl SelectorImpl {
|
||||||
|
|
||||||
/// Executes `fun` for each pseudo-element.
|
/// Executes `fun` for each pseudo-element.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn each_pseudo_element<F>(mut fun: F)
|
pub fn each_simple_pseudo_element<F>(mut fun: F)
|
||||||
where F: FnMut(PseudoElement),
|
where F: FnMut(PseudoElement),
|
||||||
{
|
{
|
||||||
fun(PseudoElement::Before);
|
fun(PseudoElement::Before);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue