summaryrefslogtreecommitdiffstats
path: root/layout/reftests/forms/input/text
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/forms/input/text')
-rw-r--r--layout/reftests/forms/input/text/baseline-1-ref.html21
-rw-r--r--layout/reftests/forms/input/text/baseline-1.html31
-rw-r--r--layout/reftests/forms/input/text/bounds-1-ref.html11
-rw-r--r--layout/reftests/forms/input/text/bounds-1.html22
-rw-r--r--layout/reftests/forms/input/text/centering-1-ref.xul28
-rw-r--r--layout/reftests/forms/input/text/centering-1.xul39
-rw-r--r--layout/reftests/forms/input/text/dynamic-height-1-ref.xul9
-rw-r--r--layout/reftests/forms/input/text/dynamic-height-1.xul23
-rw-r--r--layout/reftests/forms/input/text/intrinsic-size-ref.html12
-rw-r--r--layout/reftests/forms/input/text/intrinsic-size.html12
-rw-r--r--layout/reftests/forms/input/text/line-height-0.5.html7
-rw-r--r--layout/reftests/forms/input/text/line-height-1.0.html7
-rw-r--r--layout/reftests/forms/input/text/line-height-1.5.html7
-rw-r--r--layout/reftests/forms/input/text/reftest-stylo.list16
-rw-r--r--layout/reftests/forms/input/text/reftest.list10
-rw-r--r--layout/reftests/forms/input/text/select-ref.html18
-rw-r--r--layout/reftests/forms/input/text/select.html21
-rw-r--r--layout/reftests/forms/input/text/size-1-ref.html3
-rw-r--r--layout/reftests/forms/input/text/size-1.html3
-rw-r--r--layout/reftests/forms/input/text/size-2-ref.html5
-rw-r--r--layout/reftests/forms/input/text/size-2.html5
21 files changed, 310 insertions, 0 deletions
diff --git a/layout/reftests/forms/input/text/baseline-1-ref.html b/layout/reftests/forms/input/text/baseline-1-ref.html
new file mode 100644
index 000000000..427911eb0
--- /dev/null
+++ b/layout/reftests/forms/input/text/baseline-1-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title>Text baseline positioning reference</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.ttf);
+ }
+ input {
+ font-family: "MarkA", sans-serif;
+ font-size: 32px;
+ }
+ </style>
+</head>
+<body>
+ <input size="2" value="AAAAAAAA">
+</body>
+</html>
diff --git a/layout/reftests/forms/input/text/baseline-1.html b/layout/reftests/forms/input/text/baseline-1.html
new file mode 100644
index 000000000..59e92018b
--- /dev/null
+++ b/layout/reftests/forms/input/text/baseline-1.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title>Text baseline positioning test</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <!--
+ The primary font MarkA has a small line height. The fallback font
+ (used for the character '1') will probably have a maximum ascent
+ greater than the ascent plus half leading of MarkA, but this
+ should not adversly affect the positioning of characters from the
+ primary font. Currently the maximum ascent of the fallback font
+ has no effect on the position, but if a future implementation
+ considers the fallback font in the position, this test may need to
+ be modified to accommodate.
+ -->
+ <style type="text/css">
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.ttf);
+ }
+ input {
+ font-family: "MarkA", sans-serif;
+ font-size: 32px;
+ }
+ </style>
+</head>
+<body>
+ <input size="2" value="AAAAAAAA1">
+</body>
+</html>
diff --git a/layout/reftests/forms/input/text/bounds-1-ref.html b/layout/reftests/forms/input/text/bounds-1-ref.html
new file mode 100644
index 000000000..14d39ba72
--- /dev/null
+++ b/layout/reftests/forms/input/text/bounds-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Reference for bug 806583 test</title>
+ <style>
+ body { background: blue }
+ </style>
+</head>
+<body>
+</body>
+</html>
diff --git a/layout/reftests/forms/input/text/bounds-1.html b/layout/reftests/forms/input/text/bounds-1.html
new file mode 100644
index 000000000..4af490dce
--- /dev/null
+++ b/layout/reftests/forms/input/text/bounds-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test for bug 806583</title>
+ <style>
+ body, div { background: blue }
+ div { position: fixed; }
+ </style>
+</head>
+<body>
+ <input id="input">
+ <div id="cover"/>
+ <script>
+var rect = document.getElementById("input").getBoundingClientRect();
+var cover = document.getElementById("cover");
+cover.style.left = rect.left + "px";
+cover.style.top = rect.top + "px";
+cover.style.width = rect.width + "px";
+cover.style.height = rect.height + "px";
+ </script>
+</body>
+</html>
diff --git a/layout/reftests/forms/input/text/centering-1-ref.xul b/layout/reftests/forms/input/text/centering-1-ref.xul
new file mode 100644
index 000000000..f1bf3e49c
--- /dev/null
+++ b/layout/reftests/forms/input/text/centering-1-ref.xul
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<window title="Text input text centering reference"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <html:style type="text/css">
+ @font-face {
+ font-family: "Ahem";
+ src: url(../fonts/Ahem.ttf);
+ }
+ hbox {
+ height: 128px;
+ background-color: white;
+ }
+ input {
+ height: 64px;
+ background-color: white;
+ border: none;
+ margin: 0px;
+ padding: 0px;
+ font-family: "Ahem", sans-serif;
+ font-size: 32px;
+ }
+ </html:style>
+
+ <hbox align="center">
+ <html:input value="Ahem"/>
+ </hbox>
+</window>
diff --git a/layout/reftests/forms/input/text/centering-1.xul b/layout/reftests/forms/input/text/centering-1.xul
new file mode 100644
index 000000000..dc72bda55
--- /dev/null
+++ b/layout/reftests/forms/input/text/centering-1.xul
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<window title="Text input text centering test"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <!--
+
+ There is no spec that says where text within an html text input element
+ should be placed, but some sort of centering reduces the likelihood or
+ extent of clipping.
+
+ This test uses a font where every character used has an ascent and
+ descent equal to typographical ascent of the font. This makes it
+ unlikely that using a different concept of centering will change the
+ results of this test.
+
+ -->
+ <html:style type="text/css">
+ @font-face {
+ font-family: "Ahem";
+ src: url(../fonts/Ahem.ttf);
+ }
+ hbox {
+ height: 128px;
+ background-color: white;
+ }
+ input {
+ background-color: white;
+ border: none;
+ margin: 0px;
+ padding: 0px;
+ font-family: "Ahem", sans-serif;
+ font-size: 32px;
+ }
+ </html:style>
+
+ <hbox align="stretch">
+ <html:input value="Ahem"/>
+ </hbox>
+</window>
diff --git a/layout/reftests/forms/input/text/dynamic-height-1-ref.xul b/layout/reftests/forms/input/text/dynamic-height-1-ref.xul
new file mode 100644
index 000000000..7b82803e0
--- /dev/null
+++ b/layout/reftests/forms/input/text/dynamic-height-1-ref.xul
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/"?>
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+ <hbox align="stretch">
+ <box style="height: 5em"/>
+ <html:input value="YO"/>
+ </hbox>
+</window>
diff --git a/layout/reftests/forms/input/text/dynamic-height-1.xul b/layout/reftests/forms/input/text/dynamic-height-1.xul
new file mode 100644
index 000000000..f95469f19
--- /dev/null
+++ b/layout/reftests/forms/input/text/dynamic-height-1.xul
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin/"?>
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ onload="onLoad();">
+ <script type="application/javascript">
+<![CDATA[
+ function onLoad()
+ {
+ var adjust = document.getElementById("adjust");
+ flush();
+ adjust.style.height = "5em";
+ }
+
+ function flush() { document.documentElement.getBoundingClientRect(); }
+
+]]>
+ </script>
+ <hbox align="stretch">
+ <box id="adjust"/>
+ <html:input id="input" value="YO"/>
+ </hbox>
+</window>
diff --git a/layout/reftests/forms/input/text/intrinsic-size-ref.html b/layout/reftests/forms/input/text/intrinsic-size-ref.html
new file mode 100644
index 000000000..2735336e3
--- /dev/null
+++ b/layout/reftests/forms/input/text/intrinsic-size-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Intrinsic Size Test Reference</title>
+ <style>input, textarea { border-radius:0; background:none; border:none; }</style>
+ </head>
+ <body>
+ <div>
+ <span style="border:2px solid black; padding-left:200px"><input style="background-color:transparent; border:none; font-family:monospace"/></span>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/forms/input/text/intrinsic-size.html b/layout/reftests/forms/input/text/intrinsic-size.html
new file mode 100644
index 000000000..ef5c3da83
--- /dev/null
+++ b/layout/reftests/forms/input/text/intrinsic-size.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Intrinsic Size Test</title>
+ <style>input, textarea { border-radius:0; background:none; border:none; }</style>
+ </head>
+ <body>
+ <div>
+ <span style="border:2px solid black"><input style="background-color:transparent; border:none; font-family:monospace; padding-left:201px"/></span>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/forms/input/text/line-height-0.5.html b/layout/reftests/forms/input/text/line-height-0.5.html
new file mode 100644
index 000000000..e60a5f3a8
--- /dev/null
+++ b/layout/reftests/forms/input/text/line-height-0.5.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style>
+
+input { line-height: 0.5 }
+
+</style>
+<input type="text" value="text input" size="20">
diff --git a/layout/reftests/forms/input/text/line-height-1.0.html b/layout/reftests/forms/input/text/line-height-1.0.html
new file mode 100644
index 000000000..52a0fde6c
--- /dev/null
+++ b/layout/reftests/forms/input/text/line-height-1.0.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style>
+
+input { line-height: 1.0 }
+
+</style>
+<input type="text" value="text input" size="20">
diff --git a/layout/reftests/forms/input/text/line-height-1.5.html b/layout/reftests/forms/input/text/line-height-1.5.html
new file mode 100644
index 000000000..4363b09a2
--- /dev/null
+++ b/layout/reftests/forms/input/text/line-height-1.5.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<style>
+
+input { line-height: 1.5 }
+
+</style>
+<input type="text" value="text input" size="20">
diff --git a/layout/reftests/forms/input/text/reftest-stylo.list b/layout/reftests/forms/input/text/reftest-stylo.list
new file mode 100644
index 000000000..86f890acd
--- /dev/null
+++ b/layout/reftests/forms/input/text/reftest-stylo.list
@@ -0,0 +1,16 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+== bounds-1.html bounds-1.html
+fuzzy-if(asyncPan&&!layersGPUAccelerated,121,84) == size-1.html size-1.html
+skip-if(B2G||Mulet) == size-2.html size-2.html
+# Initial mulet triage: parity with B2G/B2G Desktop
+HTTP(..) == baseline-1.html baseline-1.html
+skip-if((B2G&&browserIsRemote)||Mulet) HTTP(..) == centering-1.xul centering-1.xul
+# bug 974780
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if((B2G&&browserIsRemote)||Mulet) == dynamic-height-1.xul dynamic-height-1.xul
+# bug 974780
+# Initial mulet triage: parity with B2G/B2G Desktop
+fuzzy-if(skiaContent,1,500) needs-focus == select.html select.html
+== intrinsic-size.html intrinsic-size.html
+== line-height-0.5.html line-height-0.5.html
+== line-height-1.5.html line-height-1.5.html
diff --git a/layout/reftests/forms/input/text/reftest.list b/layout/reftests/forms/input/text/reftest.list
new file mode 100644
index 000000000..7f75af36a
--- /dev/null
+++ b/layout/reftests/forms/input/text/reftest.list
@@ -0,0 +1,10 @@
+== bounds-1.html bounds-1-ref.html
+fuzzy-if(asyncPan&&!layersGPUAccelerated,140,111) == size-1.html size-1-ref.html
+== size-2.html size-2-ref.html
+HTTP(..) == baseline-1.html baseline-1-ref.html
+HTTP(..) == centering-1.xul centering-1-ref.xul
+== dynamic-height-1.xul dynamic-height-1-ref.xul
+fuzzy-if(skiaContent,1,500) needs-focus == select.html select-ref.html
+== intrinsic-size.html intrinsic-size-ref.html
+== line-height-0.5.html line-height-1.0.html
+!= line-height-1.5.html line-height-1.0.html
diff --git a/layout/reftests/forms/input/text/select-ref.html b/layout/reftests/forms/input/text/select-ref.html
new file mode 100644
index 000000000..added237c
--- /dev/null
+++ b/layout/reftests/forms/input/text/select-ref.html
@@ -0,0 +1,18 @@
+<html class="reftest-wait">
+ <head>
+ <script type="text/javascript">
+ function finishTest() {
+ document.documentElement.removeAttribute("class");
+ }
+ function runTest() {
+ var field = document.getElementById('field');
+ field.focus();
+ field.select();
+ setTimeout(finishTest, 0);
+ }
+ </script>
+ </head>
+ <body onload="runTest()">
+ <input id="field" type="text" value="1234">
+ </body>
+</html>
diff --git a/layout/reftests/forms/input/text/select.html b/layout/reftests/forms/input/text/select.html
new file mode 100644
index 000000000..eba0c3824
--- /dev/null
+++ b/layout/reftests/forms/input/text/select.html
@@ -0,0 +1,21 @@
+<html class="reftest-wait">
+ <head>
+ <script type="text/javascript">
+ function finishTest() {
+ document.documentElement.removeAttribute("class");
+ }
+ function runTest() {
+ var field = document.getElementById('field');
+ field.focus();
+ field.disabled = true;
+ field.setSelectionRange(0, 4);
+ field.disabled = false;
+ field.select();
+ setTimeout(finishTest, 0);
+ }
+ </script>
+ </head>
+ <body onload="runTest()">
+ <input id="field" type="text" value="1234">
+ </body>
+</html>
diff --git a/layout/reftests/forms/input/text/size-1-ref.html b/layout/reftests/forms/input/text/size-1-ref.html
new file mode 100644
index 000000000..c9a480358
--- /dev/null
+++ b/layout/reftests/forms/input/text/size-1-ref.html
@@ -0,0 +1,3 @@
+<html lang="en">
+ <input size="4" value="1234" style="font-family: monospace">
+</html>
diff --git a/layout/reftests/forms/input/text/size-1.html b/layout/reftests/forms/input/text/size-1.html
new file mode 100644
index 000000000..e0390261d
--- /dev/null
+++ b/layout/reftests/forms/input/text/size-1.html
@@ -0,0 +1,3 @@
+<html lang="en">
+ <input size="4" value="1234|6" style="font-family: monospace">
+</html>
diff --git a/layout/reftests/forms/input/text/size-2-ref.html b/layout/reftests/forms/input/text/size-2-ref.html
new file mode 100644
index 000000000..94512260b
--- /dev/null
+++ b/layout/reftests/forms/input/text/size-2-ref.html
@@ -0,0 +1,5 @@
+<html lang="en">
+<body style="background-color:white;">
+ <input size="40" value="1234" style="background-color:white; color:black; font-family: monospace; border: none">
+</body>
+</html>
diff --git a/layout/reftests/forms/input/text/size-2.html b/layout/reftests/forms/input/text/size-2.html
new file mode 100644
index 000000000..7353238f7
--- /dev/null
+++ b/layout/reftests/forms/input/text/size-2.html
@@ -0,0 +1,5 @@
+<html lang="en">
+<body style="background-color:white;">
+ <input size="4" value="1234" style="background-color:white; color:black; font-family: monospace; border: none">
+</body>
+</html>