Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/the-button-element/interest-target/interesttarget-keyboard-invalidation.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8" />
<link rel="author" href="mailto:masonf@chromium.org">
<link rel=match href="interesttarget-keyboard-invalidation-ref.html">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<button id=b1 interesttarget=target>Button</button>
<button id=b2 interesttarget=target>Button</button>
<button id=b3 interesttarget=target>Button</button>
<button id=b4>Button</button>
<button id=b5>Button</button>
<div id=target>Target</div>
<style>
:has-interest {
background-color: purple;
}
:has-interest:has-partial-interest {
background-color: red;
}
:has-partial-interest + button {
background-color: green;
}
:root:has(:has-interest) #b5 {
background-color: green;
}
:target-of-interest:target-of-partial-interest {
background-color: yellow;
}
[interesttarget] {
interest-target-delay: 0s;
}
</style>
<script>
buttons = Array.from(document.querySelectorAll('[interesttarget]'));
async function runTest() {
for (const b of buttons) {
b.focus();
}
document.documentElement.classList.remove("reftest-wait");
}
runTest();
</script>