summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/redirects/subresource-fragments.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/fetch/redirects/subresource-fragments.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fetch/redirects/subresource-fragments.html')
-rw-r--r--testing/web-platform/tests/fetch/redirects/subresource-fragments.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/redirects/subresource-fragments.html b/testing/web-platform/tests/fetch/redirects/subresource-fragments.html
new file mode 100644
index 0000000000..0bd74d7bfb
--- /dev/null
+++ b/testing/web-platform/tests/fetch/redirects/subresource-fragments.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Subresources and fragment preservation</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/html/canvas/resources/canvas-tests.js></script>
+<div id=log></div>
+<!--
+ The source image is 50h x 100w and its color depends on the fragment.
+
+ This image is then drawn on a 50h x 100w transparent black canvas.
+-->
+<img data-desc="Control"
+ src="/images/colors.svg#green">
+<img data-desc="Redirect with the original URL containing a fragment"
+ src="../api/resources/redirect.py?simple&location=/images/colors.svg#green">
+<img data-desc="Redirect with the response Location header containing a fragment"
+ src="../api/resources/redirect.py?simple&location=/images/colors.svg%23green">
+<img data-desc="Redirect with both the original URL and response Location header containing a fragment"
+ src="../api/resources/redirect.py?simple&location=/images/colors.svg%23green#red">
+<canvas width=100 height=50></canvas>
+<script>
+setup({ explicit_done:true });
+onload = () => {
+ const canvas = document.querySelector("canvas");
+ const ctx = canvas.getContext("2d");
+ document.querySelectorAll("img").forEach(img => {
+ test(t => {
+ t.add_cleanup(() => {
+ ctx.clearRect(0, 0, 100, 50);
+ });
+ ctx.drawImage(img, 0, 0);
+ // canvas, pixelX, pixelY, r, g, b, alpha, ?, ?, tolerance
+ _assertPixelApprox(canvas, 40, 40, 0, 255, 0, 255, 4);
+ }, img.dataset.desc);
+ });
+ done();
+};
+</script>