[<login>] Implement click interaction for <login> element [chromium/src : main]

0 views
Skip to first unread message

Sam Goto (Gerrit)

unread,
Feb 9, 2026, 7:48:13 PM (2 days ago) Feb 9
to Dominic Farolino, AyeAye, Chromium LUCI CQ, Christian Biesinger, chromium...@chromium.org, jmedle...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Christian Biesinger and Dominic Farolino

Sam Goto added 2 comments

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Sam Goto . resolved

Dominic,

   I moved the purely DOM aspects of the other CL into this one, so that we can make <login> useful in isolation to how we are planning to use it in agentic flows (which requires the Mojom IPCs).

I addressed, I believe, the feedback you gave in the other CL.

Can you PTAL?
File third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
Line 1665, Patchset 2: 'base::Value',
Sam Goto . resolved

I'm wondering if I can avoid this change

Sam Goto

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Christian Biesinger
  • Dominic Farolino
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: I61cabb1469023800c87f105dc804f7d050d22f21
Gerrit-Change-Number: 7552493
Gerrit-PatchSet: 7
Gerrit-Owner: Sam Goto <go...@chromium.org>
Gerrit-Reviewer: Christian Biesinger <cbies...@chromium.org>
Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
Gerrit-Reviewer: Sam Goto <go...@chromium.org>
Gerrit-Attention: Dominic Farolino <d...@chromium.org>
Gerrit-Attention: Christian Biesinger <cbies...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Feb 2026 00:48:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sam Goto <go...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Christian Biesinger (Gerrit)

unread,
1:45 PM (10 hours ago) 1:45 PM
to Sam Goto, Dominic Farolino, AyeAye, Chromium LUCI CQ, Christian Biesinger, chromium...@chromium.org, jmedle...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Dominic Farolino and Sam Goto

Christian Biesinger added 8 comments

File third_party/blink/renderer/core/html/html_login_element.cc
Line 23, Patchset 9 (Latest): federated_auth_request_(document.GetExecutionContext()) {}
Christian Biesinger . unresolved

Since this does not use CredentialManagerProxy and can't really use it, it is now possible to have multiple mojo connections from a renderer to the browser. Therefore, you will have to change https://source.chromium.org/chromium/chromium/src/+/main:content/browser/webid/request_service.cc;l=226?q=RequestService&ss=chromium to support multiple receivers. See related discussion in https://chromium-review.googlesource.com/c/chromium/src/+/7115160/6/content/browser/renderer_host/render_frame_host_impl.cc#14649 -- that patchset version may help.

Line 28, Patchset 9 (Latest): DispatchEvent(*Event::Create(event_type_names::kSelect));
Christian Biesinger . unresolved

I dislike reusing the select event... this event does not get dispatched when something is selected, but rather, when we receive a token. Perhaps the `complete` event is a better fit?

