Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/popovers/popover-alignment-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<title>Tests that popover alignment responds to anchor positioning</title>
<link rel="match" href="popover-alignment-001-ref.html">
<link rel="author" href="mailto:tabatkins@google.com">
<style>
button {
border: solid blue 15px;
margin: 25px;
}
[popover] {
border: solid orange 10px;
}
</style>
Orange box should be centered on the screen.
<button popovertarget=p1></button>
<div id="p1" popover></div>
<script>
document.querySelector("[popover]").showPopover({ source: document.querySelector("button") });
document.documentElement.removeAttribute("class");
</script>