Source code

Revision control

Copy as Markdown

Other Tools

<!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: red;
}
:has-interest + button {
background-color: green;
}
:root:has(:has-interest) #b5 {
background-color: green;
}
[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>