Skip to content

Commit

Permalink
Test to popover and postioned elements
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D201729

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1828898
gecko-commit: e3cd1999f1dac41420e53e819c582626fca67178
gecko-reviewers: emilio
  • Loading branch information
cathiechen authored and moz-wptsync-bot committed Feb 15, 2024
1 parent 57308ed commit c5e5bdb
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions html/semantics/popovers/popover-open-overflow-display-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel=help href="https://html.spec.whatwg.org/multipage/popover.html">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/popover-utils.js"></script>
<script>
async function checkStatus(p) {
p.showPopover();
await waitForRender();
assert_true(p.matches(":popover-open"));
p.hidePopover();
await waitForRender();
}
</script>

<div id=container style="overflow: hidden; position: absolute;">
<div popover="auto" id=p1 style="position: absolute; top: 100px;">Absolute popover inside absolute element</div>
</div>
<script>
promise_test(async () => {
await checkStatus(document.querySelector("#p1"));
}, "Absolute popover inside absolute element");
</script>

<div id=p2 popover="auto" style="overflow: hidden; position: absolute;">
<div style="position: absolute; top: 100px;">Absolute element inside absolute popover</div>
</div>
<script>
promise_test(async () => {
await checkStatus(document.querySelector("#p2"));
}, "Absolute element inside absolute popover");
</script>

<div id=container style="overflow: hidden; position: fixed;">
<div popover="auto" id=p3 style="position: fixed; top: 100px;">Fixed popover inside fixed element</div>
</div>
<script>
promise_test(async () => {
await checkStatus(document.querySelector("#p3"));
}, "Fixed popover inside fixed element");
</script>

<div id=p4 popover="auto" style="overflow: hidden; position: fixed;">
<div style="position: fixed; top: 100px;">Fixed element inside fixed popover</div>
</div>
<script>
promise_test(async () => {
await checkStatus(document.querySelector("#p4"));
}, "Fixed element inside fixed popover");
</script>

<div id=container style="overflow: hidden; position: fixed;">
<div popover="auto" id=p5 style="position: absolute; top: 100px;">Absolute popover inside fixed element</div>
</div>
<script>
promise_test(async () => {
await checkStatus(document.querySelector("#p5"));
}, "Absolute popover inside fixed element");
</script>

<div id=p6 popover="auto" style="overflow: hidden; position: absolute;">
<div style="position: fixed; top: 100px;">Fixed element inside absolute popover</div>
</div>
<script>
promise_test(async () => {
await checkStatus(document.querySelector("#p6"));
}, "Fixed element inside absolute popover");
</script>

0 comments on commit c5e5bdb

Please sign in to comment.