From 05e86469ccb2eb6901762897801a258856b9adcc Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 20 Nov 2023 11:12:48 +0000 Subject: [PATCH] Bug 1863364 [wpt PR 42976] - Don't fire dblclick on disabled form control elements, a=testonly Automatic update from web-platform-tests Don't fire dblclick on disabled form control elements As discussed here, we should apply the event blocking behavior for disabled form controls to dblclick in addition to click, mouseup, and mousedown: https://github.com/whatwg/html/issues/2368#issuecomment-1791704780 Change-Id: Ibc52585ce0704d8ba8467efc3462bd378d23fbae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5007308 Commit-Queue: Joey Arhar Reviewed-by: Mason Freed Cr-Commit-Position: refs/heads/main@{#1225838} -- wpt-commits: dd5d55c3debd577a09921b32f3816797664c5e86 wpt-pr: 42976 --- .../disabled-event-dispatch.tentative.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/testing/web-platform/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html b/testing/web-platform/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html index e2b8846fc3dbe..0b2b967bfb4a2 100644 --- a/testing/web-platform/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html +++ b/testing/web-platform/tests/html/semantics/disabled-elements/disabled-event-dispatch.tentative.html @@ -25,7 +25,7 @@ static get formAssociated() { return true; } }); -['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click'].forEach(eventName => { +['mousedown', 'mouseup', 'pointerdown', 'pointerup', 'click', 'dblclick'].forEach(eventName => { [true, false].forEach(clickChildElement => { for (const target of targetparent.children) { promise_test(async () => { @@ -39,7 +39,18 @@ let targetchild = target.firstElementChild; targetchild.addEventListener(eventName, () => childReceivedEvent = true); - await test_driver.click(clickChildElement ? targetchild : target); + const elementToClick = clickChildElement ? targetchild : target; + if (eventName === 'dblclick') { + await (new test_driver.Actions() + .pointerMove(1, 1, {origin: elementToClick}) + .pointerDown() + .pointerUp() + .pointerDown() + .pointerUp()) + .send(); + } else { + await test_driver.click(elementToClick); + } const parentShouldReceiveEvents = eventName.startsWith('pointer'); assert_equals(parentReceivedEvent, parentShouldReceiveEvents,