diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /editor/reftests/xul | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'editor/reftests/xul')
-rw-r--r-- | editor/reftests/xul/empty-ref.xhtml | 13 | ||||
-rw-r--r-- | editor/reftests/xul/emptytextbox-4.xhtml | 12 | ||||
-rw-r--r-- | editor/reftests/xul/emptytextbox-ref.xhtml | 13 | ||||
-rw-r--r-- | editor/reftests/xul/input.css | 36 | ||||
-rw-r--r-- | editor/reftests/xul/placeholder-reset.css | 8 | ||||
-rw-r--r-- | editor/reftests/xul/platform.js | 28 | ||||
-rw-r--r-- | editor/reftests/xul/reftest.list | 1 |
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..17432527b2 --- /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-platform: 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 |