Skip to content

Commit

Permalink
Fix a bug in this test that the host wasn't getting focused. (#35257)
Browse files Browse the repository at this point in the history
HTML defines steps to run when an element is inserted into a document (i.e. document tree),
not anytime an element is connected to a document:
https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute
  • Loading branch information
rniwa authored Jul 28, 2022
1 parent 9b0f089 commit c86f08b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions css/selectors/focus-visible-020.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
test_valid_selector(':focus-visible');

async_test((t) => {
host.focus();
window.requestAnimationFrame(t.step_func_done(() => {
assert_not_equals(getComputedStyle(host).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${host.tagName}#${host.id} should NOT be red`);

Expand Down

0 comments on commit c86f08b

Please sign in to comment.