Skip to content

Commit 2d02f30

Browse files
josepharharmoz-wptsync-bot
authored andcommitted
Bug 1878207 [wpt PR 44370] - Always call superclass in HTMLLabelElement::DefaultEventHandler, a=testonly
Automatic update from web-platform-tests Always call superclass in HTMLLabelElement::DefaultEventHandler HTMLLabelElement::DefaultEventHandler does not currently call up to HTMLElement::DefaultEventHandler in many cases. This patch makes sure that HTMLLabelElement always calls up to HTMLElement, which makes <label>s in <button>s work. WebKit's HTMLLabelElement already does this in all branches of HTMLLabelElement::defaultEventHandler since 2017: WebKit/WebKit@fec9c1d WebKit/WebKit@b9bad31 Fixed: 1523168 Change-Id: Ib9d0a63befbb930b9595bcc89fb5955050c97b2f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5260750 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1257674} -- wpt-commits: 3c00d743109ae3d06e874e56dd9287f3ded06f44 wpt-pr: 44370
1 parent 4c1fd23 commit 2d02f30

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<link rel=author href="mailto:[email protected]">
3+
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1523168">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/resources/testdriver.js"></script>
7+
<script src="/resources/testdriver-vendor.js"></script>
8+
9+
<button popovertarget=mypopover>
10+
<label>label</label>
11+
</button>
12+
<div id=mypopover popover=auto>popover</div>
13+
14+
<script>
15+
promise_test(async() => {
16+
const label = document.querySelector('label');
17+
assert_false(mypopover.matches(':popover-open'),
18+
'Popover should be closed at the start of the test.');
19+
await test_driver.click(label);
20+
assert_true(mypopover.matches(':popover-open'),
21+
'The popover should be opened by clicking on the label.');
22+
}, 'Buttons with popovertarget should invoke targets even if there is a label in the button.');
23+
</script>

0 commit comments

Comments
 (0)