summaryrefslogtreecommitdiffstats
path: root/editor/reftests/xul
diff options
context:
space:
mode:
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.css36
-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, 111 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..91d6a55946
--- /dev/null
+++ b/editor/reftests/xul/input.css
@@ -0,0 +1,36 @@
+@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;
+}
+
+@media (-moz-windows-default-theme) and (-moz-os-version: windows-win7) {
+ :root:not(.winxp) html|input.empty {
+ font-style: italic;
+ }
+}
+
+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