commit | 255545e69e987c1eb10501801890f68ed152bbee | [log] [tgz] |
---|---|---|
author | Delan Azabani <dazabani@igalia.com> | Tue Jan 28 10:06:40 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Jan 28 10:06:40 2020 |
tree | 057a65e85671aab92fc8099271f94c7f5312120c | |
parent | ded845f4c9a2b6d1dca5507d8de05992c6067faf [diff] |
Migrate safest subset of DeprecatedEqual calls to EqualASCII DeprecatedEqualIgnoringCase (“DeprecatedEqual”) returns true iff the two given strings are equal under non-Turkic case folding (full iff both strings are 16-bit, simple otherwise). DeprecatedEqual was deprecated in favour of EqualIgnoringASCIICase or EqualIgnoringUnicodeCase [1]. The former is usually the appropriate choice for web platform features that need to check for equality with a constant keyword. This CL optimistically migrates the safest subset of DeprecatedEqual calls to EqualIgnoringASCIICase: those where one of the arguments is an 8-bit literal that contains only ASCII but neither “s” nor “k”. {s,k,S,K} are the only ASCII characters whose equivalence classes would change when switching from simple non-Turkic case folding to ASCII insensitivity [2], so we shouldn’t need web platform tests. This commit in particular was generated by the following replacement under Sublime Text 2 (PCRE): Find: (?x-i) (?<escape>\\['"?\\abfnrtv]){0} (?<literal>"(?:(?=[ -~])[^"skSK]|(?&escape))*"){0} (?<other>(?:[^(),]|(\((?:[^()]+|(?-1))\)))*+){0} DeprecatedEqualIgnoringCase (\s*\(\s*(?: (?&literal)\s*,\s*(?&other) |(?&other)\s*,\s*(?&literal) )\s*\)) Where: *.cc,-/path/to/src/out/*,-/path/to/src/.ccls-cache/* Replace: EqualIgnoringASCIICase$5 [1] https://codereview.chromium.org/2811793004/patch/1/10109 [2] https://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt Bug: 627682 Change-Id: I6ee08a9378c782a91ce616362a91a7e0c64c989b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015875 Commit-Queue: Delan Azabani <dazabani@igalia.com> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Reviewed-by: Frédéric Wang <fwang@igalia.com> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#735807}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .