From 7f9afe1a15f62bcb75e2feaf8a1f61ce75488406 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 11 Jul 2024 22:20:06 +0000 Subject: [PATCH] Bug 1906975 [wpt PR 47064] - Rename invokeaction->command, invoketarget->commandfor, a=testonly Automatic update from web-platform-tests Rename invokeaction->command, invoketarget->commandfor This also drops the "auto" value, and updates all tests to accommodate these changes, as well as adding more tests for extra robustness. This is the result of a discussion around renaming the attribute which starts around https://github.com/whatwg/html/issues/9625#issuecomment-2140717681 and concludes in https://github.com/whatwg/html/issues/9625#issuecomment-2181099405. Bug: 349994204 Change-Id: Ic4a5572506e855036c8c1f75aa0de894de026948 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5666705 Reviewed-by: Joey Arhar Commit-Queue: Keith Cirkel Cr-Commit-Position: refs/heads/main@{#1325205} -- wpt-commits: 290314c241de3c980fc4eeeb3d19d3fada080b0e wpt-pr: 47064 --- .../invokers/idlharness.tentative.html | 2 +- .../invokeelement-interface.tentative.html | 93 ++++----- ...invokeevent-dispatch-shadow.tentative.html | 19 +- .../invokeevent-interface.tentative.html | 116 +++++------ ...arget-button-event-dispatch.tentative.html | 138 +++++++------ ...etarget-fullscreen-behavior.tentative.html | 99 +++------ ...oketarget-on-audio-behavior.tentative.html | 159 ++++----------- ...t-on-audio-invalid-behavior.tentative.html | 7 +- ...etarget-on-details-behavior.tentative.html | 54 ++--- ...on-details-invalid-behavior.tentative.html | 15 +- ...ketarget-on-dialog-behavior.tentative.html | 190 +++++++----------- ...-on-dialog-invalid-behavior.tentative.html | 27 +-- ...nvoketarget-on-input-number.tentative.html | 20 +- ...etarget-on-popover-behavior.tentative.html | 94 +++++---- ...on-popover-invalid-behavior.tentative.html | 18 +- ...oketarget-on-video-behavior.tentative.html | 76 +++---- .../tests/interfaces/invokers.tentative.idl | 14 +- 17 files changed, 479 insertions(+), 662 deletions(-) diff --git a/testing/web-platform/tests/html/semantics/invokers/idlharness.tentative.html b/testing/web-platform/tests/html/semantics/invokers/idlharness.tentative.html index 8a86a5aaa1811..e52ab063f841f 100644 --- a/testing/web-platform/tests/html/semantics/invokers/idlharness.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/idlharness.tentative.html @@ -10,7 +10,7 @@ diff --git a/testing/web-platform/tests/html/semantics/invokers/invokeelement-interface.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invokeelement-interface.tentative.html index 5adacadabb4dc..6821adf71fee0 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invokeelement-interface.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invokeelement-interface.tentative.html @@ -5,89 +5,84 @@ - +
diff --git a/testing/web-platform/tests/html/semantics/invokers/invokeevent-dispatch-shadow.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invokeevent-dispatch-shadow.tentative.html index 1ecff88760884..fb2a113994f76 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invokeevent-dispatch-shadow.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invokeevent-dispatch-shadow.tentative.html @@ -25,7 +25,7 @@ let hostEventTarget = null; let hostEventInvoker = null; slot.addEventListener( - "invoke", + "command", (e) => { childEvent = e; childEventTarget = e.target; @@ -34,7 +34,7 @@ { once: true }, ); host.addEventListener( - "invoke", + "command", (e) => { hostEvent = e; hostEventTarget = e.target; @@ -42,13 +42,13 @@ }, { once: true }, ); - const event = new InvokeEvent("invoke", { + const event = new CommandEvent("command", { bubbles: true, invoker: slot, composed: true, }); slot.dispatchEvent(event); - assert_true(childEvent instanceof InvokeEvent, "slot saw invoke event"); + assert_true(childEvent instanceof CommandEvent, "slot saw invoke event"); assert_equals( childEventTarget, slot, @@ -74,7 +74,7 @@ host, "invoker is retargeted to shadowroot host", ); - }, "InvokeEvent propagates across shadow boundaries retargeting invoker"); + }, "CommandEvent propagates across shadow boundaries retargeting invoker"); test(function (t) { const host = document.createElement("div"); @@ -83,12 +83,13 @@ const shadow = host.attachShadow({ mode: "open" }); const button = shadow.appendChild(document.createElement("button")); const invokee = host.appendChild(document.createElement("div")); - button.invokeTargetElement = invokee; + button.commandForElement = invokee; + button.command = 'test-command'; let event = null; let eventTarget = null; let eventInvoker = null; invokee.addEventListener( - "invoke", + "command", (e) => { event = e; eventTarget = e.target; @@ -97,8 +98,8 @@ { once: true }, ); button.click(); - assert_true(event instanceof InvokeEvent); + assert_true(event instanceof CommandEvent); assert_equals(eventTarget, invokee, "target is invokee"); assert_equals(eventInvoker, host, "invoker is host"); - }, "cross shadow InvokeEvent retargets invoker to host element"); + }, "cross shadow CommandEvent retargets invoker to host element"); diff --git a/testing/web-platform/tests/html/semantics/invokers/invokeevent-interface.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invokeevent-interface.tentative.html index 0cfb4d5ee5f59..500c05f88a106 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invokeevent-interface.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invokeevent-interface.tentative.html @@ -14,112 +14,112 @@
- + +
diff --git a/testing/web-platform/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html index 2e2c5f683f0e8..1210b8637deef 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invoketarget-fullscreen-behavior.tentative.html @@ -12,65 +12,47 @@
Fullscreen content - +
- + - +
Details Contents
- + diff --git a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-details-invalid-behavior.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-details-invalid-behavior.tentative.html index d5e90af9c0e43..3a4e86e9f2c90 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-details-invalid-behavior.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-details-invalid-behavior.tentative.html @@ -11,16 +11,17 @@
Details Contents
- + diff --git a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-behavior.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-behavior.tentative.html index 9f73e092b0342..9cf1e530b3d17 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-behavior.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-behavior.tentative.html @@ -11,43 +11,39 @@ - + - + diff --git a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-invalid-behavior.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-invalid-behavior.tentative.html index af84c22594a47..8ea5066dd7449 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-invalid-behavior.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-dialog-invalid-behavior.tentative.html @@ -11,21 +11,22 @@ - + - + - +
- +
- +
- +
- + diff --git a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html index d15d6f95841b7..e395281ee31fd 100644 --- a/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html +++ b/testing/web-platform/tests/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html @@ -11,38 +11,20 @@ - +