tor-browser

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

commit 3dc42d023d79d2b8ac2d19b63a7059eca92d23ab
parent cb4d8ba2a30f8373d67f43c95713e3de34c8aa5d
Author: noriaki watanabe <nabeyang@gmail.com>
Date:   Tue, 30 Dec 2025 13:18:52 +0000

Bug 2008007 - Rename to_case_sensitivity parameter from local_name to local_name_lower to reflect precondition r=emilio,firefox-style-system-reviewers

The parameter `local_name` in the `to_case_sensitivity` method has always been
passed a value that was already normalized to ASCII lowercase at the call site.
However, the original name did not communicate this requirement, potentially
leading to confusion for future readers or incorrect usage.

This commit renames the parameter to `local_name_lower` to make the expected
precondition explicit in the API. No logic or behavior is changed by this rename.

The change improves the self-documenting nature of the API, clarifying that
the caller must supply a lowercase attribute local name when determining
case sensitivity. All call sites already satisfy this contract, so there are
no functional impacts.

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

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

diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs @@ -3212,7 +3212,11 @@ enum AttributeFlags { } impl AttributeFlags { - fn to_case_sensitivity(self, local_name: &str, have_namespace: bool) -> ParsedCaseSensitivity { + fn to_case_sensitivity( + self, + local_name_lower: &str, + have_namespace: bool, + ) -> ParsedCaseSensitivity { match self { AttributeFlags::CaseSensitive => ParsedCaseSensitivity::ExplicitCaseSensitive, AttributeFlags::AsciiCaseInsensitive => ParsedCaseSensitivity::AsciiCaseInsensitive, @@ -3222,7 +3226,7 @@ impl AttributeFlags { env!("OUT_DIR"), "/ascii_case_insensitive_html_attributes.rs" )) - .contains(local_name) + .contains(local_name_lower) { ParsedCaseSensitivity::AsciiCaseInsensitiveIfInHtmlElementInHtmlDocument } else {