mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
1ff008caa3
commit
3f0d022ba2
6 changed files with 207 additions and 97 deletions
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue