[<login>] Extend the LocalFrame to query <login>s elements [chromium/src : main]

0 views
Skip to first unread message

Sam Goto (Gerrit)

unread,
Feb 10, 2026, 8:19:41 PM (yesterday) Feb 10
to Dominic Farolino, Chromium IPC Reviews, Christian Biesinger, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Christian Biesinger, Dominic Farolino and Nasko Oskov

Sam Goto added 3 comments

File third_party/blink/public/mojom/frame/frame.mojom
Line 1290, Patchset 19: GetFederations() => (array<Federation> federations);
Dominic Farolino . unresolved

Technically per https://docs.google.com/document/d/1Kw4aTuISF7csHnjOpDJGc7JYIjlvOAKRprCTBVWw_E4/edit?tab=t.0#heading=h.jv90dicow9kc, these new methods need to have at least one non-test usage, but they're only really exercised in browser tests and no production path.

https://chromium-review.googlesource.com/c/chromium/src/+/7539587 probably has some "production"-paths. Would it be possible to chain the next CL on top of this one that shows how these are really going to be used? (or point out which parts of that aforementioned CL I should look at to get a feel for how these mojo methods would be used outside of tests)?

Sam Goto

I'm working on a CL that branches of this one that can give a concrete sense of how this CL is intended to be used.

I'll report back momentarily when I set that up.

Sam Goto

Done.

I rebased this and also kicked off two CLs that branches from this one here to give you a concrete sense of how I'm planning to use this.

Something I've been wondering is if LocalFrame is in fact the right architectural choice, rather than this option I described here:

https://chromium-review.googlesource.com/c/chromium/src/+/7543033/comment/c06762eb_895b0ea9/

WDYT?

Line 1293, Patchset 19: DispatchFederationEvent(mojo_base.mojom.UnguessableToken element_id, string token);
Nasko Oskov . unresolved

I find it strange to add mojo IPC methods without actual usage. +1 on dom@'s comment that we should see a bit more of the picture and linking to the future CLs in this one is needed.

Sam Goto

SGTM

Let me rebase some of these changes so that it gets easier to see how this (specifically, the Mojom browser/renderer API changes) is intended to be used.

Sam Goto

I rebased this CL onto another one to decrease its scope to only contain the LocalFrame IPC change.

As requested, the way we are planning to use this is here:

https://chromium-review.googlesource.com/c/chromium/src/+/7563244

And as a consequence here too:

https://chromium-review.googlesource.com/c/chromium/src/+/7563245

Does that help give you a sense of how we are planning to use this?

On a related note, another architectural option that I was considering was to expose the <login> elements via the GetAIPageContent method (rather than the LocalFrame mojom) which is implemented by the AIPageContentAgent via the ai_page_content.mojom.

Because we are only planning to use this for agentic browsing, I think it probably fits there better, than the more broadly available LocalFrame.

Thoughts?

Line 1293, Patchset 19: DispatchFederationEvent(mojo_base.mojom.UnguessableToken element_id, string token);
Dominic Farolino . resolved

What is this supposed to do besides just dispatching a DOM event? What Blink actions are supposed to happen, or what does this indicate?

Christian Biesinger

That's it -- the website is supposed to listen to the event to receive the token that the IDP sent to the browser.

