Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove disabled condition from :active matching #32804

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
86 changes: 86 additions & 0 deletions html/semantics/selectors/pseudo-classes/active-disabled.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,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>