mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
style: Represent FirstChild, FirstOfType, LastChild, LastOfType, OnlyChild, and OnlyOfType as functionless Nth variants
Like bug 1808226, this doesn't change any behavior, it just simplifies matching. I also added a WPT JavaScript test for :only-of-type, since dedicated WPT JavScript tests already exist for the other pseudo-classes this patch touches. Differential Revision: https://phabricator.services.mozilla.com/D165859
This commit is contained in:
parent
dc225e0b2f
commit
211761ad88
5 changed files with 76 additions and 74 deletions
|
@ -1918,13 +1918,7 @@ fn component_needs_revalidation(
|
|||
Component::AttributeInNoNamespace { .. } |
|
||||
Component::AttributeOther(_) |
|
||||
Component::Empty |
|
||||
Component::FirstChild |
|
||||
Component::LastChild |
|
||||
Component::OnlyChild |
|
||||
Component::Nth(..) |
|
||||
Component::FirstOfType |
|
||||
Component::LastOfType |
|
||||
Component::OnlyOfType => true,
|
||||
Component::Nth(..) => true,
|
||||
Component::NonTSPseudoClass(ref p) => p.needs_cache_revalidation(),
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue