Fix text input issue in shadow DOM with delegatesFocus [chromium/src : main]

0 views
Skip to first unread message

Perry (Gerrit)

unread,
Sep 14, 2025, 6:02:05 AM (8 days ago) Sep 14
to Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Mason Freed

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
Gerrit-Change-Number: 6918543
Gerrit-PatchSet: 5
Gerrit-Owner: Perry <perry...@gmail.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Perry <perry...@gmail.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Sun, 14 Sep 2025 10:01:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Sep 15, 2025, 7:13:02 PM (6 days ago) Sep 15
to Perry, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Perry

Mason Freed added 3 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Mason Freed . unresolved

The code here looks good. The only thing missing, given that the last change causes a web-exposed breakage here, is to add a feature flag that enables the new behavior. This can be set to "stable" by default - it is just to be used as a "kill switch". LMK if you need pointers for how to do that.

File third_party/blink/renderer/core/html/forms/text_field_input_type.cc
Line 538, Patchset 5 (Latest): selection_length = GetElement()
.GetDocument()
.GetFrame()
->Selection()
Mason Freed . unresolved

Is it worth getting the selection once, and using it in both places?

File third_party/blink/web_tests/external/wpt/shadow-dom/focus/text-selection-with-delegatesFocus-text-control.html
Line 63, Patchset 5 (Latest): assert_equals(input.value, 'FOOFOO', "keyboard typing will update the input value.");
Mason Freed . unresolved

You confirmed that this fails before this patch?

Open in Gerrit

Related details