Line 35, Patchset 9 (Latest): for (Node& child : NodeTraversal::ChildrenOf(*this)) {
Christian Biesinger . unresolved

`for (HTMLCredentialElelemnt& credential : Traversal<HTMLCredentialElement>::ChildrenOf(*this))`

Line 41, Patchset 9 (Latest): get_params->context = mojom::blink::RpContext::kSignIn;
Christian Biesinger . unresolved

I would not set that here... this may not be right when it is triggered by the page

Line 66, Patchset 9 (Latest): token && token->is_string()) {
Christian Biesinger . unresolved

this seems like an unnecessary restriction

File third_party/blink/renderer/core/html/html_login_element.idl
Line 10, Patchset 9 (Latest): attribute EventHandler onselect;
Christian Biesinger . unresolved

onselect already exists on global_event_handlers.idl so it is not needed here.

As discussed in https://github.com/w3ctag/design-principles/issues/611#issuecomment-3862411678, if the event was not already in global event handlers, it should be added there instead of here.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominic Farolino
  • Sam Goto
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: I61cabb1469023800c87f105dc804f7d050d22f21
    Gerrit-Change-Number: 7552493
    Gerrit-PatchSet: 9
    Gerrit-Owner: Sam Goto <go...@chromium.org>
    Gerrit-Reviewer: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
    Gerrit-Reviewer: Sam Goto <go...@chromium.org>
    Gerrit-Attention: Dominic Farolino <d...@chromium.org>
    Gerrit-Attention: Sam Goto <go...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Feb 2026 18:45:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sam Goto (Gerrit)

    unread,
    6:22 PM (5 hours ago) 6:22 PM
    to Dominic Farolino, AyeAye, Chromium LUCI CQ, Christian Biesinger, chromium...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, jmedle...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
    Attention needed from Christian Biesinger and Dominic Farolino

    Sam Goto added 8 comments

    File third_party/blink/renderer/core/html/html_login_element.cc
    Line 23, Patchset 9: federated_auth_request_(document.GetExecutionContext()) {}
    Christian Biesinger . unresolved

    Since this does not use CredentialManagerProxy and can't really use it, it is now possible to have multiple mojo connections from a renderer to the browser. Therefore, you will have to change https://source.chromium.org/chromium/chromium/src/+/main:content/browser/webid/request_service.cc;l=226?q=RequestService&ss=chromium to support multiple receivers. See related discussion in https://chromium-review.googlesource.com/c/chromium/src/+/7115160/6/content/browser/renderer_host/render_frame_host_impl.cc#14649 -- that patchset version may help.

    Line 28, Patchset 9: DispatchEvent(*Event::Create(event_type_names::kSelect));
    Christian Biesinger . resolved

    I dislike reusing the select event... this event does not get dispatched when something is selected, but rather, when we receive a token. Perhaps the `complete` event is a better fit?

    Sam Goto

    `complete` makes sense to me too. done.

    Line 32, Patchset 9: if (event.type() == event_type_names::kClick) {
    Sam Goto

    Ok, I think I got that right. Done?

    Line 35, Patchset 9: for (Node& child : NodeTraversal::ChildrenOf(*this)) {
    Christian Biesinger . resolved

    `for (HTMLCredentialElelemnt& credential : Traversal<HTMLCredentialElement>::ChildrenOf(*this))`

    Sam Goto

    Done

    Line 41, Patchset 9: get_params->context = mojom::blink::RpContext::kSignIn;
    Christian Biesinger . resolved

    I would not set that here... this may not be right when it is triggered by the page

    Sam Goto

    Done

    Line 55, Patchset 9: federated_auth_request_->RequestToken(
    Sam Goto

    Ok, I added CSP and permissions policies checks ... did I get this right?

    Line 66, Patchset 9: token && token->is_string()) {
    Christian Biesinger . resolved

    this seems like an unnecessary restriction

    Sam Goto

    Long term, I'd like to make "credential" be an Credential (rather than a DOMString, so that it can be an IdentityCredential or a PublicKeyCredential), but I ran into complications making core/ depend on //modules (which is where Credential is defined).

    In the meantime, there is no harm in making "credential" take "any", to allow non-string tokens, so I went with that in this CL, but I figured it would be useful to say that longer term, this restriction would go away (when `credential` is of type `Credential`).

    In the meantime, I store it as a member base::Value and encode/decode as JSON back and forth with the IDL.

    File third_party/blink/renderer/core/html/html_login_element.idl
    Line 10, Patchset 9: attribute EventHandler onselect;
    Christian Biesinger . resolved

    onselect already exists on global_event_handlers.idl so it is not needed here.

    As discussed in https://github.com/w3ctag/design-principles/issues/611#issuecomment-3862411678, if the event was not already in global event handlers, it should be added there instead of here.

    Sam Goto

    Done, using "oncomplete" here and added to the global event handlers.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christian Biesinger
    • Dominic Farolino
    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: I61cabb1469023800c87f105dc804f7d050d22f21
    Gerrit-Change-Number: 7552493
    Gerrit-PatchSet: 14
    Gerrit-Owner: Sam Goto <go...@chromium.org>
    Gerrit-Reviewer: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
    Gerrit-Reviewer: Sam Goto <go...@chromium.org>
    Gerrit-Attention: Dominic Farolino <d...@chromium.org>
    Gerrit-Attention: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Feb 2026 23:22:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christian Biesinger <cbies...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages