[Platform-provided behaviors] Introduce HTMLSubmitButtonBehavior [chromium/src : main]

0 views
Skip to first unread message

Ana Sollano Kim (Gerrit)

unread,
Mar 23, 2026, 9:05:27 PM (9 days ago) Mar 23
to Dan Clark, Mason Freed, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
Attention needed from Dan Clark and Mason Freed

Ana Sollano Kim added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Ana Sollano Kim . resolved

PTAL when you get the chance 😊

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Clark
  • Mason Freed
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: I9047177bf30a9a6615ee506735a120be6f671fb6
Gerrit-Change-Number: 7693458
Gerrit-PatchSet: 4
Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Leo Lee <leo...@microsoft.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Comment-Date: Tue, 24 Mar 2026 01:05:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Clark (Gerrit)

unread,
Mar 25, 2026, 1:57:22 PM (8 days ago) Mar 25
to Ana Sollano Kim, Mason Freed, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
Attention needed from Ana Sollano Kim and Mason Freed

Dan Clark added 7 comments

Patchset-level comments
Dan Clark . resolved

Looks good overall!

File third_party/blink/renderer/core/html/custom/element_internals.h
Line 88, Patchset 4 (Latest): void SetBehaviors(HeapVector<Member<ElementBehavior>> behaviors,
Dan Clark . unresolved

Given the recent discussion about only allowing behaviors to be set once, should this be removed from the IDL and made a private method that only gets called during `attachInternals`?

File third_party/blink/renderer/core/html/forms/element_behavior.cc
Line 23, Patchset 4 (Latest): DCHECK(!internals_) << "Behavior is already attached to an element.";
File third_party/blink/renderer/core/html/forms/html_submit_button_behavior.idl
Line 5, Patchset 4 (Latest):// HTMLSubmitButtonBehavior provides submit button behavior to
Dan Clark . unresolved

Since we don't have a spec yet, could this link to the explainer?

Line 14, Patchset 4 (Latest): attribute boolean disabled;
Dan Clark . unresolved

Can we move this stuff into an `interface mixin` that's included by both this and by `HTMLButtonElement`? For an example see [`PopoverTargetAttributes`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/popover_target_attributes.idl).

File third_party/blink/web_tests/external/wpt/custom-elements/form-associated/ElementInternals-submit-behavior.tentative.html
Line 66, Patchset 4 (Latest): const behavior = new HTMLSubmitButtonBehavior();
Dan Clark . unresolved

Can you also check default values for `form` and `labels` here?

Line 95, Patchset 4 (Latest):}, 'HTMLSubmitButtonBehavior properties are writable');
Dan Clark . unresolved

Somewhere let's also check that `form` and `labels` are not writable

Open in Gerrit

Related details

