From 5e4f1d2b122a443c1ef2e01f0898e2d3aaae2b6a Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 1 Jan 2025 01:15:41 +0000 Subject: [PATCH] Bug 1937180 [wpt PR 49684] - Make customizable select options listen to mouseup, a=testonly Automatic update from web-platform-tests Make customizable select options listen to mouseup mouseup is better than mousedown because it allows the user to click and drag to choose an option like appearance:auto already does. More justification here: https://github.com/whatwg/html/issues/10762#issuecomment-2524122892 Change-Id: Ifa63d497b7dcfbc3d07e19d6a7850bddf57f78fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6077672 Commit-Queue: Joey Arhar Reviewed-by: Traian Captan Cr-Commit-Position: refs/heads/main{#1396126} -- wpt-commits: 0c1d19546fd4873bb9f4147f0bbf868e7b4f91b7 wpt-pr: 49684 UltraBlame original commit: 67679d9657af23ee3aa91fe6adc71e254e62fa41 --- .../select-events.tentative.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-events.tentative.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-events.tentative.html index fcf53233f18d..a1f98bc05301 100644 --- a/testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-events.tentative.html +++ b/testing/web-platform/tests/html/semantics/forms/the-select-element/customizable-select/select-events.tentative.html @@ -142,14 +142,18 @@ eventList = []; // Click on an option, with preventDefault - wrapper.addEventListener('click',(e) => e.preventDefault(),{once:true}); + wrapper.addEventListener('mouseup',(e) => e.preventDefault(),{once:true}); assert_equals(select.selectedOptions[0].innerText,'two'); await test_driver.click(option1); assert_true(select.matches(':open'),'click should be cancelled'); assert_events([ 'pointerdown on option1 at select', 'pointerdown on option1 at wrapper', 'mousedown on option1 at select', 'mousedown on option1 at wrapper', - 'click on option1 at select', 'click on option1 at wrapper', + 'focusout on option2 at select', 'focusout on option2 at wrapper', + 'focusin on select at select', 'focusin on select at wrapper', + 'pointerup on option1 at select', 'pointerup on option1 at wrapper', + 'mouseup on option1 at select', 'mouseup on option1 at wrapper', + 'click on option1 at select', 'click on option1 at wrapper' ],'click option, with preventDefault'); // Click on an option, no preventDefault @@ -159,11 +163,11 @@ assert_events([ 'pointerdown on option1 at select', 'pointerdown on option1 at wrapper', 'mousedown on option1 at select', 'mousedown on option1 at wrapper', - 'click on option1 at select', 'click on option1 at wrapper', + 'pointerup on option1 at select', 'pointerup on option1 at wrapper', + 'mouseup on option1 at select', 'mouseup on option1 at wrapper', 'input on select at select', 'input on select at wrapper', 'change on select at select', 'change on select at wrapper', - 'focusout on option2 at select', 'focusout on option2 at wrapper', - 'focusin on select at select', 'focusin on select at wrapper' + 'click on option1 at select', 'click on option1 at wrapper' ],'click option, no preventDefault'); },`Events, ${wrapper.dataset.description}`); });