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

0 views
Skip to first unread message

Jihad Hanna (Gerrit)

unread,
May 29, 2026, 3:48:53 AM (3 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 (20 hours 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,
4:36 AM (11 hours ago) 4:36 AM
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,
6:29 AM (9 hours ago) 6:29 AM
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