Skip to content

Track toolautosubmit attribute changes for declarative tools#60416

Merged
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-cl-7827761
Jun 5, 2026
Merged

Track toolautosubmit attribute changes for declarative tools#60416
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-cl-7827761

Conversation

@chromium-wpt-export-bot
Copy link
Copy Markdown
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jun 5, 2026

Declarative WebMCP tools registered via the <form> element now correctly
respond to changes in the 'toolautosubmit' attribute. Previously,
modifying this attribute after the tool was registered would leave
the tool's 'autosubmit' annotation in a stale state for the inspector.

This change:

  1. Updates HTMLFormMcpTool to capture the 'toolautosubmit' attribute
    state at the time of registration.
  2. Modified HTMLFormElement::UpdateMcpDefinitionsIfNeeded to detect
    drifts between the current attribute state and the registered tool.
  3. Updated HTMLFormElement::AttributeChanged to trigger a tool
    re-registration when 'toolautosubmit' is added or removed.
  4. Adds an inspector protocol test to verify that toggling the
    attribute correctly triggers toolsRemoved/toolsAdded events with
    the updated annotation.

Fixed: 509838990
Change-Id: I68b55c73478cdedafea2e266aeb86a4fa528a308
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7827761
Reviewed-by: Dominic Farolino <dom@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1642180}

Declarative WebMCP tools registered via the <form> element now correctly
respond to changes in the 'toolautosubmit' attribute. Previously,
modifying this attribute after the tool was registered would leave
the tool's 'autosubmit' annotation in a stale state for the inspector.

This change:
1.  Updates HTMLFormMcpTool to capture the 'toolautosubmit' attribute
    state at the time of registration.
2.  Modified HTMLFormElement::UpdateMcpDefinitionsIfNeeded to detect
    drifts between the current attribute state and the registered tool.
3.  Updated HTMLFormElement::AttributeChanged to trigger a tool
    re-registration when 'toolautosubmit' is added or removed.
4.  Adds an inspector protocol test to verify that toggling the
    attribute correctly triggers toolsRemoved/toolsAdded events with
    the updated annotation.

Fixed: 509838990
Change-Id: I68b55c73478cdedafea2e266aeb86a4fa528a308
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7827761
Reviewed-by: Dominic Farolino <dom@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1642180}
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit b7d9760 into master Jun 5, 2026
27 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7827761 branch June 5, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants