summaryrefslogtreecommitdiffstats
path: root/editor/reftests/xul
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 /editor/reftests/xul
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 'editor/reftests/xul')
-rw-r--r--editor/reftests/xul/empty-ref.xhtml13
-rw-r--r--editor/reftests/xul/emptytextbox-4.xhtml12
-rw-r--r--editor/reftests/xul/emptytextbox-ref.xhtml13
-rw-r--r--editor/reftests/xul/input.css30
-rw-r--r--editor/reftests/xul/placeholder-reset.css8
-rw-r--r--editor/reftests/xul/platform.js28
-rw-r--r--editor/reftests/xul/reftest.list1
7 files changed, 105 insertions, 0 deletions
diff --git a/editor/reftests/xul/empty-ref.xhtml b/editor/reftests/xul/empty-ref.xhtml
new file mode 100644
index 0000000000..b5700fc158
--- /dev/null
+++ b/editor/reftests/xul/empty-ref.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="resource://reftest/input.css" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ title="Textbox tests">
+
+ <script type="text/javascript" src="platform.js"/>
+
+ <html:input class="empty" value=" test"/>
+
+</window>
diff --git a/editor/reftests/xul/emptytextbox-4.xhtml b/editor/reftests/xul/emptytextbox-4.xhtml
new file mode 100644
index 0000000000..90ba9a004b
--- /dev/null
+++ b/editor/reftests/xul/emptytextbox-4.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ title="Textbox tests">
+
+ <script type="text/javascript" src="platform.js"/>
+
+ <search-textbox/>
+
+</window>
diff --git a/editor/reftests/xul/emptytextbox-ref.xhtml b/editor/reftests/xul/emptytextbox-ref.xhtml
new file mode 100644
index 0000000000..eb48d52d79
--- /dev/null
+++ b/editor/reftests/xul/emptytextbox-ref.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="resource://reftest/input.css" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ title="Textbox tests">
+
+ <script type="text/javascript" src="platform.js"/>
+
+ <html:input/>
+
+</window>
diff --git a/editor/reftests/xul/input.css b/editor/reftests/xul/input.css
new file mode 100644
index 0000000000..cec3f94d3b
--- /dev/null
+++ b/editor/reftests/xul/input.css
@@ -0,0 +1,30 @@
+@namespace url('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul');
+@namespace html url('http://www.w3.org/1999/xhtml');
+
+:root > html|input {
+ margin: 2px 4px;
+ padding: 2px 2px 3px;
+ padding-inline-start: 5px;
+}
+
+#mac > html|input {
+ margin: 4px;
+ padding: 0 1px;
+}
+
+html|input {
+ font: inherit;
+}
+
+html|input.empty {
+ color: graytext;
+}
+
+html|input.num {
+ text-align: end;
+}
+
+/* .textbox-input has 1px extra padding on Linux */
+#linux html|input.num {
+ padding-inline-end: 3px;
+}
diff --git a/editor/reftests/xul/placeholder-reset.css b/editor/reftests/xul/placeholder-reset.css
new file mode 100644
index 0000000000..a2c41e69b0
--- /dev/null
+++ b/editor/reftests/xul/placeholder-reset.css
@@ -0,0 +1,8 @@
+@namespace url('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul');
+@namespace html url('http://www.w3.org/1999/xhtml');
+
+/* We need to have a non-transparent placeholder so we can test it. */
+html|input::placeholder {
+ opacity: 1.0;
+ color: graytext;
+}
diff --git a/editor/reftests/xul/platform.js b/editor/reftests/xul/platform.js
new file mode 100644
index 0000000000..f45e6d1f5c
--- /dev/null
+++ b/editor/reftests/xul/platform.js
@@ -0,0 +1,28 @@
+// The appearance of XUL elements is platform-specific, so we set the
+// style of the root element according to the platform, so that the
+// CSS code inside input.css can select the correct styles for each
+// platform.
+
+var id;
+var ua = navigator.userAgent;
+
+if (/Windows/.test(ua)) {
+ id = "win";
+ if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua))
+ var classname = "winxp";
+}
+else if (/Linux/.test(ua))
+ id = "linux";
+else if (/SunOS/.test(ua))
+ id = "linux";
+else if (/Mac OS X/.test(ua))
+ id = "mac";
+
+if (id)
+ document.documentElement.setAttribute("id", id);
+else
+ document.documentElement.appendChild(
+ document.createTextNode("Unrecognized platform")
+ );
+if (classname)
+ document.documentElement.setAttribute("class", classname);
diff --git a/editor/reftests/xul/reftest.list b/editor/reftests/xul/reftest.list
new file mode 100644
index 0000000000..591ee8f6c7
--- /dev/null
+++ b/editor/reftests/xul/reftest.list
@@ -0,0 +1 @@
+!= chrome://reftest/content/editor/reftests/xul/emptytextbox-4.xhtml chrome://reftest/content/editor/reftests/xul/emptytextbox-ref.xhtml