mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Store selectors and combinators inline in a single sequence.
This improves cache locality and reduces allocations during parsing. Note that this reverses the iteration order within a sequence of simple selectors, but that shouldn't matter.
This commit is contained in:
parent
93fa0ae1e3
commit
6d66ec5e11
10 changed files with 703 additions and 330 deletions
|
@ -6,7 +6,8 @@
|
|||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use parser::{AttrSelector, Combinator, ComplexSelector, SelectorImpl, SimpleSelector};
|
||||
use parser::{AttrSelector, Combinator, SelectorImpl};
|
||||
use parser::{SelectorIter, SimpleSelector};
|
||||
|
||||
/// A trait to visit selector properties.
|
||||
///
|
||||
|
@ -33,7 +34,7 @@ pub trait SelectorVisitor {
|
|||
/// Gets the combinator to the right of the selector, or `None` if the
|
||||
/// selector is the leftmost one.
|
||||
fn visit_complex_selector(&mut self,
|
||||
_: &ComplexSelector<Self::Impl>,
|
||||
_: SelectorIter<Self::Impl>,
|
||||
_combinator_to_right: Option<Combinator>)
|
||||
-> bool {
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue