style: Run "cargo +nightly fmt" for style components in servo

The directories changed:
* servo/components/selectors/
* servo/components/style/
* servo/components/style_derive/
* servo/ports/geckolib/

Per review request, disable rustfmt in `components_to_transform_3d_matrix()` to
preserve the format for a call to `Transform3D::new`.

My mozilla-central is at
https://hg.mozilla.org/mozilla-central/rev/d1ae84015c22f2034435b47194fdced878072035

My nightly rust is 1.66.0-nightly (8b705839c 2022-09-26).

Differential Revision: https://phabricator.services.mozilla.com/D158234
This commit is contained in:
Ting-Yu Lin 2022-09-28 07:10:52 +00:00 committed by Martin Robinson
parent 1a9198a5ef
commit 3da52edffc
60 changed files with 684 additions and 489 deletions

View file

@ -320,8 +320,7 @@ where
debug_assert_eq!(next_sequence, Combinator::PseudoElement);
}
let result =
matches_complex_selector_internal(iter, element, context, Rightmost::Yes);
let result = matches_complex_selector_internal(iter, element, context, Rightmost::Yes);
matches!(result, SelectorMatchingResult::Matched)
}
@ -481,19 +480,13 @@ where
selector_iter, element
);
let matches_compound_selector = matches_compound_selector(
&mut selector_iter,
element,
context,
rightmost,
);
let matches_compound_selector =
matches_compound_selector(&mut selector_iter, element, context, rightmost);
let combinator = selector_iter.next_sequence();
if combinator.map_or(false, |c| c.is_sibling()) {
if context.needs_selector_flags() {
element.apply_selector_flags(
ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS
);
element.apply_selector_flags(ElementSelectorFlags::HAS_SLOW_SELECTOR_LATER_SIBLINGS);
}
}
@ -531,7 +524,8 @@ where
visited_handling = VisitedHandlingMode::AllLinksUnvisited;
}
element = match next_element_for_combinator(&element, combinator, &selector_iter, &context) {
element = match next_element_for_combinator(&element, combinator, &selector_iter, &context)
{
None => return candidate_not_found,
Some(next_element) => next_element,
};
@ -771,9 +765,9 @@ where
Component::Slotted(ref selector) => {
// <slots> are never flattened tree slottables.
!element.is_html_slot_element() &&
context.shared.nest(|context| {
matches_complex_selector(selector.iter(), element, context)
})
context
.shared
.nest(|context| matches_complex_selector(selector.iter(), element, context))
},
Component::PseudoElement(ref pseudo) => {
element.match_pseudo_element(pseudo, context.shared)
@ -788,7 +782,10 @@ where
},
Component::NonTSPseudoClass(ref pc) => {
if let Some((ref rightmost, ref iter)) = context.quirks_data {
if pc.is_active_or_hover() && !element.is_link() && hover_and_active_quirk_applies(iter, context.shared, *rightmost) {
if pc.is_active_or_hover() &&
!element.is_link() &&
hover_and_active_quirk_applies(iter, context.shared, *rightmost)
{
return false;
}
}
@ -797,7 +794,8 @@ where
Component::FirstChild => matches_first_child(element, context.shared),
Component::LastChild => matches_last_child(element, context.shared),
Component::OnlyChild => {
matches_first_child(element, context.shared) && matches_last_child(element, context.shared)
matches_first_child(element, context.shared) &&
matches_last_child(element, context.shared)
},
Component::Root => element.is_root(),
Component::Empty => {
@ -812,9 +810,9 @@ where
.shadow_host()
.map_or(false, |host| host == element.opaque()) &&
selector.as_ref().map_or(true, |selector| {
context.shared.nest(|context| {
matches_complex_selector(selector.iter(), element, context)
})
context
.shared
.nest(|context| matches_complex_selector(selector.iter(), element, context))
})
},
Component::Scope => match context.shared.scope_element {
@ -859,9 +857,9 @@ where
}
true
}),
Component::Has(ref list) => context.shared.nest(|context| {
has_children_matching(list, element, context)
}),
Component::Has(ref list) => context
.shared
.nest(|context| has_children_matching(list, element, context)),
Component::Combinator(_) => unsafe {
debug_unreachable!("Shouldn't try to selector-match combinators")
},