Skip to content

Add tests for legacy-activation-behaviors#25020

Merged
domenic merged 3 commits intomasterfrom
input-disabled-2
Aug 17, 2020
Merged

Add tests for legacy-activation-behaviors#25020
domenic merged 3 commits intomasterfrom
input-disabled-2

Conversation

@saschanaz
Copy link
Member

Corresponds to whatwg/html#5827

ev.preventDefault();
input.dispatchEvent(ev);
setTimeout(t.step_func_done(() => assert_false(input.checked)));
}, `disabled checkbox should get legacy-canceled-activation behavior 2`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on Firefox but passes when input.onclick = () => {} is added. The spec does not require such thing, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Nice find.

input.onclick = t.step_func(ev => {
assert_true(input.checked);
ev.preventDefault();
setTimeout(t.step_func_done(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think lint will fail on setTimeout usage. queueMicrotask() should suffice, right? Otherwise t.step_timeout() would work.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-25020 August 14, 2020 20:51 Inactive
@domenic domenic merged commit a7a7d48 into master Aug 17, 2020
@domenic domenic deleted the input-disabled-2 branch August 17, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants