Last change
on this file since 286776 was 286776, checked in by Manuel Rego Casasnovas, 3 years ago |
[selectors] Match :focus-visible on <select> elements
https://bugs.webkit.org/show_bug.cgi?id=233924
Reviewed by Antti Koivisto.
Source/WebCore:
Test: fast/forms/select-listbox-focusring.html
(WebCore::shouldAlwaysHaveFocusVisibleWhenFocused):
LayoutTests:
- fast/forms/select-listbox-focusring-expected.html: Added.
- fast/forms/select-listbox-focusring.html: Added.
|
File size:
768 bytes
|
Line | |
---|
1 | <!DOCTYPE html>
|
---|
2 | <p>This test checks that focusing a SELECT element via mouse click, after focusing a previous element via mouse click, the SELECT element shows a focus ring.</p>
|
---|
3 | <p id="instructions"></p>
|
---|
4 | <input id="input">
|
---|
5 | <select id="select">
|
---|
6 | <option>a</option>
|
---|
7 | <option>b</option>
|
---|
8 | </select>
|
---|
9 |
|
---|
10 | <script>
|
---|
11 | function clickElement(element) {
|
---|
12 | if (window.eventSender) {
|
---|
13 | eventSender.mouseMoveTo(element.offsetLeft + 5, element.offsetTop + 5);
|
---|
14 | eventSender.mouseDown();
|
---|
15 | eventSender.mouseUp();
|
---|
16 | else {
|
---|
17 | instructions.innerHTML = "Click on the element " + element.tagName;
|
---|
18 | }
|
---|
19 | }
|
---|
20 |
|
---|
21 | target.addEventListener("focus", () => {
|
---|
22 | clickElement(select);
|
---|
23 | });
|
---|
24 | clickElement(target);
|
---|
25 | </script>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.