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:
Zach Hoffman 2023-01-03 15:30:19 +00:00 committed by Martin Robinson
parent dc225e0b2f
commit 211761ad88
5 changed files with 76 additions and 74 deletions

View file

@ -711,16 +711,10 @@ where
Component::Class(..) |
Component::AttributeInNoNamespaceExists { .. } |
Component::AttributeInNoNamespace { .. } |
Component::FirstChild |
Component::LastChild |
Component::OnlyChild |
Component::Root |
Component::Empty |
Component::Scope |
Component::Nth(..) |
Component::FirstOfType |
Component::LastOfType |
Component::OnlyOfType |
Component::Host(None) => 0,
}
}