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 <jarharchromium.org>
Reviewed-by: Mason Freed <masonfchromium.org>
Cr-Commit-Position: refs/heads/main{#1225838}

--

wpt-commits: dd5d55c3debd577a09921b32f3816797664c5e86
wpt-pr: 42976

UltraBlame original commit: 3bf4c6228d9c37fc63955610b37cb0bf6d5dff3d
  • Loading branch information
marco-c committed Nov 30, 2023
1 parent 29ee619 commit 9547336
Showing 1 changed file with 13 additions and 2 deletions.
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 9547336

Please sign in to comment.