Skip to content

Commit

Permalink
Bug 1863364 [wpt PR 42976] - Don't fire dblclick on disabled form con…
Browse files Browse the repository at this point in the history
…trol 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:
whatwg/html#2368 (comment)

Change-Id: Ibc52585ce0704d8ba8467efc3462bd378d23fbae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5007308
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1225838}

--

wpt-commits: dd5d55c3debd577a09921b32f3816797664c5e86
wpt-pr: 42976
  • Loading branch information
josepharhar authored and moz-wptsync-bot committed Nov 22, 2023
1 parent 4bfbf3d commit fa6c8c6
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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,
Expand Down

0 comments on commit fa6c8c6

Please sign in to comment.