tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a06fb5aec4e9d145b2b96f03c557736df3e83f14
parent 334149f5b472dd951036c624c99fb84e5de54ea4
Author: noriaki watanabe <nabeyang@gmail.com>
Date:   Mon,  8 Dec 2025 21:24:36 +0000

Bug 2004688 – Refactor Has-variant CSS serialization to use serialize_selector_list r=firefox-style-system-reviewers,dshin

Replace manual loop in the Has(ref list) arm with a call to the existing
serialize_selector_list helper. This removes duplication and ensures
consistent selector-list serialization across variants (Is/Where/Negation/Has),
without changing any functional output.

No behavioral change expected; CSS output remains identical. The refactoring
improves maintainability and reduces chances of formatting divergence in
future.

Differential Revision: https://phabricator.services.mozilla.com/D275440

Diffstat:
Mservo/components/selectors/parser.rs | 9+--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs @@ -2720,14 +2720,7 @@ impl<Impl: SelectorImpl> ToCss for Component<Impl> { }, Has(ref list) => { dest.write_str(":has(")?; - let mut first = true; - for RelativeSelector { ref selector, .. } in list.iter() { - if !first { - dest.write_str(", ")?; - } - first = false; - selector.to_css(dest)?; - } + serialize_selector_list(list.iter().map(|rel| &rel.selector), dest)?; dest.write_str(")") }, NonTSPseudoClass(ref pseudo) => pseudo.to_css(dest),