mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
style: Deindent the serialization loop.
Bug: 1471063 Reviewed-by: xidorn MozReview-Commit-ID: GPlUAx7YXVb
This commit is contained in:
parent
aca724ec79
commit
84280c5203
1 changed files with 64 additions and 63 deletions
|
@ -1007,8 +1007,10 @@ impl<Impl: SelectorImpl> ToCss for Selector<Impl> {
|
||||||
debug_assert!(!combinators_exhausted);
|
debug_assert!(!combinators_exhausted);
|
||||||
|
|
||||||
// https://drafts.csswg.org/cssom/#serializing-selectors
|
// https://drafts.csswg.org/cssom/#serializing-selectors
|
||||||
|
if compound.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if !compound.is_empty() {
|
|
||||||
// 1. If there is only one simple selector in the compound selectors
|
// 1. If there is only one simple selector in the compound selectors
|
||||||
// which is a universal selector, append the result of
|
// which is a universal selector, append the result of
|
||||||
// serializing the universal selector to s.
|
// serializing the universal selector to s.
|
||||||
|
@ -1019,11 +1021,11 @@ impl<Impl: SelectorImpl> ToCss for Selector<Impl> {
|
||||||
//
|
//
|
||||||
// If we are in this case, after we have serialized the universal
|
// If we are in this case, after we have serialized the universal
|
||||||
// selector, we skip Step 2 and continue with the algorithm.
|
// selector, we skip Step 2 and continue with the algorithm.
|
||||||
let (can_elide_namespace, first_non_namespace) = match &compound[0] {
|
let (can_elide_namespace, first_non_namespace) = match compound[0] {
|
||||||
&Component::ExplicitAnyNamespace |
|
Component::ExplicitAnyNamespace |
|
||||||
&Component::ExplicitNoNamespace |
|
Component::ExplicitNoNamespace |
|
||||||
&Component::Namespace(_, _) => (false, 1),
|
Component::Namespace(..) => (false, 1),
|
||||||
&Component::DefaultNamespace(_) => (true, 1),
|
Component::DefaultNamespace(..) => (true, 1),
|
||||||
_ => (true, 0),
|
_ => (true, 0),
|
||||||
};
|
};
|
||||||
let mut perform_step_2 = true;
|
let mut perform_step_2 = true;
|
||||||
|
@ -1074,7 +1076,6 @@ impl<Impl: SelectorImpl> ToCss for Selector<Impl> {
|
||||||
simple.to_css(dest)?;
|
simple.to_css(dest)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 3. If this is not the last part of the chain of the selector
|
// 3. If this is not the last part of the chain of the selector
|
||||||
// append a single SPACE (U+0020), followed by the combinator
|
// append a single SPACE (U+0020), followed by the combinator
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue