Fix blink::StringImpl::FoldCase() [chromium/src : main]

1 view
Skip to first unread message

Jihad Hanna (Gerrit)

unread,
May 28, 2026, 2:39:23 AM (8 days ago) May 28
to Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Kentaro Hara

Jihad Hanna voted and added 1 comment

Votes added by Jihad Hanna

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Jihad Hanna . resolved

Hey, I'm not sure who would be the best reviewer for this CL, so I looked at the closest OWNERS file to the modified directory.

If someone else would be a better reviewer feel free to re-assign, thank you!

Open in Gerrit

Related details

Attention is currently required from:
  • Kentaro Hara
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
Gerrit-Change-Number: 7880744
Gerrit-PatchSet: 4
Gerrit-Owner: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Comment-Date: Thu, 28 May 2026 06:39:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Jihad Hanna (Gerrit)

unread,
May 28, 2026, 5:12:01 AM (7 days ago) May 28
to Kent Tamura, Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Kent Tamura and Kentaro Hara

Jihad Hanna voted and added 1 comment

Votes added by Jihad Hanna

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Jihad Hanna . resolved

I saw that Kent had authored/reviewed many of the recent changes to `string_impl.cc`, so perhaps a better pick.

Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
  • Kentaro Hara
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
Gerrit-Change-Number: 7880744
Gerrit-PatchSet: 5
Gerrit-Owner: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Thu, 28 May 2026 09:11:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Kent Tamura (Gerrit)

unread,
May 28, 2026, 9:14:14 PM (7 days ago) May 28
to Jihad Hanna, Kent Tamura, Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Jihad Hanna

Kent Tamura added 4 comments

Patchset-level comments
Kent Tamura . unresolved

Using `FoldCase()` is an implementation detail of `<datalist>`, and might be changed in the future. Would you add a unit test of `HTMLInputElement::FilteredDataListOptions()` too please?

Commit Message
Line 9, Patchset 5 (Latest):This CL fixes an issue where typing in a field results in a different outcome than copy-pasting the typed text into the field, when it comes
Kent Tamura . unresolved

Please wrap a paragraph in 72 columns.

Line 25, Patchset 5 (Latest):This CL attempts to close the gap between 8-bit and 16-bit
Kent Tamura . unresolved

Does this CL affect CSS `text-transform:lowercase` ?