Attention is currently required from:
  • Perry
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
    Gerrit-Change-Number: 6918543
    Gerrit-PatchSet: 5
    Gerrit-Owner: Perry <perry...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Perry <perry...@gmail.com>
    Gerrit-Attention: Perry <perry...@gmail.com>
    Gerrit-Comment-Date: Mon, 15 Sep 2025 23:12:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Perry (Gerrit)

    unread,
    Sep 16, 2025, 8:46:44 AM (6 days ago) Sep 16
    to Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from Mason Freed

    Perry added 3 comments

    Patchset-level comments
    File-level comment, Patchset 5:
    Mason Freed . resolved

    The code here looks good. The only thing missing, given that the last change causes a web-exposed breakage here, is to add a feature flag that enables the new behavior. This can be set to "stable" by default - it is just to be used as a "kill switch". LMK if you need pointers for how to do that.

    Perry

    Done

    File third_party/blink/renderer/core/html/forms/text_field_input_type.cc
    Line 538, Patchset 5: selection_length = GetElement()
    .GetDocument()
    .GetFrame()
    ->Selection()
    Mason Freed . resolved

    Is it worth getting the selection once, and using it in both places?

    Perry

    Done

    File third_party/blink/web_tests/external/wpt/shadow-dom/focus/text-selection-with-delegatesFocus-text-control.html
    Line 63, Patchset 5: assert_equals(input.value, 'FOOFOO', "keyboard typing will update the input value.");
    Mason Freed . resolved

    You confirmed that this fails before this patch?

    Perry

    Yes. I reverted this CL and only kept the test change on patchset 6. Tryjobs run failed.
    https://chromium-review.googlesource.com/c/chromium/src/+/6918543/6?tab=checks

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
    Gerrit-Change-Number: 6918543
    Gerrit-PatchSet: 9
    Gerrit-Owner: Perry <perry...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Perry <perry...@gmail.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Sep 2025 12:46:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Sep 16, 2025, 12:19:56 PM (6 days ago) Sep 16
    to Perry, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from Perry

    Mason Freed added 4 comments

    Patchset-level comments
    File-level comment, Patchset 10 (Latest):
    Mason Freed . resolved

    LGTM, modulo one flag question

    File third_party/blink/renderer/core/editing/editor_key_bindings.cc
    Line 98, Patchset 10 (Parent): if (!CanEdit())
    return false;
    Mason Freed . unresolved

    Does this need to stay, if the feature is disabled?

    File third_party/blink/renderer/platform/runtime_enabled_features.json5
    Line 1716, Patchset 10 (Latest): // Killswitch for https://crbug.com/400317114 fix.
    Mason Freed . unresolved

    Can you add that this lands in M142, and the flag can be removed in M144?

    File third_party/blink/web_tests/external/wpt/shadow-dom/focus/text-selection-with-delegatesFocus-text-control.html
    Line 63, Patchset 5: assert_equals(input.value, 'FOOFOO', "keyboard typing will update the input value.");
    Mason Freed . resolved

    You confirmed that this fails before this patch?

    Perry

    Yes. I reverted this CL and only kept the test change on patchset 6. Tryjobs run failed.
    https://chromium-review.googlesource.com/c/chromium/src/+/6918543/6?tab=checks

    Mason Freed

    Awesome, thanks for confirming.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Perry
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 10
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Attention: Perry <perry...@gmail.com>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 16:19:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Perry <perry...@gmail.com>
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Perry (Gerrit)

      unread,
      Sep 17, 2025, 8:59:55 AM (5 days ago) Sep 17
      to Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
      Attention needed from Mason Freed

      Perry added 2 comments

      File third_party/blink/renderer/core/editing/editor_key_bindings.cc
      Line 98, Patchset 10 (Parent): if (!CanEdit())
      return false;
      Mason Freed . resolved

      Does this need to stay, if the feature is disabled?

      Perry

      If this feature is disabled, the code on line 112 is equivalent here, the only difference being that the judgment condition has been moved to after obtaining focusd element, but I don't think this affects the code logic.

      File third_party/blink/renderer/platform/runtime_enabled_features.json5
      Line 1716, Patchset 10: // Killswitch for https://crbug.com/400317114 fix.
      Mason Freed . resolved

      Can you add that this lands in M142, and the flag can be removed in M144?

      Perry

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 11
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 12:59:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Sep 17, 2025, 5:03:12 PM (4 days ago) Sep 17
      to Perry, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
      Attention needed from Perry

      Mason Freed voted and added 2 comments

      Votes added by Mason Freed

      Code-Review+1

      2 comments

      Patchset-level comments
      File-level comment, Patchset 11 (Latest):
      Mason Freed . resolved

      LGTM! Thanks! Let me know if you need me to land this.

      File third_party/blink/renderer/core/editing/editor_key_bindings.cc
      Line 98, Patchset 10 (Parent): if (!CanEdit())
      return false;
      Mason Freed . resolved

      Does this need to stay, if the feature is disabled?

      Perry

      If this feature is disabled, the code on line 112 is equivalent here, the only difference being that the judgment condition has been moved to after obtaining focusd element, but I don't think this affects the code logic.

      Mason Freed

      Yeah fair. I guess nothing can change between those. Ok, thanks.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Perry
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 11
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Attention: Perry <perry...@gmail.com>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 21:03:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      Comment-In-Reply-To: Perry <perry...@gmail.com>
      satisfied_requirement
      open
      diffy

      Blink W3C Test Autoroller (Gerrit)

      unread,
      Sep 17, 2025, 5:25:08 PM (4 days ago) Sep 17
      to Perry, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
      Attention needed from Perry

      Message from Blink W3C Test Autoroller

      Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/54910.

      When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

      WPT Export docs:
      https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Perry
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 11
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Perry <perry...@gmail.com>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 21:25:00 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      open
      diffy

      Perry (Gerrit)

      unread,
      Sep 17, 2025, 5:45:14 PM (4 days ago) Sep 17
      to Blink W3C Test Autoroller, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

      Perry 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
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 11
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 21:44:43 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Sep 17, 2025, 6:04:43 PM (4 days ago) Sep 17
      to Perry, Blink W3C Test Autoroller, Mason Freed, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Fix text input issue in shadow DOM with delegatesFocus

      If the focusable area is a text control element, but the selection is
      empty or on non-editable elements, then the focused text control cannot
      input text. This CL adds a check whether the focused element is a text
      control, based on checking whether the selection can edit.
      Bug: 400317114
      Change-Id: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Reviewed-by: Mason Freed <mas...@chromium.org>
      Commit-Queue: Perry <perry...@gmail.com>
      Cr-Commit-Position: refs/heads/main@{#1516887}
      Files:
      • M third_party/blink/renderer/core/editing/editor_key_bindings.cc
      • M third_party/blink/renderer/core/html/forms/text_field_input_type.cc
      • M third_party/blink/renderer/platform/runtime_enabled_features.json5
      • M third_party/blink/web_tests/external/wpt/shadow-dom/focus/text-selection-with-delegatesFocus-text-control.html
      Change size: S
      Delta: 4 files changed, 30 insertions(+), 9 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Mason Freed
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 12
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      open
      diffy
      satisfied_requirement

      Blink W3C Test Autoroller (Gerrit)

      unread,
      Sep 17, 2025, 6:56:18 PM (4 days ago) Sep 17
      to Chromium LUCI CQ, Perry, Mason Freed, AyeAye, chromium...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

      Message from Blink W3C Test Autoroller

      The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/54910

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: Icd7f6b348425ec968232673ae0b30b768d25b3f7
      Gerrit-Change-Number: 6918543
      Gerrit-PatchSet: 12
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 22:56:13 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages