[Platform-provided behaviors] Small refactor and added missing tests [chromium/src : main]

0 views
Skip to first unread message

Ana Sollano Kim (Gerrit)

unread,
Apr 16, 2026, 8:44:09 PM (13 days ago) Apr 16
to Dan Clark, Mason Freed, Leo Lee, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Dan Clark

Ana Sollano Kim added 1 comment

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

PTAL (I don't think the order of which CL is reviewed first matters).

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Clark
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: I83e2e664831627e96d8a86a2f077468bf10168cb
Gerrit-Change-Number: 7770147
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: Leo Lee <leo...@microsoft.com>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Comment-Date: Fri, 17 Apr 2026 00:43:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dan Clark (Gerrit)

unread,
Apr 17, 2026, 2:33:58 PM (13 days ago) Apr 17
to Ana Sollano Kim, Mason Freed, Leo Lee, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Ana Sollano Kim

Dan Clark added 1 comment

File third_party/blink/renderer/core/html/forms/html_submit_button_behavior.cc
Line 70, Patchset 6 (Latest):HTMLFormElement* HTMLSubmitButtonBehavior::form(
Dan Clark . unresolved

I'm sorry for missing this before, but it is probably better that these getters not throw, as a general principle:
https://www.w3.org/TR/design-principles/#attributes-vs-methods

Can these return an empty string / empty list instead, if there is no `internals`?

For the `labels` case we'll need to be a bit careful because of this other principle further down that list:

```
If the underlying object has not changed, getters should return the same
object each time it is called. This means obj.property === obj.property must
always hold. Returning a new value from an getter each time is not allowed. If
this does not hold, the getter should be a method.
```

This means we can't just create a new empty NodeList every time -- we'll need to cache one the first time this is called without `internals`, and then use that for future no-`internals` calls.

Open in Gerrit

Related details

Attention is currently required from:
  • Ana Sollano Kim
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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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: Leo Lee <leo...@microsoft.com>
    Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Comment-Date: Fri, 17 Apr 2026 18:33:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ana Sollano Kim (Gerrit)

    unread,
    Apr 20, 2026, 1:31:27 PM (10 days ago) Apr 20
    to Dan Clark, Mason Freed, Leo Lee, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Dan Clark

    Ana Sollano Kim added 1 comment

    File third_party/blink/renderer/core/html/forms/html_submit_button_behavior.cc
    Line 70, Patchset 6 (Latest):HTMLFormElement* HTMLSubmitButtonBehavior::form(
    Dan Clark . unresolved

    I'm sorry for missing this before, but it is probably better that these getters not throw, as a general principle:
    https://www.w3.org/TR/design-principles/#attributes-vs-methods

    Can these return an empty string / empty list instead, if there is no `internals`?

    For the `labels` case we'll need to be a bit careful because of this other principle further down that list:

    ```
    If the underlying object has not changed, getters should return the same
    object each time it is called. This means obj.property === obj.property must
    always hold. Returning a new value from an getter each time is not allowed. If
    this does not hold, the getter should be a method.
    ```

    This means we can't just create a new empty NodeList every time -- we'll need to cache one the first time this is called without `internals`, and then use that for future no-`internals` calls.

    Ana Sollano Kim

    Looks like both `form()`[1] and `labels()`[2] already throw as getters. I was thinking we would need to follow that and don't prevent these exceptions from happening as we're delegating to ElementInternals for both of these cases. Do we want to not throw these exceptions if they happen?

    [1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-elementinternals-form
    [2] https://html.spec.whatwg.org/multipage/forms.html#dom-elementinternals-labels

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dan Clark
    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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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: Leo Lee <leo...@microsoft.com>
    Gerrit-Attention: Dan Clark <dan...@microsoft.com>
    Gerrit-Comment-Date: Mon, 20 Apr 2026 17:31:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dan Clark (Gerrit)

    unread,
    Apr 22, 2026, 2:14:45 PM (8 days ago) Apr 22
    to Ana Sollano Kim, Mason Freed, Leo Lee, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Ana Sollano Kim

    Dan Clark voted and added 2 comments

    Votes added by Dan Clark

    Code-Review+1

    2 comments

    Patchset-level comments
    Dan Clark . resolved

    LGTM

    File third_party/blink/renderer/core/html/forms/html_submit_button_behavior.cc
    Line 70, Patchset 6 (Latest):HTMLFormElement* HTMLSubmitButtonBehavior::form(
    Dan Clark . resolved

    I'm sorry for missing this before, but it is probably better that these getters not throw, as a general principle:
    https://www.w3.org/TR/design-principles/#attributes-vs-methods

    Can these return an empty string / empty list instead, if there is no `internals`?

    For the `labels` case we'll need to be a bit careful because of this other principle further down that list:

    ```
    If the underlying object has not changed, getters should return the same
    object each time it is called. This means obj.property === obj.property must
    always hold. Returning a new value from an getter each time is not allowed. If
    this does not hold, the getter should be a method.
    ```

    This means we can't just create a new empty NodeList every time -- we'll need to cache one the first time this is called without `internals`, and then use that for future no-`internals` calls.

    Ana Sollano Kim

    Looks like both `form()`[1] and `labels()`[2] already throw as getters. I was thinking we would need to follow that and don't prevent these exceptions from happening as we're delegating to ElementInternals for both of these cases. Do we want to not throw these exceptions if they happen?

    [1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-elementinternals-form
    [2] https://html.spec.whatwg.org/multipage/forms.html#dom-elementinternals-labels

    Dan Clark

    Ah, I missed that. I think it was probably a design mistake for those to throw, but being [consistent](https://www.w3.org/TR/design-principles/#consistency) with that behavior for these new getters makes sense.

    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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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: Leo Lee <leo...@microsoft.com>
    Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Comment-Date: Wed, 22 Apr 2026 18:14:40 +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

    Blink W3C Test Autoroller (Gerrit)

    unread,
    Apr 22, 2026, 2:35:36 PM (8 days ago) Apr 22
    to Ana Sollano Kim, Dan Clark, Mason Freed, Leo Lee, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Ana Sollano Kim

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

    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 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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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-Comment-Date: Wed, 22 Apr 2026 18:35:30 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Ana Sollano Kim (Gerrit)

    unread,
    Apr 23, 2026, 1:29:22 PM (7 days ago) Apr 23
    to Blink W3C Test Autoroller, Dan Clark, Mason Freed, Leo Lee, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

    Ana Sollano Kim voted Commit-Queue+2

    Commit-Queue+2
    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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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: Leo Lee <leo...@microsoft.com>
    Gerrit-Comment-Date: Thu, 23 Apr 2026 17:29:12 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Apr 23, 2026, 3:25:45 PM (7 days ago) Apr 23
    to Ana Sollano Kim, Blink W3C Test Autoroller, Dan Clark, Mason Freed, Leo Lee, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    [Platform-provided behaviors] Small refactor and added missing tests

    Introduce a private helper to retrieve ElementInternals and throw
    InvalidStateError exceptions when the behavior is not attached to an
    element in HTMLSubmitButtonBehavior.

    Two more tests are added to
    ElementInternals-submit-behavior.tentative.html for form and formTarget
    properties.

    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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Commit-Queue: Ana Sollano Kim <anso...@microsoft.com>
    Reviewed-by: Dan Clark <dan...@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#1619690}
    Files:
    • M third_party/blink/renderer/core/html/forms/html_submit_button_behavior.cc
    • M third_party/blink/renderer/core/html/forms/html_submit_button_behavior.h
    • M third_party/blink/web_tests/external/wpt/custom-elements/element-internals-behaviors.tentative.html
    • M third_party/blink/web_tests/external/wpt/custom-elements/form-associated/ElementInternals-submit-behavior.tentative.html
    Change size: M
    Delta: 4 files changed, 41 insertions(+), 12 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Dan Clark
    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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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,
    Apr 23, 2026, 5:51:46 PM (6 days ago) Apr 23
    to Ana Sollano Kim, Chromium LUCI CQ, Dan Clark, Mason Freed, Leo Lee, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@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/59411

    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: I83e2e664831627e96d8a86a2f077468bf10168cb
    Gerrit-Change-Number: 7770147
    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: Leo Lee <leo...@microsoft.com>
    Gerrit-Comment-Date: Thu, 23 Apr 2026 21:51:41 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages