summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-grid/support
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /layout/reftests/css-grid/support
parentInitial commit. (diff)
downloadfirefox-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 'layout/reftests/css-grid/support')
-rw-r--r--layout/reftests/css-grid/support/ahem.css4
-rw-r--r--layout/reftests/css-grid/support/colors-16x8.webmbin0 -> 397 bytes
-rw-r--r--layout/reftests/css-grid/support/dyn.js127
-rw-r--r--layout/reftests/css-grid/support/lime-24x2.pngbin0 -> 96 bytes
-rw-r--r--layout/reftests/css-grid/support/lime-25x1.pngbin0 -> 3676 bytes
-rw-r--r--layout/reftests/css-grid/support/lime-2x24.pngbin0 -> 98 bytes
-rw-r--r--layout/reftests/css-grid/support/solidblue-20x32.pngbin0 -> 100 bytes
-rw-r--r--layout/reftests/css-grid/support/solidblue.pngbin0 -> 135 bytes
8 files changed, 131 insertions, 0 deletions
diff --git a/layout/reftests/css-grid/support/ahem.css b/layout/reftests/css-grid/support/ahem.css
new file mode 100644
index 0000000000..5cea74d04f
--- /dev/null
+++ b/layout/reftests/css-grid/support/ahem.css
@@ -0,0 +1,4 @@
+@font-face {
+ font-family: "Ahem";
+ src: url(../../fonts/Ahem.ttf);
+}
diff --git a/layout/reftests/css-grid/support/colors-16x8.webm b/layout/reftests/css-grid/support/colors-16x8.webm
new file mode 100644
index 0000000000..701341fc2a
--- /dev/null
+++ b/layout/reftests/css-grid/support/colors-16x8.webm
Binary files differ
diff --git a/layout/reftests/css-grid/support/dyn.js b/layout/reftests/css-grid/support/dyn.js
new file mode 100644
index 0000000000..816a6f9b61
--- /dev/null
+++ b/layout/reftests/css-grid/support/dyn.js
@@ -0,0 +1,127 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
+ * vim: sw=2 ts=2 sts=2 et filetype=javascript
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+function loadURL(url,callback) {
+ var xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (xhttp.readyState == 4 && xhttp.status == 200) {
+ callback(xhttp.responseText);
+ }
+ };
+ xhttp.open("GET", url, true);
+ xhttp.send();
+}
+
+function dyn1(selector) {
+ // get an array of elements matching |selector|
+ var elems = Array.prototype.slice.call(document.querySelectorAll(selector))
+
+ // remove the first item in each grid
+ var removed = elems.map(function(e) {
+ var child = e.children[0];
+ if (child) {
+ var next = child.nextSibling;
+ e.removeChild(child);
+ return [ e, child, next ];
+ } else {
+ return null;
+ }
+ });
+
+ document.body.style.display = 'block';
+ document.body.offsetHeight;
+
+ // insert the removed item
+ removed.map(function(a) {
+ if (a) {
+ a[0].insertBefore(a[1],a[2]);
+ }
+ });
+}
+
+function dyn2(selector) {
+ // get an array of elements matching |selector|
+ var elems = Array.prototype.slice.call(document.querySelectorAll(selector))
+
+ // inject a new first item in each grid
+ var inserted = elems.map(function(e) {
+ var child = document.createElement('span');
+ e.insertBefore(child, e.firstChild);
+ return [ e, child ];
+ });
+
+ document.body.style.display = 'block';
+ document.body.offsetHeight;
+
+ // remove the inserted item
+ inserted.map(function(a) {
+ a[0].removeChild(a[1]);
+ });
+}
+
+function dyn3(selector) {
+ // get an array of elements matching |selector|
+ var elems = Array.prototype.slice.call(document.querySelectorAll(selector))
+
+ // remove the second item in each grid
+ var removed = elems.map(function(e) {
+ var child = e.children[1];
+ if (child) {
+ var next = child.nextSibling;
+ e.removeChild(child);
+ return [ e, child, next ];
+ } else {
+ return null;
+ }
+ });
+
+ document.body.style.display = 'block';
+ document.body.offsetHeight;
+
+ // insert the removed items
+ removed.map(function(a) {
+ if (a) {
+ a[0].insertBefore(a[1],a[2]);
+ }
+ });
+}
+
+function dyn4(selector) {
+ dyn3(selector);
+ dyn2(selector);
+}
+
+function dyn5(selector) {
+ // get an array of elements matching |selector|
+ var elems = Array.prototype.slice.call(document.querySelectorAll(selector))
+
+ // inject 20 new items in each grid
+ var inserted = elems.map(function(e) {
+ var a = new Array;
+ for (var i = 0; i < 20; ++i) {
+ var child = document.createElement('span');
+ e.insertBefore(child, e.firstChild);
+ a.push(child);
+ }
+ return [ e, a ];
+ });
+
+ document.body.style.display = 'block';
+ document.body.offsetHeight;
+
+ // remove the inserted item
+ inserted.map(function(a) {
+ a[1].forEach(function(child) {
+ a[0].removeChild(child);
+ });
+ });
+}
+
+function dynamicTest(url, callback) {
+ document.body.style.display='';
+ document.body.offsetHeight;
+ loadURL(url,callback);
+}
diff --git a/layout/reftests/css-grid/support/lime-24x2.png b/layout/reftests/css-grid/support/lime-24x2.png
new file mode 100644
index 0000000000..b9ce5e2461
--- /dev/null
+++ b/layout/reftests/css-grid/support/lime-24x2.png
Binary files differ
diff --git a/layout/reftests/css-grid/support/lime-25x1.png b/layout/reftests/css-grid/support/lime-25x1.png
new file mode 100644
index 0000000000..31e1c4087a
--- /dev/null
+++ b/layout/reftests/css-grid/support/lime-25x1.png
Binary files differ
diff --git a/layout/reftests/css-grid/support/lime-2x24.png b/layout/reftests/css-grid/support/lime-2x24.png
new file mode 100644
index 0000000000..a1524d46b4
--- /dev/null
+++ b/layout/reftests/css-grid/support/lime-2x24.png
Binary files differ
diff --git a/layout/reftests/css-grid/support/solidblue-20x32.png b/layout/reftests/css-grid/support/solidblue-20x32.png
new file mode 100644
index 0000000000..bba5504d98
--- /dev/null
+++ b/layout/reftests/css-grid/support/solidblue-20x32.png
Binary files differ
diff --git a/layout/reftests/css-grid/support/solidblue.png b/layout/reftests/css-grid/support/solidblue.png
new file mode 100644
index 0000000000..a64b6a4255
--- /dev/null
+++ b/layout/reftests/css-grid/support/solidblue.png
Binary files differ