In a regular FedCM call, there's a promise returned from navigator.credentials.get. But in this case, because it's declarative, we instead deliver the token through this event. (Per https://www.w3.org/TR/design-principles/#state-and-subclassing, the token is stored on the federation element, not on the event object)

Dominic Farolino

Ah so Blink literally isn't supposed to take any action besides storing the state, and telling the developer about it here so they can grab it off of the element?

Christian Biesinger

Yes that's correct

Dominic Farolino

What "type" should `token` be? It's a string, but can it be described by any more specific type?

Sam Goto

I have moved this change to this other CL:

https://chromium-review.googlesource.com/c/chromium/src/+/7552493

And replaced `token` for `credential` (and made it currently a `DOMString` -- I'll later want to make it a `Credential` but that requires me to make /core depend on /modules, so I'll do separately).

I'm going to resolve this here and take this discussion to this CL: https://chromium-review.googlesource.com/c/chromium/src/+/7552493

Open in Gerrit

Related details

Attention is currently required from:
  • Christian Biesinger
  • Dominic Farolino
  • Nasko Oskov
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: Ib5b22d29080de727e922392622c3b4e2a8684aae
Gerrit-Change-Number: 7543033
Gerrit-PatchSet: 27
Gerrit-Owner: Sam Goto <go...@chromium.org>
Gerrit-Reviewer: Christian Biesinger <cbies...@chromium.org>
Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
Gerrit-Reviewer: Sam Goto <go...@chromium.org>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: gwsq
Gerrit-Attention: Nasko Oskov <na...@chromium.org>
Gerrit-Attention: Dominic Farolino <d...@chromium.org>
Gerrit-Attention: Christian Biesinger <cbies...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Feb 2026 01:19:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
Comment-In-Reply-To: Christian Biesinger <cbies...@chromium.org>
Comment-In-Reply-To: Sam Goto <go...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Christian Biesinger (Gerrit)

unread,
1:49 PM (10 hours ago) 1:49 PM
to Sam Goto, Dominic Farolino, Chromium IPC Reviews, Christian Biesinger, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Dominic Farolino, Nasko Oskov and Sam Goto

Christian Biesinger added 5 comments

File third_party/blink/public/mojom/frame/frame.mojom
Line 103, Patchset 27 (Latest): // A unique ID for this element, valid for the lifetime of the document.
Christian Biesinger . unresolved

`DOMNodeId`

File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
Line 1096, Patchset 27 (Latest): for (Node& node : NodeTraversal::DescendantsOf(*frame_->GetDocument())) {
Christian Biesinger . unresolved

Can't you do `for (HTMLLoginElement& login : Traversal<HTMLLoginElement>::DescendantsOf(*frame_->GetDocument())`? Like you did in https://chromium-review.googlesource.com/c/chromium/src/+/7543033/14/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc ...

File third_party/blink/renderer/core/html/html_credential_element.h
Line 21, Patchset 27 (Latest):
Christian Biesinger . unresolved

this empty line looks wrong

File third_party/blink/renderer/core/html/html_login_element.h
Line 29, Patchset 27 (Latest): DOMNodeId dom_id() const {
Christian Biesinger . unresolved

Can't you use GetDomNodeId() which is inherited from Node?

Line 16, Patchset 27 (Latest):class CORE_EXPORT HTMLLoginElement : public HTMLElement {
Christian Biesinger . unresolved

You should probably override WillRespondToMouseClickEvents() and IsInteractiveContent() and return true if there's a <credential> child

Difficult question: Should you override IsFocusableState/ShouldHaveFocusAppearance

Open in Gerrit

Related details

Attention is currently required from:
  • Dominic Farolino
  • Nasko Oskov
  • Sam Goto
Gerrit-Attention: Sam Goto <go...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Feb 2026 18:49:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sam Goto (Gerrit)

unread,
4:02 PM (7 hours ago) 4:02 PM
to Dominic Farolino, Chromium IPC Reviews, Christian Biesinger, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Dominic Farolino and Nasko Oskov

Sam Goto added 1 comment

File third_party/blink/public/mojom/frame/frame.mojom
Line 1293, Patchset 19: DispatchFederationEvent(mojo_base.mojom.UnguessableToken element_id, string token);
Nasko Oskov . unresolved

I find it strange to add mojo IPC methods without actual usage. +1 on dom@'s comment that we should see a bit more of the picture and linking to the future CLs in this one is needed.

Sam Goto

SGTM

Let me rebase some of these changes so that it gets easier to see how this (specifically, the Mojom browser/renderer API changes) is intended to be used.

Sam Goto

I rebased this CL onto another one to decrease its scope to only contain the LocalFrame IPC change.

As requested, the way we are planning to use this is here:

https://chromium-review.googlesource.com/c/chromium/src/+/7563244

And as a consequence here too:

https://chromium-review.googlesource.com/c/chromium/src/+/7563245

Does that help give you a sense of how we are planning to use this?

On a related note, another architectural option that I was considering was to expose the <login> elements via the GetAIPageContent method (rather than the LocalFrame mojom) which is implemented by the AIPageContentAgent via the ai_page_content.mojom.

Because we are only planning to use this for agentic browsing, I think it probably fits there better, than the more broadly available LocalFrame.

Thoughts?

Sam Goto

Ah, I did indeed try exposing this in the AnnotatedPageContent proto and I think it might not be the right fit: it is expensive to compute (it is used in the zero state suggestion for AI agents) and has a lot of unrelated things. Re-using the cached one seems incorrect (e.g. maybe the DOM changes from the initial page), so I figured I should report back that I think that exposing this through the LocalFrame to dynamically fetch the <login> elements is the best alternative I found so far.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominic Farolino
  • Nasko Oskov
Gerrit-Comment-Date: Wed, 11 Feb 2026 21:02:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
Comment-In-Reply-To: Sam Goto <go...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Sam Goto (Gerrit)

unread,
8:12 PM (3 hours ago) 8:12 PM
to Dominic Farolino, Chromium IPC Reviews, Christian Biesinger, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Christian Biesinger, Dominic Farolino and Nasko Oskov

Sam Goto added 9 comments

File third_party/blink/public/mojom/frame/frame.mojom
Line 103, Patchset 27: // A unique ID for this element, valid for the lifetime of the document.
Christian Biesinger . resolved

`DOMNodeId`

Sam Goto

Done

Line 1290, Patchset 19: GetFederations() => (array<Federation> federations);
Dominic Farolino . resolved

Technically per https://docs.google.com/document/d/1Kw4aTuISF7csHnjOpDJGc7JYIjlvOAKRprCTBVWw_E4/edit?tab=t.0#heading=h.jv90dicow9kc, these new methods need to have at least one non-test usage, but they're only really exercised in browser tests and no production path.

https://chromium-review.googlesource.com/c/chromium/src/+/7539587 probably has some "production"-paths. Would it be possible to chain the next CL on top of this one that shows how these are really going to be used? (or point out which parts of that aforementioned CL I should look at to get a feel for how these mojo methods would be used outside of tests)?

Sam Goto

I'm working on a CL that branches of this one that can give a concrete sense of how this CL is intended to be used.

I'll report back momentarily when I set that up.

Sam Goto

Done.

I rebased this and also kicked off two CLs that branches from this one here to give you a concrete sense of how I'm planning to use this.

Something I've been wondering is if LocalFrame is in fact the right architectural choice, rather than this option I described here:

https://chromium-review.googlesource.com/c/chromium/src/+/7543033/comment/c06762eb_895b0ea9/

WDYT?

Sam Goto

I took a pass at trying to extend the AnnotatedPageContent proto and learned that it isn't such a great option. I'll resolve this comment because I have added two CLs that show how this specific mojom IPC is intended to be used.

Line 1293, Patchset 19: DispatchFederationEvent(mojo_base.mojom.UnguessableToken element_id, string token);
Nasko Oskov . resolved

I find it strange to add mojo IPC methods without actual usage. +1 on dom@'s comment that we should see a bit more of the picture and linking to the future CLs in this one is needed.

Sam Goto

SGTM

Let me rebase some of these changes so that it gets easier to see how this (specifically, the Mojom browser/renderer API changes) is intended to be used.

Sam Goto

I rebased this CL onto another one to decrease its scope to only contain the LocalFrame IPC change.

As requested, the way we are planning to use this is here:

https://chromium-review.googlesource.com/c/chromium/src/+/7563244

And as a consequence here too:

https://chromium-review.googlesource.com/c/chromium/src/+/7563245

Does that help give you a sense of how we are planning to use this?

On a related note, another architectural option that I was considering was to expose the <login> elements via the GetAIPageContent method (rather than the LocalFrame mojom) which is implemented by the AIPageContentAgent via the ai_page_content.mojom.

Because we are only planning to use this for agentic browsing, I think it probably fits there better, than the more broadly available LocalFrame.

Thoughts?

Sam Goto

Ah, I did indeed try exposing this in the AnnotatedPageContent proto and I think it might not be the right fit: it is expensive to compute (it is used in the zero state suggestion for AI agents) and has a lot of unrelated things. Re-using the cached one seems incorrect (e.g. maybe the DOM changes from the initial page), so I figured I should report back that I think that exposing this through the LocalFrame to dynamically fetch the <login> elements is the best alternative I found so far.

Sam Goto

Ok, I'm going to resolve this, because I think I have addressed the original concern: there are two CLs that build on top of this one that make use of the Mojom IPC that I'm introducing here.

I have also explored using different mojom IPCs (the accessiblity tree and the AnnotatedPageContent proto, specifically, and believe that LocalFrame has better trade-ofs).

File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
Line 1096, Patchset 27: for (Node& node : NodeTraversal::DescendantsOf(*frame_->GetDocument())) {
Christian Biesinger . resolved

Can't you do `for (HTMLLoginElement& login : Traversal<HTMLLoginElement>::DescendantsOf(*frame_->GetDocument())`? Like you did in https://chromium-review.googlesource.com/c/chromium/src/+/7543033/14/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc ...

Sam Goto

Done

File third_party/blink/renderer/core/html/html_credential_element.h
Line 21, Patchset 27:
Christian Biesinger . resolved

this empty line looks wrong

Sam Goto

Done

File third_party/blink/renderer/core/html/html_federation_element.h
Line 38, Patchset 19: String token_;
Dominic Farolino . resolved

Can you add some documentation describing what these members are, and how they relate to the concepts in the explainer?

Sam Goto

Done

File third_party/blink/renderer/core/html/html_federation_element.idl
Line 17, Patchset 19: attribute EventHandler ontoken;
Dominic Farolino . resolved

Per https://github.com/w3ctag/design-principles/pull/612, I think you'll want to add this to global_event_handlers.idl. I'd go with that approach in the meantime, and revert back to this one if my PR turns out to be in the wrong direction.

Sam Goto

In the process of generalizing <login> to be able to handle other <credential> types I had to use a more generic event rather than "token" (which is more federation specific) and ended up reusing "onselect" which I think is already in the global event handlers. We can choose a different event type in the future, but for now, I think this works. WDYT?

Also, addressed in this CL: https://chromium-review.googlesource.com/c/chromium/src/+/7552493

Sam Goto

Just to close on this thread, I'm using the "oncomplete" handler in this CL and added it to the global event handlers declaration: https://chromium-review.googlesource.com/c/chromium/src/+/7552493

File third_party/blink/renderer/core/html/html_login_element.h
Line 29, Patchset 27: DOMNodeId dom_id() const {
Christian Biesinger . resolved

Can't you use GetDomNodeId() which is inherited from Node?

Sam Goto

Yes, done.

Line 16, Patchset 27:class CORE_EXPORT HTMLLoginElement : public HTMLElement {
Christian Biesinger . resolved

You should probably override WillRespondToMouseClickEvents() and IsInteractiveContent() and return true if there's a <credential> child

Difficult question: Should you override IsFocusableState/ShouldHaveFocusAppearance

Sam Goto

I addressed this in this patch:

https://chromium-review.googlesource.com/c/chromium/src/+/7552493/17..18/third_party/blink/renderer/core/html/html_login_element.cc

Resolving here, let me know there if this doesn't seem right to you.

Open in Gerrit

Related details

Attention is currently required from:
  • Christian Biesinger
  • Dominic Farolino
  • Nasko Oskov
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: Ib5b22d29080de727e922392622c3b4e2a8684aae
    Gerrit-Change-Number: 7543033
    Gerrit-PatchSet: 28
    Gerrit-Owner: Sam Goto <go...@chromium.org>
    Gerrit-Reviewer: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-Reviewer: Sam Goto <go...@chromium.org>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: gwsq
    Gerrit-Attention: Nasko Oskov <na...@chromium.org>
    Gerrit-Attention: Dominic Farolino <d...@chromium.org>
    Gerrit-Attention: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Feb 2026 01:12:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Nasko Oskov <na...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages