Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/interestfor/interestfor-pseudo-element-popover-anchor.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="interestfor-pseudo-element-popover-anchor-ref.html">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/invoker-utils.js"></script>
<div id=container>
<button interestfor=target>Button</button>
</div>
<div id=target popover></div>
<style>
* {
margin: 0;
padding: 0;
border: none;
}
#container {
position: absolute;
left: 50px;
top: 50px;
}
button {
width: 100px;
height: 50px;
interest-delay: 1000s;
}
::interest-button, #target {
width: 50px;
height: 50px;
}
::interest-button {
content: "";
position: absolute;
left: 250px;
top: 0;
background: green;
}
#target {
/* The implicit anchor should be the ::interest-button. */
position-anchor: auto;
position-area: bottom;
background: blue;
}
</style>
<script>
(async () => {
await waitForRender();
// Tap the ::interest-button.
const rect = container.getBoundingClientRect();
await new test_driver.Actions()
.addPointer("touchPointer", "touch")
.pointerMove(Math.round(rect.x + 275), Math.round(rect.y + 25), {})
.pointerDown()
.pointerUp()
.send();
await waitForRender();
document.documentElement.classList.remove('reftest-wait');
})();
</script>