Skip to content

Commit

Permalink
c-v: auto descendant in dialog is shown on showModal (#40973)
Browse files Browse the repository at this point in the history
Verify that content-visibility: auto descendant in dialog is shown on showModal.

Also rename the previous equivalent test that was testing popover instead of dialog.
  • Loading branch information
rwlbuis authored Jul 11, 2023
1 parent 0b9e87d commit 8a83133
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf8">
<title>CSS Content Visibility: content-visibility: auto descendant in popover is shown on showPopover"</title>
<meta name="assert" content="content-visibility: auto descendant in popover is shown on showPopover">

<div id="spacer" style="height: 100vh"></div>
<div popover="manual" style="display: block; position: static;" id="popover">
<span>Test passes if this is visible</span>
</div>

<script>
popover.showPopover();
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html class="reftest-wait">
<meta charset="utf8">
<title>CSS Content Visibility: content-visibility: auto descendant in popover is shown on showPopover</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="content-visibility-with-popover-top-layer-and-auto-descendant-ref.html">
<meta name="assert" content="content-visibility: auto descendant in popover is shown on showPopover">
<script src="/common/reftest-wait.js"></script>

<style>
#inner {
content-visibility: auto;
contain-intrinsic-size: 100px 100px;
}
</style>

<div id="spacer" style="height: 100vh"></div>
<div popover="manual" style="display: block; position: static;" id="popover">
<span id="inner">Test passes if this is visible</span>
</div>

<script>
function runTest() {
popover.showPopover();
requestAnimationFrame(takeScreenshot);
}

window.onload = runTest;
</script>
</html>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<meta charset="utf8">
<title>CSS Content Visibility: content-visibility: auto descendant in popover is shown on showPopover"</title>
<meta name="assert" content="content-visibility: auto descendant in popover is shown on showPopover">
<title>CSS Content Visibility: content-visibility: auto descendant in dialog is shown on showModal"</title>
<meta name="assert" content="content-visibility: auto descendant in dialog is shown on showModal">

<div id="spacer" style="height: 100vh"></div>
<div popover="manual" style="display: block; position: static;" id="popover">
<dialog id="dialog" style="display: block; position: static;">
<span>Test passes if this is visible</span>
</div>
</dialog>

<script>
popover.showPopover();
dialog.showModal();
</script>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!doctype html>
<html class="reftest-wait">
<meta charset="utf8">
<title>CSS Content Visibility: content-visibility: auto descendant in popover is shown on showPopover</title>
<title>CSS Content Visibility: content-visibility: auto descendant in dialog is shown on showModal</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="content-visibility-with-top-layer-and-auto-descendant-ref.html">
<meta name="assert" content="content-visibility: auto descendant in popover is shown on showPopover">
<meta name="assert" content="content-visibility: auto descendant in dialog is shown on showModal">
<script src="/common/reftest-wait.js"></script>

<style>
Expand All @@ -16,13 +16,13 @@
</style>

<div id="spacer" style="height: 100vh"></div>
<div popover="manual" style="display: block; position: static;" id="popover">
<dialog id="dialog" style="display: block; position: static;">
<span id="inner">Test passes if this is visible</span>
</div>
</dialog>

<script>
function runTest() {
popover.showPopover();
dialog.showModal();
requestAnimationFrame(takeScreenshot);
}

Expand Down

0 comments on commit 8a83133

Please sign in to comment.