diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-contain/content-visibility/resources | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-contain/content-visibility/resources')
5 files changed, 117 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/resources/circles.svg b/testing/web-platform/tests/css/css-contain/content-visibility/resources/circles.svg new file mode 100644 index 0000000000..1a9ad7534d --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/content-visibility/resources/circles.svg @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="iso-8859-1" ?> +<svg viewBox="0 0 500 300" xmlns="http://www.w3.org/2000/svg"> +<rect x="0" y="0" width="500" height="300" fill="#fff" /> + +<g stroke-width="10" transform="translate(-30)"> + <circle cx="80" cy="50" r="35" fill="#084" stroke="none"/> + <circle cx="80" cy="50" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="120" r="35" fill="#004" stroke="none"/> + <circle cx="80" cy="120" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="190" r="35" fill="#088" stroke="none"/> + <circle cx="80" cy="190" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="260" r="35" fill="#008" stroke="none"/> + <circle cx="80" cy="260" r="20" fill="#080" stroke="#FF0"/> +</g> + +<g stroke-width="10" transform="translate(170)"> + <circle cx="80" cy="50" r="35" fill="#085" stroke="none"/> + <circle cx="80" cy="50" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="120" r="35" fill="#005" stroke="none"/> + <circle cx="80" cy="120" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="190" r="35" fill="#689" stroke="none"/> + <circle cx="80" cy="190" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="260" r="35" fill="#609" stroke="none"/> + <circle cx="80" cy="260" r="20" fill="#080" stroke="#FF0"/> +</g> + +<g stroke-width="10" transform="translate(370)"> + <circle cx="80" cy="50" r="35" fill="#084" stroke="none"/> + <circle cx="80" cy="50" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="120" r="35" fill="#084" stroke="none"/> + <circle cx="80" cy="120" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="190" r="35" fill="#088" stroke="none"/> + <circle cx="80" cy="190" r="20" fill="#080" stroke="#FF0"/> + <circle cx="80" cy="260" r="35" fill="#088" stroke="none"/> + <circle cx="80" cy="260" r="20" fill="#080" stroke="#FF0"/> +</g> +</svg> diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/resources/dice.png b/testing/web-platform/tests/css/css-contain/content-visibility/resources/dice.png Binary files differnew file mode 100644 index 0000000000..f18b814176 --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/content-visibility/resources/dice.png diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/resources/frame.html b/testing/web-platform/tests/css/css-contain/content-visibility/resources/frame.html new file mode 100644 index 0000000000..14f48b99a8 --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/content-visibility/resources/frame.html @@ -0,0 +1,8 @@ +<!doctype HTML> +<style> +div { + background: lightgreen; +} +</style> +<div>dolor sit amet</div> + diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/resources/slot-content-visibility.html b/testing/web-platform/tests/css/css-contain/content-visibility/resources/slot-content-visibility.html new file mode 100644 index 0000000000..8652f91ded --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/content-visibility/resources/slot-content-visibility.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> + +> +<div> + <template shadowroot=open> + <slot style="content-visibility: hidden; display: block"></slot> + </template> + a diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/resources/text-fragment-target-auto.html b/testing/web-platform/tests/css/css-contain/content-visibility/resources/text-fragment-target-auto.html new file mode 100644 index 0000000000..53a22f5fd8 --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/content-visibility/resources/text-fragment-target-auto.html @@ -0,0 +1,64 @@ +<!doctype html> +<title>Text fragment navigation helper.</title> + +<script src="/scroll-to-text-fragment/stash.js"></script> +<script> +function isInView(element) { + let rect = element.getBoundingClientRect(); + return rect.top >= 0 && rect.top <= window.innerHeight + && rect.left >= 0 && rect.left <= window.innerWidth; +} +function checkScroll() { + let position = 'unknown'; + if (window.scrollY == 0) + position = 'top'; + else if(isInView(document.getElementById("text"))) + position = 'text'; + else if(isInView(document.getElementById("text2"))) + position = 'text2'; + else if(isInView(document.getElementById("text3"))) + position = 'text3'; + + const target = document.querySelector(":target"); + let results = { + scrollPosition: position, + href: window.location.href, + target: target ? target.id : 'undefined' + }; + let key = (new URL(document.location)).searchParams.get("key"); + stashResultsThenClose(key, results); +} +function doubleRafCheckScroll() { + requestAnimationFrame(() => { + requestAnimationFrame(() => { + checkScroll(); + }); + }); +} +</script> + +<style> +.spacer { + height: 10000px; +} +.auto { + content-visibility: auto; +} +</style> + +<body onload="doubleRafCheckScroll()"> +<div class=spacer></div> +<div class=auto> + <div id=text>hiddentext</div> +</div> +<div class=spacer></div> +<div id=text2and3ancestor> + <div class=auto> + <div id=text2>start</div> + </div> + <div class=spacer></div> + <div class=auto> + <div id=text3>end</div> + </div> +</div> +</body> |