SpellCheckCustomDictionary: introduce the dictionary class. [chromium/src : main]

0 views
Skip to first unread message

Kent Tamura (Gerrit)

unread,
Mar 10, 2026, 8:57:56 PM (2 days ago) Mar 10
to Ziran Sun, Kent Tamura, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Ziran Sun

Kent Tamura added 4 comments

File third_party/blink/renderer/core/dom/document.cc
Line 2336, Patchset 2 (Latest):WebTextCheckClient* Document::GetWebTextCheckClient() const {
Kent Tamura . unresolved

How about making this a free function and moving it to spell_check_custom_dictionary.cc ?

File third_party/blink/renderer/modules/spellcheckcustomdictionary/BUILD.gn
File-level comment, Patchset 2 (Latest):
Kent Tamura . unresolved

The directory name should be `modules/spell_check_custom_dictionary/`.

Line 1, Patchset 2 (Latest):# Copyright 2025 The Chromium Authors
Kent Tamura . unresolved

2026

File third_party/blink/renderer/modules/spellcheckcustomdictionary/spell_check_custom_dictionary.cc
Line 31, Patchset 2 (Latest): custom_words.push_back(phrase.Ascii());
Kent Tamura . unresolved

Why do we apply `Ascii()`?

Open in Gerrit

Related details

Attention is currently required from:
  • Ziran Sun
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: I4537c5d7b8a8320a39b76694c30642ec4a20a243
Gerrit-Change-Number: 7652434
Gerrit-PatchSet: 2
Gerrit-Owner: Ziran Sun <zs...@igalia.com>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Ziran Sun <zs...@igalia.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Ziran Sun <zs...@igalia.com>
Gerrit-Comment-Date: Wed, 11 Mar 2026 00:57:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ziran Sun (Gerrit)

unread,
Mar 11, 2026, 7:10:01 AM (yesterday) Mar 11
to Kent Tamura, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Kent Tamura

Ziran Sun added 4 comments

File third_party/blink/renderer/core/dom/document.cc
Line 2336, Patchset 2:WebTextCheckClient* Document::GetWebTextCheckClient() const {
Kent Tamura . resolved

How about making this a free function and moving it to spell_check_custom_dictionary.cc ?

Ziran Sun

Done

File third_party/blink/renderer/modules/spellcheckcustomdictionary/BUILD.gn
File-level comment, Patchset 2:
Kent Tamura . resolved

The directory name should be `modules/spell_check_custom_dictionary/`.

Ziran Sun

Done

Line 1, Patchset 2:# Copyright 2025 The Chromium Authors
Kent Tamura . resolved

2026

Ziran Sun

Done

File third_party/blink/renderer/modules/spellcheckcustomdictionary/spell_check_custom_dictionary.cc
Line 31, Patchset 2: custom_words.push_back(phrase.Ascii());
Kent Tamura . resolved

Why do we apply `Ascii()`?

Ziran Sun

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 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: I4537c5d7b8a8320a39b76694c30642ec4a20a243
    Gerrit-Change-Number: 7652434
    Gerrit-PatchSet: 3
    Gerrit-Owner: Ziran Sun <zs...@igalia.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Ziran Sun <zs...@igalia.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Kent Tamura <tk...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 11:09:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Kent Tamura <tk...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kent Tamura (Gerrit)

    unread,
    Mar 11, 2026, 7:10:58 PM (yesterday) Mar 11
    to Ziran Sun, Kent Tamura, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Ziran Sun

    Kent Tamura voted and added 3 comments

    Votes added by Kent Tamura

    Code-Review+1

    3 comments

    File third_party/blink/renderer/core/dom/document.h
    Line 63, Patchset 3 (Latest):#include "third_party/blink/public/web/web_text_check_client.h"
    Kent Tamura . unresolved

    This change looks unnecessary.

    File third_party/blink/renderer/modules/spell_check_custom_dictionary/spell_check_custom_dictionary.cc
    Line 26, Patchset 3 (Latest): auto* execution_context = ExecutionContext::From(script_state);
    if (execution_context->IsWindow()) {
    Document* document = To<LocalDOMWindow>(execution_context)->document();
    if (document->GetFrame()) {
    WebTextCheckClient* client =
    document->GetFrame()->Client()->GetTextCheckerClient();
    if (client && client->IsSpellCheckingEnabled()) {
    std::vector<std::string> custom_words;
    Kent Tamura . unresolved
    Adding a function for this part would make these functions cleaner.
    ```cpp
    namespace {
    WebTextCheckCLient* GetTextCheckClient(ScriptState* scirpt_state) {
    auto* execution_context = ExecutionContext::From(script_state);
    if (execution_context->IsWindow()) {
    Document* document = To<LocalDOMWindow>(execution_context)->document();
    if (document->GetFrame()) {
    WebTextCheckClient* client =
    document->GetFrame()->Client()->GetTextCheckerClient();
    if (client && client->IsSpellCheckingEnabled()) {
    return client;
    }
    }
    }
    return nullptr;
    }
    }
      ...
    if (auto* client = GetTextCheckClient(script_state)) {
    std::vector<std::string> cutom_words;
    ```
    File third_party/blink/renderer/modules/spell_check_custom_dictionary/window_spell_check_custom_dictionary.idl
    Line 12, Patchset 3 (Latest):] partial interface Window {
    Kent Tamura . unresolved

    Please fix this WARNING reported by Trailing Whitespace: Please remove the trailing whitespace.

    Please remove the trailing whitespace.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ziran Sun
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I4537c5d7b8a8320a39b76694c30642ec4a20a243
    Gerrit-Change-Number: 7652434
    Gerrit-PatchSet: 3
    Gerrit-Owner: Ziran Sun <zs...@igalia.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Ziran Sun <zs...@igalia.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Ziran Sun <zs...@igalia.com>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 23:10:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ziran Sun (Gerrit)

    unread,
    6:03 AM (18 hours ago) 6:03 AM
    to Kent Tamura, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Kent Tamura

    Ziran Sun added 3 comments

    File third_party/blink/renderer/core/dom/document.h
    Line 63, Patchset 3:#include "third_party/blink/public/web/web_text_check_client.h"
    Kent Tamura . resolved

    This change looks unnecessary.

    Ziran Sun

    Done

    File third_party/blink/renderer/modules/spell_check_custom_dictionary/spell_check_custom_dictionary.cc
    Line 26, Patchset 3: auto* execution_context = ExecutionContext::From(script_state);

    if (execution_context->IsWindow()) {
    Document* document = To<LocalDOMWindow>(execution_context)->document();
    if (document->GetFrame()) {
    WebTextCheckClient* client =
    document->GetFrame()->Client()->GetTextCheckerClient();
    if (client && client->IsSpellCheckingEnabled()) {
    std::vector<std::string> custom_words;
    Kent Tamura . resolved
    Adding a function for this part would make these functions cleaner.
    ```cpp
    namespace {
    WebTextCheckCLient* GetTextCheckClient(ScriptState* scirpt_state) {
    auto* execution_context = ExecutionContext::From(script_state);
    if (execution_context->IsWindow()) {
    Document* document = To<LocalDOMWindow>(execution_context)->document();
    if (document->GetFrame()) {
    WebTextCheckClient* client =
    document->GetFrame()->Client()->GetTextCheckerClient();
    if (client && client->IsSpellCheckingEnabled()) {
    return client;
    }
    }
    }
    return nullptr;
    }
    }
      ...
    if (auto* client = GetTextCheckClient(script_state)) {
    std::vector<std::string> cutom_words;
    ```
    Ziran Sun

    Done

    File third_party/blink/renderer/modules/spell_check_custom_dictionary/window_spell_check_custom_dictionary.idl
    Line 12, Patchset 3:] partial interface Window {
    Kent Tamura . resolved

    Please fix this WARNING reported by Trailing Whitespace: Please remove the trailing whitespace.

    Please remove the trailing whitespace.

    Ziran Sun

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kent Tamura
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I4537c5d7b8a8320a39b76694c30642ec4a20a243
      Gerrit-Change-Number: 7652434
      Gerrit-PatchSet: 4
      Gerrit-Owner: Ziran Sun <zs...@igalia.com>
      Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
      Gerrit-Reviewer: Ziran Sun <zs...@igalia.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Kent Tamura <tk...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 10:03:35 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kent Tamura (Gerrit)

      unread,
      6:19 PM (6 hours ago) 6:19 PM
      to Ziran Sun, Kent Tamura, Stephen Chenney, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
      Attention needed from Stephen Chenney and Ziran Sun

      Kent Tamura voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Stephen Chenney
      • Ziran Sun
      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: I4537c5d7b8a8320a39b76694c30642ec4a20a243
        Gerrit-Change-Number: 7652434
        Gerrit-PatchSet: 4
        Gerrit-Owner: Ziran Sun <zs...@igalia.com>
        Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
        Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
        Gerrit-Reviewer: Ziran Sun <zs...@igalia.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Ziran Sun <zs...@igalia.com>
        Gerrit-Comment-Date: Thu, 12 Mar 2026 22:19:23 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Stephen Chenney (Gerrit)

        unread,
        9:27 PM (2 hours ago) 9:27 PM
        to Ziran Sun, Kent Tamura, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Ziran Sun

        Stephen Chenney voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ziran Sun
        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: I4537c5d7b8a8320a39b76694c30642ec4a20a243
        Gerrit-Change-Number: 7652434
        Gerrit-PatchSet: 4
        Gerrit-Owner: Ziran Sun <zs...@igalia.com>
        Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
        Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
        Gerrit-Reviewer: Ziran Sun <zs...@igalia.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Ziran Sun <zs...@igalia.com>
        Gerrit-Comment-Date: Fri, 13 Mar 2026 01:27:15 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages