Use a more compact representation to store eager pseudo-elements.

This means that ElementStyles only need a single word to store eager pseudos.

MozReview-Commit-ID: 5bDXlDweN46
This commit is contained in:
Bobby Holley 2017-03-31 18:04:29 -07:00
parent 1ff008caa3
commit 3f0d022ba2
6 changed files with 207 additions and 97 deletions

View file

@ -114,22 +114,6 @@ pub trait ElementExt: Element<Impl=SelectorImpl> + Debug {
}
impl SelectorImpl {
/// A helper to traverse each eagerly cascaded pseudo-element, executing
/// `fun` on it.
///
/// TODO(emilio): We can optimize this for Gecko using the pseudo-element
/// macro, and we should consider doing that for Servo too.
#[inline]
pub fn each_eagerly_cascaded_pseudo_element<F>(mut fun: F)
where F: FnMut(PseudoElement),
{
Self::each_pseudo_element(|pseudo| {
if pseudo.is_eager() {
fun(pseudo)
}
})
}
/// A helper to traverse each precomputed pseudo-element, executing `fun` on
/// it.
///