style: Reorder some variants

This doesn't make a difference, I was hoping it would allow us to remove the
special-casey code we have here:

  https://searchfox.org/mozilla-central/rev/997a56b018662e2940c99bbaf57a6ac9d1aa5422/servo/components/selectors/matching.rs#610-632

But it doesn't. Still I think it doesn't hurt tho, shouldn't change behavior.

Depends on D145485

Differential Revision: https://phabricator.services.mozilla.com/D145486
This commit is contained in:
Emilio Cobos Álvarez 2022-05-07 04:02:25 +00:00 committed by Martin Robinson
parent 2939bf1a12
commit 2302d828a5
2 changed files with 70 additions and 69 deletions

View file

@ -1030,17 +1030,6 @@ impl Combinator {
#[cfg_attr(feature = "shmem", derive(ToShmem))]
#[cfg_attr(feature = "shmem", shmem(no_bounds))]
pub enum Component<Impl: SelectorImpl> {
Combinator(Combinator),
ExplicitAnyNamespace,
ExplicitNoNamespace,
DefaultNamespace(#[cfg_attr(feature = "shmem", shmem(field_bound))] Impl::NamespaceUrl),
Namespace(
#[cfg_attr(feature = "shmem", shmem(field_bound))] Impl::NamespacePrefix,
#[cfg_attr(feature = "shmem", shmem(field_bound))] Impl::NamespaceUrl,
),
ExplicitUniversalType,
LocalName(LocalName<Impl>),
ID(#[cfg_attr(feature = "shmem", shmem(field_bound))] Impl::Identifier),
@ -1063,6 +1052,16 @@ pub enum Component<Impl: SelectorImpl> {
// Use a Box in the less common cases with more data to keep size_of::<Component>() small.
AttributeOther(Box<AttrSelectorWithOptionalNamespace<Impl>>),
ExplicitUniversalType,
ExplicitAnyNamespace,
ExplicitNoNamespace,
DefaultNamespace(#[shmem(field_bound)] Impl::NamespaceUrl),
Namespace(
#[shmem(field_bound)] Impl::NamespacePrefix,
#[shmem(field_bound)] Impl::NamespaceUrl,
),
/// Pseudo-classes
Negation(Box<[Selector<Impl>]>),
FirstChild,
@ -1119,6 +1118,8 @@ pub enum Component<Impl: SelectorImpl> {
Is(Box<[Selector<Impl>]>),
/// An implementation-dependent pseudo-element selector.
PseudoElement(#[cfg_attr(feature = "shmem", shmem(field_bound))] Impl::PseudoElement),
Combinator(Combinator),
}
impl<Impl: SelectorImpl> Component<Impl> {