[WebMCP] Add navigator.modelContext.ontoolactivated [chromium/src : main]

0 views
Skip to first unread message

Fr (Gerrit)

unread,
Mar 6, 2026, 5:14:47 AM (7 days ago) Mar 6
to Dominic Farolino, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Dominic Farolino

Fr added 1 comment

Open in Gerrit

Related details

Attention is currently required from:
  • 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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
Gerrit-Change-Number: 7642055
Gerrit-PatchSet: 4
Gerrit-Owner: Fr <beaufort...@gmail.com>
Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
Gerrit-Reviewer: Fr <beaufort...@gmail.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Dominic Farolino <d...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 10:14:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dominic Farolino (Gerrit)

unread,
Mar 10, 2026, 8:51:50 AM (2 days ago) Mar 10
to Fr, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Fr

Dominic Farolino added 2 comments

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Dominic Farolino . resolved

Yep, it looks great. Do we have any way to trigger tools in web test that let us test this event there? Or can we at least add other tests?

File third_party/blink/renderer/core/events/tool_activated_event.h
Line 49, Patchset 7 (Latest): Member<Element> element_;
Dominic Farolino . unresolved

Can these members be `const`?

Open in Gerrit

Related details

Attention is currently required from:
  • Fr
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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
    Gerrit-Change-Number: 7642055
    Gerrit-PatchSet: 7
    Gerrit-Owner: Fr <beaufort...@gmail.com>
    Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
    Gerrit-Reviewer: Fr <beaufort...@gmail.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Fr <beaufort...@gmail.com>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 12:51:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fr (Gerrit)

    unread,
    Mar 10, 2026, 10:54:22 AM (2 days ago) Mar 10
    to Dominic Farolino, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Dominic Farolino

    Fr added 2 comments

    Patchset-level comments
    Dominic Farolino . resolved

    Yep, it looks great. Do we have any way to trigger tools in web test that let us test this event there? Or can we at least add other tests?

    Fr

    I've just added web tests.

    File third_party/blink/renderer/core/events/tool_activated_event.h
    Line 49, Patchset 7: Member<Element> element_;
    Dominic Farolino . resolved

    Can these members be `const`?

    Fr

    Nope. See error messages when I add `const`:

    ```
    ../../third_party/blink/renderer/core/events/tool_activated_event.cc:24:16: error: no viable overloaded '='
    24 | tool_name_ = initializer->toolName();
    | ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
    ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:172:11: note: candidate function not viable: 'this' argument has type 'const String', but method is not marked const
    172 | String& operator=(const String&) = default;
    | ^
    ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:175:11: note: candidate function not viable: 'this' argument has type 'const String', but method is not marked const
    175 | String& operator=(String&&) = default;
    | ^
    ../../third_party/blink/renderer/core/events/tool_activated_event.cc:27:14: error: no viable overloaded '='
    27 | element_ = initializer->element();
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • 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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
      Gerrit-Change-Number: 7642055
      Gerrit-PatchSet: 8
      Gerrit-Owner: Fr <beaufort...@gmail.com>
      Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
      Gerrit-Reviewer: Fr <beaufort...@gmail.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Dominic Farolino <d...@chromium.org>
      Gerrit-Comment-Date: Tue, 10 Mar 2026 14:54:10 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dominic Farolino (Gerrit)

      unread,
      Mar 10, 2026, 11:20:01 AM (2 days ago) Mar 10
      to Fr, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Fr

      Dominic Farolino added 3 comments

      Patchset-level comments
      File-level comment, Patchset 8 (Latest):
      Dominic Farolino . resolved

      Can you make the internal WPT test an external, tentative, WPT? That should be possible since I don't think we're relying on any internal APIs (of course modelContextTesting will be known by another name soon...)

      File third_party/blink/renderer/core/events/tool_activated_event.h
      Line 49, Patchset 7: Member<Element> element_;
      Dominic Farolino . resolved

      Can these members be `const`?

      Fr

      Nope. See error messages when I add `const`:

      ```
      ../../third_party/blink/renderer/core/events/tool_activated_event.cc:24:16: error: no viable overloaded '='
      24 | tool_name_ = initializer->toolName();
      | ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
      ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:172:11: note: candidate function not viable: 'this' argument has type 'const String', but method is not marked const
      172 | String& operator=(const String&) = default;
      | ^
      ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:175:11: note: candidate function not viable: 'this' argument has type 'const String', but method is not marked const
      175 | String& operator=(String&&) = default;
      | ^
      ../../third_party/blink/renderer/core/events/tool_activated_event.cc:27:14: error: no viable overloaded '='
      27 | element_ = initializer->element();
      ```
      Dominic Farolino

      Well you'd have to modify the first constructor's initialization of the two members, to happen in the initialization list as opposed to the ctor body. Maybe it's not worth it. I just like const :)

      File third_party/blink/web_tests/fast/webmcp/toolactivated.html
      Line 5, Patchset 8 (Latest): <input type="submit" />
      Dominic Farolino . unresolved

      Void elements don't need a trailing close slash, and it's generally recommended to omit it to keep the right mental model of these elements.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fr
      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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
        Gerrit-Change-Number: 7642055
        Gerrit-PatchSet: 8
        Gerrit-Owner: Fr <beaufort...@gmail.com>
        Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
        Gerrit-Reviewer: Fr <beaufort...@gmail.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Fr <beaufort...@gmail.com>
        Gerrit-Comment-Date: Tue, 10 Mar 2026 15:19:57 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Fr <beaufort...@gmail.com>
        Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Fr (Gerrit)

        unread,
        Mar 10, 2026, 11:58:30 AM (2 days ago) Mar 10
        to AyeAye, Dominic Farolino, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, blink-revie...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
        Attention needed from Dominic Farolino

        Fr added 3 comments

        Patchset-level comments
        Dominic Farolino . resolved

        Can you make the internal WPT test an external, tentative, WPT? That should be possible since I don't think we're relying on any internal APIs (of course modelContextTesting will be known by another name soon...)

        Fr

        How about we do that for all web platform tests that are in third_party/blink/web_tests/fast/webmcp/ except use

        File third_party/blink/renderer/core/events/tool_activated_event.h
        Line 49, Patchset 7: Member<Element> element_;
        Dominic Farolino . resolved

        Can these members be `const`?

        Fr

        Nope. See error messages when I add `const`:

        ```
        ../../third_party/blink/renderer/core/events/tool_activated_event.cc:24:16: error: no viable overloaded '='
        24 | tool_name_ = initializer->toolName();
        | ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
        ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:172:11: note: candidate function not viable: 'this' argument has type 'const String', but method is not marked const
        172 | String& operator=(const String&) = default;
        | ^
        ../../third_party/blink/renderer/platform/wtf/text/wtf_string.h:175:11: note: candidate function not viable: 'this' argument has type 'const String', but method is not marked const
        175 | String& operator=(String&&) = default;
        | ^
        ../../third_party/blink/renderer/core/events/tool_activated_event.cc:27:14: error: no viable overloaded '='
        27 | element_ = initializer->element();
        ```
        Dominic Farolino

        Well you'd have to modify the first constructor's initialization of the two members, to happen in the initialization list as opposed to the ctor body. Maybe it's not worth it. I just like const :)

        Fr

        Done

        File third_party/blink/web_tests/fast/webmcp/toolactivated.html
        Line 5, Patchset 8: <input type="submit" />
        Dominic Farolino . resolved

        Void elements don't need a trailing close slash, and it's generally recommended to omit it to keep the right mental model of these elements.

        Fr

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • 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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
          Gerrit-Change-Number: 7642055
          Gerrit-PatchSet: 9
          Gerrit-Owner: Fr <beaufort...@gmail.com>
          Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
          Gerrit-Reviewer: Fr <beaufort...@gmail.com>
          Gerrit-CC: Kentaro Hara <har...@chromium.org>
          Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
          Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
          Gerrit-Attention: Dominic Farolino <d...@chromium.org>
          Gerrit-Comment-Date: Tue, 10 Mar 2026 15:58:13 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Dominic Farolino (Gerrit)

          unread,
          11:18 AM (9 hours ago) 11:18 AM
          to Fr, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, blink-revie...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
          Attention needed from Fr

          Dominic Farolino added 2 comments

          Patchset-level comments
          File-level comment, Patchset 9 (Latest):
          Dominic Farolino . resolved
          This LGTM. Is there any follow-up we should mention in the CL description about:
          - Removing `WebMCPEvent` which seems obsoleted by this CL
          - Doing the same with the cancelled event
          File third_party/blink/renderer/core/script_tools/model_context.cc
          Line 326, Patchset 9 (Latest): }
          Dominic Farolino . unresolved

          I suppose we'll remove this in a separate CL, after some evangelization to folks in the dev trial?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Fr
          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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
            Gerrit-Change-Number: 7642055
            Gerrit-PatchSet: 9
            Gerrit-Owner: Fr <beaufort...@gmail.com>
            Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
            Gerrit-Reviewer: Fr <beaufort...@gmail.com>
            Gerrit-CC: Kentaro Hara <har...@chromium.org>
            Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
            Gerrit-Attention: Fr <beaufort...@gmail.com>
            Gerrit-Comment-Date: Thu, 12 Mar 2026 15:18:11 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Fr (Gerrit)

            unread,
            11:22 AM (9 hours ago) 11:22 AM
            to AyeAye, Dominic Farolino, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, blink-revie...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
            Attention needed from Dominic Farolino

            Fr added 2 comments

            Patchset-level comments
            Dominic Farolino . unresolved
            This LGTM. Is there any follow-up we should mention in the CL description about:
            - Removing `WebMCPEvent` which seems obsoleted by this CL
            - Doing the same with the cancelled event
            Fr

            https://chromium-review.googlesource.com/c/chromium/src/+/7653555/ is next indeed. Not sure it's worth mentioning it in the CL description as we'll probably land both.

            We can add WebMCPEvent expected removal though.

            File third_party/blink/renderer/core/script_tools/model_context.cc
            Dominic Farolino . unresolved

            I suppose we'll remove this in a separate CL, after some evangelization to folks in the dev trial?

            Fr

            Exactly. I wanted to have both toolactivated and toolcancel working in Canary, warn folks, and only then, start to remove WebMCP events.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • 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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
            Gerrit-Change-Number: 7642055
            Gerrit-PatchSet: 9
            Gerrit-Owner: Fr <beaufort...@gmail.com>
            Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
            Gerrit-Reviewer: Fr <beaufort...@gmail.com>
            Gerrit-CC: Kentaro Hara <har...@chromium.org>
            Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
            Gerrit-Attention: Dominic Farolino <d...@chromium.org>
            Gerrit-Comment-Date: Thu, 12 Mar 2026 15:22:04 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Dominic Farolino (Gerrit)

            unread,
            11:24 AM (9 hours ago) 11:24 AM
            to Fr, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Khushal Sagar, Raphael Kubo da Costa, blink-revie...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, mfoltz+wa...@chromium.org
            Attention needed from Fr

            Dominic Farolino voted and added 2 comments

            Votes added by Dominic Farolino

            Code-Review+1

            2 comments

            Patchset-level comments
            Dominic Farolino . unresolved
            This LGTM. Is there any follow-up we should mention in the CL description about:
            - Removing `WebMCPEvent` which seems obsoleted by this CL
            - Doing the same with the cancelled event
            Fr

            https://chromium-review.googlesource.com/c/chromium/src/+/7653555/ is next indeed. Not sure it's worth mentioning it in the CL description as we'll probably land both.

            We can add WebMCPEvent expected removal though.

            Dominic Farolino

            I think it could be worth a quick mention just for historical completeness!

            File third_party/blink/renderer/core/script_tools/model_context.cc
            Dominic Farolino . resolved

            I suppose we'll remove this in a separate CL, after some evangelization to folks in the dev trial?

            Fr

            Exactly. I wanted to have both toolactivated and toolcancel working in Canary, warn folks, and only then, start to remove WebMCP events.

            Dominic Farolino

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Fr
            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: Iffce26011963e6e501a7843e72a6ea4f6bea0f3a
            Gerrit-Change-Number: 7642055
            Gerrit-PatchSet: 9
            Gerrit-Owner: Fr <beaufort...@gmail.com>
            Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
            Gerrit-Reviewer: Fr <beaufort...@gmail.com>
            Gerrit-CC: Kentaro Hara <har...@chromium.org>
            Gerrit-CC: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
            Gerrit-Attention: Fr <beaufort...@gmail.com>
            Gerrit-Comment-Date: Thu, 12 Mar 2026 15:24:07 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages