tor-browser

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

commit 19d52757617791e47060abc30c92a45e7fb09c69
parent 5eed36620141f83f2f037565e6086719ee7fe374
Author: noriaki watanabe <nabeyang@gmail.com>
Date:   Wed, 31 Dec 2025 06:37:09 +0000

Bug 2008072 - Improve readability and consistency of selector specificity tests by using helper function r=emilio,firefox-style-system-reviewers,Oriol

This change replaces remaining raw bit-shift constructions of selector
specificity values in parser tests with calls to the existing
specificity(a, b, c) helper.

Expressing expected values in terms of their logical (id, class, element)
components makes the tests significantly easier to read and understand,
while also aligning their style with the rest of the selector test suite.
No functional behavior is changed.

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

Diffstat:
Mservo/components/selectors/parser.rs | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs @@ -4543,7 +4543,7 @@ pub mod tests { Component::Combinator(Combinator::Child), Component::Class(DummyAtom::from("ok")), ], - (1 << 20) + (1 << 10) + (0 << 0), + specificity(1, 1, 0), SelectorFlags::empty(), )])) ); @@ -4638,7 +4638,7 @@ pub mod tests { Component::ParentSelector, Component::Class(DummyAtom::from("bar")), ], - (1 << 20) + (1 << 10) + (0 << 0), + specificity(1, 1, 0), SelectorFlags::HAS_PARENT )])) );