mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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
|
@ -776,6 +776,10 @@ fn matches_generic_nth_child<E, F>(element: &E,
|
|||
where E: Element,
|
||||
F: FnMut(&E, ElementSelectorFlags),
|
||||
{
|
||||
if element.ignores_nth_child_selectors() {
|
||||
return false;
|
||||
}
|
||||
|
||||
flags_setter(element, if is_from_end {
|
||||
HAS_SLOW_SELECTOR
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue