mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Skip matching :nth-child if element is the root of anonymous subtree
This implement the logic in Gecko's nsNthIndexCache::GetNthIndex(). MozReview-Commit-ID: 8lzK9iIbfzo
This commit is contained in:
parent
dc654c9912
commit
0e82ca1d3a
3 changed files with 21 additions and 2 deletions
|
@ -86,6 +86,12 @@ pub trait Element: Sized + Debug {
|
|||
/// if the parent node is a `DocumentFragment`.
|
||||
fn is_root(&self) -> bool;
|
||||
|
||||
/// Returns whether this element should ignore matching nth child
|
||||
/// selector.
|
||||
fn ignores_nth_child_selectors(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Return true if we want to stop lookup ancestor of the current
|
||||
/// element while matching complex selectors with descendant/child
|
||||
/// combinator.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue