-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
active-disabled.html
86 lines (67 loc) · 2.42 KB
/
active-disabled.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://github.com/whatwg/html/pull/7465">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<label id=buttonlabel for=disabledbutton>label for disabled button</label>
<button id=disabledbutton disabled>disabled</button>
<button id=buttonparent disabled>
<div id=buttonchild>child of disabled</div>
</button>
<input id=disabledinput disabled>
<textarea id=disabledtextarea disabled>disabled textarea</textarea>
<script>
promise_test(async () => {
await (new test_driver.Actions()
.pointerMove(2, 2, {origin: disabledbutton})
.pointerDown())
.send();
assert_true(disabledbutton.matches(':active'));
await (new test_driver.Actions()
.pointerUp())
.send();
}, 'Clicking on a disabled button should make it get the :active selector.');
promise_test(async () => {
await (new test_driver.Actions()
.pointerMove(2, 2, {origin: buttonlabel})
.pointerDown())
.send();
assert_true(disabledbutton.matches(':active'));
await (new test_driver.Actions()
.pointerUp())
.send();
}, 'Clicking the label for a disabled button should make the button get the :active selector.');
promise_test(async () => {
await (new test_driver.Actions()
.pointerMove(2, 2, {origin: buttonchild})
.pointerDown())
.send();
assert_true(buttonparent.matches(':active'));
await (new test_driver.Actions()
.pointerUp())
.send();
}, 'Clicking on a child of a disabled button should make the button get the :active selector.');
promise_test(async () => {
await (new test_driver.Actions()
.pointerMove(2, 2, {origin: disabledinput})
.pointerDown())
.send();
assert_true(disabledinput.matches(':active'));
await (new test_driver.Actions()
.pointerUp())
.send();
}, 'Clicking on a disabled input should make it get the :active selector.');
promise_test(async () => {
await (new test_driver.Actions()
.pointerMove(2, 2, {origin: disabledtextarea})
.pointerDown())
.send();
assert_true(disabledtextarea.matches(':active'));
await (new test_driver.Actions()
.pointerUp())
.send();
}, 'Clicking on a disabled textarea should make it get the :active selector.');
</script>