[SelectMenu] Apply controller code to the author provided shadow DOM. [chromium/src : main]

0 views
Skip to first unread message

Ionel Popescu (Gerrit)

unread,
Sep 16, 2021, 3:16:13 PM9/16/21
to Dan Clark, Mason Freed, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

Attention is currently required from: Dan Clark, Mason Freed.

Ionel Popescu would like Dan Clark and Mason Freed to review this change.

View Change

[SelectMenu] Apply controller code to the author provided shadow DOM.

This change ensure that controller code is applied to the author
provided shadow DOM by having the mutation observer watch
changes for the shadow root.

Because of that we can't rely on the slotchange event to catch
when the default parts were replaced as we would have duplicate
notifications. In order to do that
HTMLSelectMenuElement::SelectMutationCallback should be extended to
handle the case when a node with slot attribute is inserted/removed
even if its part attribute isn't set.

Bug: 1121840
Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
---
M third_party/blink/renderer/core/html/forms/html_select_menu_element.cc
M third_party/blink/renderer/core/html/forms/html_select_menu_element.h
A third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-popup.tentative-expected.txt
M third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-popup.tentative.html
D third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-shadow-root-replacement.tentative-expected.txt
M third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-shadow-root-replacement.tentative.html
6 files changed, 52 insertions(+), 54 deletions(-)


To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
Gerrit-Change-Number: 3166023
Gerrit-PatchSet: 1
Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-MessageType: newchange

Ionel Popescu (Gerrit)

unread,
Sep 16, 2021, 3:16:22 PM9/16/21
to blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Mason Freed, Dan Clark, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dan Clark, Mason Freed.

View Change

1 comment:

To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
Gerrit-Change-Number: 3166023
Gerrit-PatchSet: 1
Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Thu, 16 Sep 2021 19:16:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Blink WPT Bot (Gerrit)

unread,
Sep 16, 2021, 3:24:31 PM9/16/21
to Ionel Popescu, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Mason Freed, Dan Clark, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Dan Clark, Mason Freed.

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

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

View Change

    To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
    Gerrit-Change-Number: 3166023
    Gerrit-PatchSet: 1
    Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Dan Clark <dan...@microsoft.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Sep 2021 19:24:22 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Dan Clark (Gerrit)

    unread,
    Sep 16, 2021, 5:13:05 PM9/16/21
    to Ionel Popescu, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Blink WPT Bot, Mason Freed, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Ionel Popescu, Mason Freed.

    Patch set 1:Code-Review +1

    View Change

    1 comment:

      • In order to do that HTMLSelectMenuElement::SelectMutationCallback should be extended to handle the case when a node with slot attribute is inserted/removed even if its part attribute isn't set.

      • I think we might also need to start watching for `slot` attribute changes in the observer to catch cases where an existing element under the <selectmenu> has its `slot` attribute added/removed/changed.

    To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
    Gerrit-Change-Number: 3166023
    Gerrit-PatchSet: 1
    Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Sep 2021 21:12:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Ionel Popescu (Gerrit)

    unread,
    Sep 16, 2021, 5:53:18 PM9/16/21
    to blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Dan Clark, Blink WPT Bot, Mason Freed, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Mason Freed.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #1:

        LGTM, thanks! […]

        I agree, I am planning to address this in a future CL. thanks!

    To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
    Gerrit-Change-Number: 3166023
    Gerrit-PatchSet: 1
    Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Sep 2021 21:53:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
    Gerrit-MessageType: comment

    Mason Freed (Gerrit)

    unread,
    Sep 17, 2021, 6:39:35 PM9/17/21
    to Ionel Popescu, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Dan Clark, Blink WPT Bot, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Ionel Popescu.

    Patch set 1:Code-Review +1

    View Change

    1 comment:

    To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
    Gerrit-Change-Number: 3166023
    Gerrit-PatchSet: 1
    Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Ionel Popescu <iopo...@microsoft.com>
    Gerrit-Comment-Date: Fri, 17 Sep 2021 22:39:27 +0000

    Ionel Popescu (Gerrit)

    unread,
    Sep 17, 2021, 6:45:01 PM9/17/21
    to blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Mason Freed, Dan Clark, Blink WPT Bot, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Ionel Popescu.

    Patch set 1:Commit-Queue +2

    View Change

      To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
      Gerrit-Change-Number: 3166023
      Gerrit-PatchSet: 1
      Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Ionel Popescu <iopo...@microsoft.com>
      Gerrit-Comment-Date: Fri, 17 Sep 2021 22:44:51 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      Chromium LUCI CQ (Gerrit)

      unread,
      Sep 17, 2021, 7:09:44 PM9/17/21
      to Ionel Popescu, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Mason Freed, Dan Clark, Blink WPT Bot, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change


      Approvals: Dan Clark: Looks good to me Mason Freed: Looks good to me Ionel Popescu: Commit
      [SelectMenu] Apply controller code to the author provided shadow DOM.

      This change ensure that controller code is applied to the author
      provided shadow DOM by having the mutation observer watch
      changes for the shadow root.

      Because of that we can't rely on the slotchange event to catch
      when the default parts were replaced as we would have duplicate
      notifications. In order to do that

      HTMLSelectMenuElement::SelectMutationCallback should be extended to
      handle the case when a node with slot attribute is inserted/removed
      even if its part attribute isn't set.

      Bug: 1121840
      Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3166023
      Reviewed-by: Dan Clark <dan...@microsoft.com>
      Reviewed-by: Mason Freed <mas...@chromium.org>
      Commit-Queue: Ionel Popescu <iopo...@microsoft.com>
      Cr-Commit-Position: refs/heads/main@{#922716}

      ---
      M third_party/blink/renderer/core/html/forms/html_select_menu_element.cc
      M third_party/blink/renderer/core/html/forms/html_select_menu_element.h
      A third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-popup.tentative-expected.txt
      M third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-popup.tentative.html
      D third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-shadow-root-replacement.tentative-expected.txt
      M third_party/blink/web_tests/external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-shadow-root-replacement.tentative.html
      6 files changed, 52 insertions(+), 54 deletions(-)


      To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
      Gerrit-Change-Number: 3166023
      Gerrit-PatchSet: 2
      Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
      Gerrit-MessageType: merged

      Blink WPT Bot (Gerrit)

      unread,
      Sep 17, 2021, 7:48:07 PM9/17/21
      to Ionel Popescu, Chromium LUCI CQ, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Mason Freed, Dan Clark, chromium...@chromium.org

      The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/30827

      View Change

        To view, visit change 3166023. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I20ec7a00b8a3a130740a4dc0354bba0563ebb0a1
        Gerrit-Change-Number: 3166023
        Gerrit-PatchSet: 2
        Gerrit-Owner: Ionel Popescu <iopo...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Ionel Popescu <iopo...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Fri, 17 Sep 2021 23:47:56 +0000
        Reply all
        Reply to author
        Forward
        0 new messages