зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1471063: Deindent the serialization loop. r=xidorn
MozReview-Commit-ID: GPlUAx7YXVb
This commit is contained in:
Родитель
5bb17d3cf9
Коммит
fac77fa281
|
@ -1007,8 +1007,10 @@ impl<Impl: SelectorImpl> ToCss for Selector<Impl> {
|
|||
debug_assert!(!combinators_exhausted);
|
||||
|
||||
// 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
|
||||
// which is a universal selector, append the result of
|
||||
// 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
|
||||
// selector, we skip Step 2 and continue with the algorithm.
|
||||
let (can_elide_namespace, first_non_namespace) = match &compound[0] {
|
||||
&Component::ExplicitAnyNamespace |
|
||||
&Component::ExplicitNoNamespace |
|
||||
&Component::Namespace(_, _) => (false, 1),
|
||||
&Component::DefaultNamespace(_) => (true, 1),
|
||||
let (can_elide_namespace, first_non_namespace) = match compound[0] {
|
||||
Component::ExplicitAnyNamespace |
|
||||
Component::ExplicitNoNamespace |
|
||||
Component::Namespace(..) => (false, 1),
|
||||
Component::DefaultNamespace(..) => (true, 1),
|
||||
_ => (true, 0),
|
||||
};
|
||||
let mut perform_step_2 = true;
|
||||
|
@ -1074,7 +1076,6 @@ impl<Impl: SelectorImpl> ToCss for Selector<Impl> {
|
|||
simple.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. If this is not the last part of the chain of the selector
|
||||
// append a single SPACE (U+0020), followed by the combinator
|
||||
|
|
Загрузка…
Ссылка в новой задаче