File third_party/blink/renderer/platform/wtf/text/string_impl.cc
Line 488, Patchset 5 (Latest): if (IsAllAscii(chars)) {
Kent Tamura . unresolved

We have `StringImpl::ContainsOnlyAsciiOrEmpty()`, and it can be much faster than this.

Open in Gerrit

Related details

Attention is currently required from:
  • Jihad Hanna
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
    Gerrit-Change-Number: 7880744
    Gerrit-PatchSet: 5
    Gerrit-Owner: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Jihad Hanna <jihad...@google.com>
    Gerrit-Comment-Date: Fri, 29 May 2026 01:13:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jihad Hanna (Gerrit)

    unread,
    May 29, 2026, 3:48:53 AM (6 days ago) May 29
    to android-bu...@system.gserviceaccount.com, Kent Tamura, Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Kent Tamura

    Jihad Hanna voted and added 4 comments

    Votes added by Jihad Hanna

    Commit-Queue+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 5:
    Kent Tamura . resolved

    Using `FoldCase()` is an implementation detail of `<datalist>`, and might be changed in the future. Would you add a unit test of `HTMLInputElement::FilteredDataListOptions()` too please?

    Jihad Hanna

    Done

    Commit Message
    Line 9, Patchset 5:This CL fixes an issue where typing in a field results in a different outcome than copy-pasting the typed text into the field, when it comes
    Kent Tamura . resolved

    Please wrap a paragraph in 72 columns.

    Jihad Hanna

    Done

    Line 25, Patchset 5:This CL attempts to close the gap between 8-bit and 16-bit
    Kent Tamura . unresolved

    Does this CL affect CSS `text-transform:lowercase` ?

    Jihad Hanna

    It does not seem so:

    • `text-tranform` calls `ComputedStyle::ApplyTextTransform()`
    • The lowercase branch calls `CaseMap::ToLower()`
    • I couldn't find a usage of `StringImpl::FoldCase()` from there.
    File third_party/blink/renderer/platform/wtf/text/string_impl.cc
    Line 488, Patchset 5: if (IsAllAscii(chars)) {
    Kent Tamura . resolved

    We have `StringImpl::ContainsOnlyAsciiOrEmpty()`, and it can be much faster than this.

    Jihad Hanna

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kent Tamura
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
    Gerrit-Change-Number: 7880744
    Gerrit-PatchSet: 7
    Gerrit-Owner: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Kent Tamura <tk...@chromium.org>
    Gerrit-Comment-Date: Fri, 29 May 2026 07:48:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Kent Tamura <tk...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kent Tamura (Gerrit)

    unread,
    May 31, 2026, 7:08:08 PM (4 days ago) May 31
    to Jihad Hanna, Kent Tamura, android-bu...@system.gserviceaccount.com, Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
    Attention needed from Jihad Hanna

    Kent Tamura voted and added 1 comment

    Votes added by Kent Tamura

    Code-Review+1

    1 comment

    Commit Message
    Line 25, Patchset 5:This CL attempts to close the gap between 8-bit and 16-bit
    Kent Tamura . resolved

    Does this CL affect CSS `text-transform:lowercase` ?

    Jihad Hanna

    It does not seem so:

    • `text-tranform` calls `ComputedStyle::ApplyTextTransform()`
    • The lowercase branch calls `CaseMap::ToLower()`
    • I couldn't find a usage of `StringImpl::FoldCase()` from there.
    Kent Tamura

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jihad Hanna
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
    Gerrit-Change-Number: 7880744
    Gerrit-PatchSet: 7
    Gerrit-Owner: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Jihad Hanna <jihad...@google.com>
    Gerrit-Comment-Date: Sun, 31 May 2026 23:07:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Jihad Hanna <jihad...@google.com>
    Comment-In-Reply-To: Kent Tamura <tk...@chromium.org>
    satisfied_requirement
    open
    diffy

    Jihad Hanna (Gerrit)

    unread,
    Jun 1, 2026, 4:36:57 AM (3 days ago) Jun 1
    to Kent Tamura, android-bu...@system.gserviceaccount.com, Kentaro Hara, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org

    Jihad Hanna voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
    Gerrit-Change-Number: 7880744
    Gerrit-PatchSet: 7
    Gerrit-Owner: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Comment-Date: Mon, 01 Jun 2026 08:36:12 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jun 1, 2026, 6:29:49 AM (3 days ago) Jun 1
    to Jihad Hanna, Kent Tamura, android-bu...@system.gserviceaccount.com, Kentaro Hara, chromium...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    Fix blink::StringImpl::FoldCase()


    This CL fixes an issue where typing in a field results in a different
    outcome than copy-pasting the typed text into the field, when it comes
    to datalist option filtering. (Details in the bug report).

    There's an case-inconsistency in `blink::StringImpl::FoldCase()`:

    1) 16-bit Strings
    When a string is represented as 16-bit (which can be the case during
    copy-paste), `FoldCase()` used ICU's `u_strFoldCase` (Unicode Full
    Case Folding). Under full case folding, `'ß'` (U+00DF) expands to
    `"ss"`.

    2) 8-bit Strings
    When a string is represented as 8-bit (which can be the case for
    inline text in the document or typed text), `FoldCase()` simply
    performed lowercasing. Under lowercasing, `'ß'` remains `'ß'`.


    This CL attempts to close the gap between 8-bit and 16-bit
    implementations of the function.
    Fixed: 493179860
    Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
    Commit-Queue: Jihad Hanna <jihad...@google.com>
    Reviewed-by: Kent Tamura <tk...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1639271}
    Files:
    • M third_party/blink/renderer/core/html/forms/html_input_element_test.cc
    • M third_party/blink/renderer/platform/wtf/text/string_impl.cc
    • M third_party/blink/renderer/platform/wtf/text/string_impl_test.cc
    Change size: M
    Delta: 3 files changed, 102 insertions(+), 46 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Kent Tamura
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a0b4be9b627af233ecc6c6ff4824ab6707ba2ed
    Gerrit-Change-Number: 7880744
    Gerrit-PatchSet: 8
    Gerrit-Owner: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Jihad Hanna <jihad...@google.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages