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/html/rendering/replaced-elements/embedded-content-rendering-rules | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.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/html/rendering/replaced-elements/embedded-content-rendering-rules')
11 files changed, 161 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-controls-001.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-controls-001.html new file mode 100644 index 0000000000..eeb4368aaa --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-controls-001.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<title>HTML audio with controls</title> +<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#embedded-content-rendering-rules"> +<link rel="mismatch" href="/common/blank.html"> + +<audio controls></audio> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-controls-002.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-controls-002.html new file mode 100644 index 0000000000..678ba7281e --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-controls-002.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<title>HTML audio with controls via Web APIs</title> +<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#embedded-content-rendering-rules"> +<link rel="mismatch" href="/common/blank.html"> + +<audio id="target"></audio> + +<script> + document.body.offsetTop; + document.getElementById("target").setAttribute("controls", ""); +</script> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-without-controls.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-without-controls.html new file mode 100644 index 0000000000..8cc134d6d6 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/audio-without-controls.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<title>HTML audio without controls</title> +<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#embedded-content-rendering-rules"> +<link rel="match" href="../../../../css/reference/ref-filled-green-100px-square.xht" /> + +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + +<div style="width: 100px; height: 100px; background: green;"> + <audio style="display: block; width: 100px; height: 100px; background: red;"></audio> +</div> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html new file mode 100644 index 0000000000..9077591f46 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback-ref.html @@ -0,0 +1,4 @@ +<!doctype html> +<meta charset=utf-8> +<title>Canvas fallback content</title> +<p>The word "FAIL" should not be visible below this line. diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html new file mode 100644 index 0000000000..01df0c547a --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html @@ -0,0 +1,26 @@ +<!doctype html> +<meta charset=utf-8> +<title>Canvas fallback content</title> +<link rel=match href=canvas-fallback-ref.html> +<style> +canvas { + height: 2em; /* avoid causing scrollbar for 600x600 viewport */ +} + +#canvas2 { + display: inline; +} + +#canvas3 { + display: block; +} + +#canvas4 { + display: table; +} +</style> +<p>The word "FAIL" should not be visible below this line. +<p><canvas id=canvas1>FAIL</canvas> +<p><canvas id=canvas2>FAIL</canvas> +<p><canvas id=canvas3>FAIL</canvas> +<p><canvas id=canvas4>FAIL</canvas> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-update-with-border-object-fit-ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-update-with-border-object-fit-ref.html new file mode 100644 index 0000000000..3133ac86f3 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-update-with-border-object-fit-ref.html @@ -0,0 +1,4 @@ +<!doctype html> +<div style="width: 200px; height: 100px; background: black; border: 100px solid blue; padding-left: 100px"> + <div style="width: 100px; height: 100px; background: green"></div> +</div> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-update-with-border-object-fit.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-update-with-border-object-fit.html new file mode 100644 index 0000000000..b20db66eb9 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-update-with-border-object-fit.html @@ -0,0 +1,31 @@ +<!doctype html> +<title>Verifies canvas with object-fit and border correctly updates</title> +<link rel="match" href="canvas-update-with-border-object-fit-ref.html"> +<html class="reftest-wait"> + <div style="width: 300px; height: 100px; background: black; border: 100px solid blue"> + <canvas id="target" width="1000" height="1000" + style="object-fit: contain; object-position: center; width: 100%; height: 100%"> + </canvas> + </div> +</html> +<script> +var ctx = target.getContext("2d"); +ctx.fillStyle = "red"; +ctx.fillRect(0, 0, target.width, target.height); + +var x=0, y=0, step=500; +ctx.fillStyle = "green"; +function drawRect() { + ctx.fillRect(x, y, step, step); + x += step; + if (x >= target.width) { + x = 0; + y += step; + } + if (y >= target.height) + document.documentElement.classList.remove("reftest-wait"); + else + requestAnimationFrame(drawRect); +} +drawRect(); +</script> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html new file mode 100644 index 0000000000..cdc4647534 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html @@ -0,0 +1,23 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Verify that canvases are scaled up to their computed size</title> +<link rel="match" href="canvas_scale_ref.html"> +<style> +canvas { + width: 20px; + height: 20px; +} +div { + line-height: 0; +} +</style> +<div><canvas width="16" height="16" data-color="#FF00FF"></canvas><canvas width="16" height="16" data-color="#00FF00"></canvas></div> +<div><canvas width="16" height="16" data-color="#0000FF"></canvas><canvas width="16" height="16" data-color="#FF00FF"></canvas></div> +<script> +var canvases = document.getElementsByTagName('canvas'); +for (var i = 0; i < canvases.length; i++) { + var ctx = canvases[i].getContext('2d'); + ctx.fillStyle = canvases[i].getAttribute('data-color'); + ctx.fillRect(0, 0, 16, 16); +} +</script> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html new file mode 100644 index 0000000000..2d1756f856 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html @@ -0,0 +1,14 @@ +<!doctype html> +<meta charset="utf-8"> +<style> +span { + display: inline-block; + width: 20px; + height: 20px; +} +div { + line-height: 0; +} +</style> +<div><span style="background-color: #FF00FF"></span><span style="background-color: #00FF00"></span></div> +<div><span style="background-color: #0000FF"></span><span style="background-color: #FF00FF"></span></div> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html new file mode 100644 index 0000000000..b7398f8d59 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_a.html @@ -0,0 +1,15 @@ +<!doctype html> +<meta charset="utf-8"> +<link rel="match" href="canvas_without_context_ref.html"> +<style> + div { + background-color: green; + width: 20px; + height: 20px; + } +</style> +</head> +<body> +<div><canvas width="20" height="20"></canvas></div> +</body> +</html> diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html new file mode 100644 index 0000000000..ae0c9c8c8e --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_without_context_ref.html @@ -0,0 +1,14 @@ +<html> +<head> +<style> + div { + background-color: green; + width: 20px; + height: 20px; + } +</style> +</head> +<body> +<div></div> +</body> +</html> |