Attention is currently required from:
  • Ana Sollano Kim
  • Mason Freed
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: I9047177bf30a9a6615ee506735a120be6f671fb6
    Gerrit-Change-Number: 7693458
    Gerrit-PatchSet: 4
    Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leo Lee <leo...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Wed, 25 Mar 2026 17:57:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Mar 26, 2026, 7:36:10 PM (6 days ago) Mar 26
    to Ana Sollano Kim, Dan Clark, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
    Attention needed from Ana Sollano Kim

    Mason Freed voted and added 3 comments

    Votes added by Mason Freed

    Code-Review+1

    3 comments

    Patchset-level comments
    Mason Freed . resolved

    This looks like a great start. Modulo my small comments and Dan's, this LGTM.

    File third_party/blink/renderer/core/html/custom/element_internals.h
    Line 88, Patchset 4 (Latest): void SetBehaviors(HeapVector<Member<ElementBehavior>> behaviors,
    Dan Clark . unresolved

    Given the recent discussion about only allowing behaviors to be set once, should this be removed from the IDL and made a private method that only gets called during `attachInternals`?

    Mason Freed

    +1, if that's the direction you think it'll go.

    File third_party/blink/renderer/core/html/custom/element_internals.cc
    Line 440, Patchset 4 (Latest): "This behavior instance is already attached to another element.");
    Mason Freed . unresolved

    nit: "This" is a bit tough to follow, if you pass in multiple. If it's easy (and only if its easy) I wonder if you could add the name of the behavior or something.

    While I'm thinking about this, if you gave each ElementBehavior a statically defined `name` (e.g. `"HTMLSubmitButtonBehavior"` in this case), then you could use it here for display, and also use that to de-dupe the types, rather than `WrapperTypeInfo` comparisons.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ana Sollano Kim
    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: I9047177bf30a9a6615ee506735a120be6f671fb6
    Gerrit-Change-Number: 7693458
    Gerrit-PatchSet: 4
    Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leo Lee <leo...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Comment-Date: Thu, 26 Mar 2026 23:35:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ana Sollano Kim (Gerrit)

    unread,
    Mar 30, 2026, 8:14:08 PM (2 days ago) Mar 30
    to Mason Freed, Dan Clark, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
    Attention needed from Dan Clark and Mason Freed

    Ana Sollano Kim added 7 comments

    File third_party/blink/renderer/core/html/custom/element_internals.h
    Line 88, Patchset 4: void SetBehaviors(HeapVector<Member<ElementBehavior>> behaviors,
    Dan Clark . resolved

    Given the recent discussion about only allowing behaviors to be set once, should this be removed from the IDL and made a private method that only gets called during `attachInternals`?

    Mason Freed

    +1, if that's the direction you think it'll go.

    Ana Sollano Kim

    Done. `SetBehaviors` was already not exposed in the IDL (`readonly attribute FrozenArray<ElementBehavior> behaviors`), but I made it private here.

    File third_party/blink/renderer/core/html/custom/element_internals.cc
    Line 440, Patchset 4: "This behavior instance is already attached to another element.");
    Mason Freed . resolved

    nit: "This" is a bit tough to follow, if you pass in multiple. If it's easy (and only if its easy) I wonder if you could add the name of the behavior or something.

    While I'm thinking about this, if you gave each ElementBehavior a statically defined `name` (e.g. `"HTMLSubmitButtonBehavior"` in this case), then you could use it here for display, and also use that to de-dupe the types, rather than `WrapperTypeInfo` comparisons.

    Ana Sollano Kim

    Done. Added a `BehaviorName()` method to `ElementBehavior`. `SetBehaviors` now uses it for both deduplication and error messages:

    `HTMLSubmitButtonBehavior instance is already in the behaviors list.`
    `Only one instance of HTMLSubmitButtonBehavior is allowed per element.`
    `HTMLSubmitButtonBehavior instance is already attached to another element.`

    File third_party/blink/renderer/core/html/forms/element_behavior.cc
    Line 23, Patchset 4: DCHECK(!internals_) << "Behavior is already attached to an element.";
    Dan Clark . resolved
    Ana Sollano Kim

    Done

    File third_party/blink/renderer/core/html/forms/html_submit_button_behavior.idl
    Line 5, Patchset 4:// HTMLSubmitButtonBehavior provides submit button behavior to
    Dan Clark . resolved

    Since we don't have a spec yet, could this link to the explainer?

    Ana Sollano Kim

    Done

    Line 14, Patchset 4: attribute boolean disabled;
    Dan Clark . unresolved

    Can we move this stuff into an `interface mixin` that's included by both this and by `HTMLButtonElement`? For an example see [`PopoverTargetAttributes`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/popover_target_attributes.idl).

    Ana Sollano Kim

    I tried this but the properties on `HTMLButtonElement` and `HTMLSubmitButtonBehavior` seem to have incompatible IDL annotations:

    • `HTMLButtonElement` uses `[CEReactions, Reflect]` or `[CEReactions]` on these properties.
    • `HTMLSubmitButtonBehavior` doesn't reflect attributes like `<button>` does and `CEReactions` doesn't seem to apply since behaviors aren't elements.

    I think we would need identical annotations in both contexts in order to use an `interface mixin`. Feel free to correct me if I'm missing something.

    File third_party/blink/web_tests/external/wpt/custom-elements/form-associated/ElementInternals-submit-behavior.tentative.html
    Line 66, Patchset 4: const behavior = new HTMLSubmitButtonBehavior();
    Dan Clark . resolved

    Can you also check default values for `form` and `labels` here?

    Ana Sollano Kim

    Done

    Line 95, Patchset 4:}, 'HTMLSubmitButtonBehavior properties are writable');
    Dan Clark . resolved

    Somewhere let's also check that `form` and `labels` are not writable

    Ana Sollano Kim

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dan Clark
    • Mason Freed
    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: I9047177bf30a9a6615ee506735a120be6f671fb6
    Gerrit-Change-Number: 7693458
    Gerrit-PatchSet: 5
    Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Leo Lee <leo...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Dan Clark <dan...@microsoft.com>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 00:14:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dan Clark (Gerrit)

    unread,
    Mar 31, 2026, 12:06:16 PM (2 days ago) Mar 31
    to Ana Sollano Kim, Mason Freed, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
    Attention needed from Ana Sollano Kim and Mason Freed

    Dan Clark voted and added 4 comments

    Votes added by Dan Clark

    Code-Review+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Dan Clark . resolved

    LGTM with just a couple small things

    File third_party/blink/renderer/core/html/custom/element_internals.cc
    Line 427, Patchset 5 (Latest): if (seen_behaviors.Contains(behavior)) {
    Dan Clark . unresolved

    I guess it's not strictly necessary to check this if we're also checking `seen_names`, since a behavior will always have the same name as itself. So this could be removed. But maybe this error message is more precise for this case, so I'm OK to leave it as-is if that's your preference.

    File third_party/blink/renderer/core/html/forms/html_submit_button_behavior.idl
    Line 14, Patchset 4: attribute boolean disabled;
    Dan Clark . resolved

    Can we move this stuff into an `interface mixin` that's included by both this and by `HTMLButtonElement`? For an example see [`PopoverTargetAttributes`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/popover_target_attributes.idl).

    Ana Sollano Kim

    I tried this but the properties on `HTMLButtonElement` and `HTMLSubmitButtonBehavior` seem to have incompatible IDL annotations:

    • `HTMLButtonElement` uses `[CEReactions, Reflect]` or `[CEReactions]` on these properties.
    • `HTMLSubmitButtonBehavior` doesn't reflect attributes like `<button>` does and `CEReactions` doesn't seem to apply since behaviors aren't elements.

    I think we would need identical annotations in both contexts in order to use an `interface mixin`. Feel free to correct me if I'm missing something.

    Dan Clark

    That makes sense, thanks for trying it.

    File third_party/blink/renderer/core/html/html_element.cc
    Line 3892, Patchset 5 (Latest): internals.SetBehaviors(std::move(behaviors), exception_state);
    Dan Clark . unresolved

    Not a new issue to this change, but `internals.SetBehaviors` should be moved into the `if (options && options->hasBehaviors())` block. Otherwise we'll call `SetBehaviors` on every `attachInternals` call even if no behaviors were given, which will end up creating an empty behaviors `FrozenArray`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ana Sollano Kim
    • Mason Freed
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: I9047177bf30a9a6615ee506735a120be6f671fb6
      Gerrit-Change-Number: 7693458
      Gerrit-PatchSet: 5
      Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Leo Lee <leo...@microsoft.com>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Tue, 31 Mar 2026 16:06:05 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ana Sollano Kim <anso...@microsoft.com>
      Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Mar 31, 2026, 1:14:59 PM (2 days ago) Mar 31
      to Ana Sollano Kim, Dan Clark, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
      Attention needed from Ana Sollano Kim

      Mason Freed voted and added 3 comments

      Votes added by Mason Freed

      Code-Review+1

      3 comments

      Patchset-level comments
      Mason Freed . resolved

      LGTM, thanks for the changes.

      File third_party/blink/renderer/core/html/custom/element_internals.cc
      Line 427, Patchset 5 (Latest): if (seen_behaviors.Contains(behavior)) {
      Dan Clark . unresolved

      I guess it's not strictly necessary to check this if we're also checking `seen_names`, since a behavior will always have the same name as itself. So this could be removed. But maybe this error message is more precise for this case, so I'm OK to leave it as-is if that's your preference.

      Mason Freed

      +1, and I don't actually think the error message is any different between the cases. So I'd be in favor of removing one of these.

      (Ideally, there'd be a DCHECK or test somewhere that validates that all defined behavior classes indeed have unique names.)

      Line 440, Patchset 4: "This behavior instance is already attached to another element.");
      Mason Freed . resolved

      nit: "This" is a bit tough to follow, if you pass in multiple. If it's easy (and only if its easy) I wonder if you could add the name of the behavior or something.

      While I'm thinking about this, if you gave each ElementBehavior a statically defined `name` (e.g. `"HTMLSubmitButtonBehavior"` in this case), then you could use it here for display, and also use that to de-dupe the types, rather than `WrapperTypeInfo` comparisons.

      Ana Sollano Kim

      Done. Added a `BehaviorName()` method to `ElementBehavior`. `SetBehaviors` now uses it for both deduplication and error messages:

      `HTMLSubmitButtonBehavior instance is already in the behaviors list.`
      `Only one instance of HTMLSubmitButtonBehavior is allowed per element.`
      `HTMLSubmitButtonBehavior instance is already attached to another element.`

      Mason Freed

      Nice!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ana Sollano Kim
      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: I9047177bf30a9a6615ee506735a120be6f671fb6
      Gerrit-Change-Number: 7693458
      Gerrit-PatchSet: 5
      Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Leo Lee <leo...@microsoft.com>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Comment-Date: Tue, 31 Mar 2026 17:14:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ana Sollano Kim <anso...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ana Sollano Kim (Gerrit)

      unread,
      Mar 31, 2026, 4:26:34 PM (2 days ago) Mar 31
      to Mason Freed, Dan Clark, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org

      Ana Sollano Kim voted and added 3 comments

      Votes added by Ana Sollano Kim

      Commit-Queue+2

      3 comments

      Patchset-level comments
      Ana Sollano Kim . resolved

      Thanks for the feedback!

      File third_party/blink/renderer/core/html/custom/element_internals.cc
      Line 427, Patchset 5: if (seen_behaviors.Contains(behavior)) {
      Dan Clark . resolved

      I guess it's not strictly necessary to check this if we're also checking `seen_names`, since a behavior will always have the same name as itself. So this could be removed. But maybe this error message is more precise for this case, so I'm OK to leave it as-is if that's your preference.

      Mason Freed

      +1, and I don't actually think the error message is any different between the cases. So I'd be in favor of removing one of these.

      (Ideally, there'd be a DCHECK or test somewhere that validates that all defined behavior classes indeed have unique names.)

      Ana Sollano Kim

      Removed the `seen_behaviors` instance check.

      Regarding validating unique names across behavior classes: I'll add a DCHECK/test when a second behavior class is introduced.

      File third_party/blink/renderer/core/html/html_element.cc
      Line 3892, Patchset 5: internals.SetBehaviors(std::move(behaviors), exception_state);
      Dan Clark . resolved

      Not a new issue to this change, but `internals.SetBehaviors` should be moved into the `if (options && options->hasBehaviors())` block. Otherwise we'll call `SetBehaviors` on every `attachInternals` call even if no behaviors were given, which will end up creating an empty behaviors `FrozenArray`.

      Ana Sollano Kim

      This approach makes sense to me. I changed it because this comment on CL 1 https://chromium-review.googlesource.com/c/chromium/src/+/7666964/comment/1cbf45b0_ae22550f/. Happy to revisit again if needed.

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • 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: I9047177bf30a9a6615ee506735a120be6f671fb6
        Gerrit-Change-Number: 7693458
        Gerrit-PatchSet: 6
        Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Leo Lee <leo...@microsoft.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Comment-Date: Tue, 31 Mar 2026 20:26:23 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Mar 31, 2026, 4:36:49 PM (2 days ago) Mar 31
        to Ana Sollano Kim, Mason Freed, Dan Clark, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org

        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/58892.

        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 set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • 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: I9047177bf30a9a6615ee506735a120be6f671fb6
        Gerrit-Change-Number: 7693458
        Gerrit-PatchSet: 6
        Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Leo Lee <leo...@microsoft.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Comment-Date: Tue, 31 Mar 2026 20:36:40 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Dan Clark (Gerrit)

        unread,
        Mar 31, 2026, 4:40:53 PM (2 days ago) Mar 31
        to Ana Sollano Kim, Blink W3C Test Autoroller, Mason Freed, Leo Lee, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org
        Attention needed from Ana Sollano Kim

        Dan Clark voted and added 1 comment

        Votes added by Dan Clark

        Code-Review+1

        1 comment

        File third_party/blink/renderer/core/html/html_element.cc
        Line 3892, Patchset 5: internals.SetBehaviors(std::move(behaviors), exception_state);
        Dan Clark . resolved

        Not a new issue to this change, but `internals.SetBehaviors` should be moved into the `if (options && options->hasBehaviors())` block. Otherwise we'll call `SetBehaviors` on every `attachInternals` call even if no behaviors were given, which will end up creating an empty behaviors `FrozenArray`.

        Ana Sollano Kim

        This approach makes sense to me. I changed it because this comment on CL 1 https://chromium-review.googlesource.com/c/chromium/src/+/7666964/comment/1cbf45b0_ae22550f/. Happy to revisit again if needed.

        Dan Clark

        Ah, sorry, I forgot we could still need to hand out the empty array. There might actually be a problem with the `DEFINE_STATIC_LOCAL` approach here because if two `internals` with an empty `behaviors` array compare their `behaviors` array, the comparison would actually return true because they're reusing the same empty value. But they should be different.

        Probably Mason's suggestion in the earlier CL was right and it's simplest to just always call `SetBehaviors`. OK to fix now or in a follow-up (with a test for comparing empty `behaviors` array identity from two different `ElementInternals`, which would be a good one to add) in order to not delay this CL further. Apologies for the bad suggestion.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ana Sollano Kim
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • 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: I9047177bf30a9a6615ee506735a120be6f671fb6
        Gerrit-Change-Number: 7693458
        Gerrit-PatchSet: 6
        Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Leo Lee <leo...@microsoft.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Comment-Date: Tue, 31 Mar 2026 20:40:41 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Ana Sollano Kim <anso...@microsoft.com>
        Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Mar 31, 2026, 4:49:55 PM (2 days ago) Mar 31
        to Ana Sollano Kim, Blink W3C Test Autoroller, Mason Freed, Dan Clark, Leo Lee, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        [Platform-provided behaviors] Introduce HTMLSubmitButtonBehavior

        This change introduces the HTMLSubmitButtonBehavior interface, which
        will allow custom elements to adopt submit button functionality and
        attribute handling by attaching this behavior via ElementInternals.

        In this CL, ElementInternals is updated to validate behavior attachment,
        preventing duplicate behavior types or the reuse of behavior instances
        across multiple elements. Property delegation for form association and
        labeling and support for standard attributes is added to
        HTMLSubmitButtonBehavior as well. Upcoming CLs will implement form
        submission logic.

        Explainer:
        https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PlatformProvidedBehaviors/explainer.md
        Design doc:
        https://docs.google.com/document/d/1LA1hhzxmi4OmZoGtIdnwvL3g7y48YjXTOoUvFtxFugE/edit?usp=sharing
        Bug: 486928684
        Change-Id: I9047177bf30a9a6615ee506735a120be6f671fb6
        Reviewed-by: Dan Clark <dan...@microsoft.com>
        Reviewed-by: Mason Freed <mas...@chromium.org>
        Commit-Queue: Ana Sollano Kim <anso...@microsoft.com>
        Cr-Commit-Position: refs/heads/main@{#1608078}
        Files:
        • M android_webview/test/data/web_tests/webexposed/global-interface-listing-expected.txt
        • M third_party/blink/renderer/bindings/generated_in_core.gni
        • M third_party/blink/renderer/bindings/idl_in_core.gni
        • M third_party/blink/renderer/core/html/build.gni
        • M third_party/blink/renderer/core/html/custom/element_internals.cc
        • M third_party/blink/renderer/core/html/custom/element_internals.h
        • M third_party/blink/renderer/core/html/forms/element_behavior.cc
        • M third_party/blink/renderer/core/html/forms/element_behavior.h
        • M third_party/blink/renderer/core/html/forms/element_behavior.idl
        • A third_party/blink/renderer/core/html/forms/html_submit_button_behavior.cc
        • A third_party/blink/renderer/core/html/forms/html_submit_button_behavior.h
        • A third_party/blink/renderer/core/html/forms/html_submit_button_behavior.idl
        • M third_party/blink/renderer/core/html/html_element.cc
        • M third_party/blink/web_tests/external/wpt/custom-elements/element-internals-behaviors.tentative.html
        • A third_party/blink/web_tests/external/wpt/custom-elements/form-associated/ElementInternals-submit-behavior.tentative.html
        • M third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
        Change size: L
        Delta: 16 files changed, 505 insertions(+), 9 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Dan Clark, +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: I9047177bf30a9a6615ee506735a120be6f671fb6
        Gerrit-Change-Number: 7693458
        Gerrit-PatchSet: 7
        Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        open
        diffy
        satisfied_requirement

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Mar 31, 2026, 5:43:41 PM (2 days ago) Mar 31
        to Ana Sollano Kim, Chromium LUCI CQ, Mason Freed, Dan Clark, Leo Lee, AyeAye, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, dominicc+...@chromium.org, jmedle...@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/58892

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • 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: I9047177bf30a9a6615ee506735a120be6f671fb6
        Gerrit-Change-Number: 7693458
        Gerrit-PatchSet: 7
        Gerrit-Owner: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Leo Lee <leo...@microsoft.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Comment-Date: Tue, 31 Mar 2026 21:43:34 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages