diff options
Diffstat (limited to 'layout/reftests/forms/input/text')
24 files changed, 317 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 0000000000..427911eb04 --- /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 0000000000..59e92018b1 --- /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 0000000000..14d39ba729 --- /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 0000000000..4af490dce6 --- /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.xhtml b/layout/reftests/forms/input/text/centering-1-ref.xhtml new file mode 100644 index 0000000000..f1bf3e49cf --- /dev/null +++ b/layout/reftests/forms/input/text/centering-1-ref.xhtml @@ -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.xhtml b/layout/reftests/forms/input/text/centering-1.xhtml new file mode 100644 index 0000000000..dc72bda555 --- /dev/null +++ b/layout/reftests/forms/input/text/centering-1.xhtml @@ -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.xhtml b/layout/reftests/forms/input/text/dynamic-height-1-ref.xhtml new file mode 100644 index 0000000000..93b9b4387a --- /dev/null +++ b/layout/reftests/forms/input/text/dynamic-height-1-ref.xhtml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin/global.css"?> +<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.xhtml b/layout/reftests/forms/input/text/dynamic-height-1.xhtml new file mode 100644 index 0000000000..745aac3658 --- /dev/null +++ b/layout/reftests/forms/input/text/dynamic-height-1.xhtml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin/global.css"?> +<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/height-small-font-notref.html b/layout/reftests/forms/input/text/height-small-font-notref.html new file mode 100644 index 0000000000..bf43cdb1ea --- /dev/null +++ b/layout/reftests/forms/input/text/height-small-font-notref.html @@ -0,0 +1,2 @@ +<!doctype html> +<input style="width: 100px; font-size: 10px"> diff --git a/layout/reftests/forms/input/text/height-small-font.html b/layout/reftests/forms/input/text/height-small-font.html new file mode 100644 index 0000000000..d269aa540a --- /dev/null +++ b/layout/reftests/forms/input/text/height-small-font.html @@ -0,0 +1,2 @@ +<!doctype html> +<input style="width: 100px; font-size: 16px"> 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 0000000000..2735336e3b --- /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 0000000000..ef5c3da839 --- /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 0000000000..e60a5f3a8c --- /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 0000000000..52a0fde6c0 --- /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-2.5.html b/layout/reftests/forms/input/text/line-height-2.5.html new file mode 100644 index 0000000000..d04be79e72 --- /dev/null +++ b/layout/reftests/forms/input/text/line-height-2.5.html @@ -0,0 +1,7 @@ +<!DOCTYPE HTML> +<style> + +input { line-height: 2.5 } + +</style> +<input type="text" value="text input" size="20"> diff --git a/layout/reftests/forms/input/text/reftest.list b/layout/reftests/forms/input/text/reftest.list new file mode 100644 index 0000000000..6aa17779e3 --- /dev/null +++ b/layout/reftests/forms/input/text/reftest.list @@ -0,0 +1,12 @@ +== bounds-1.html bounds-1-ref.html +fuzzy-if(asyncPan&&!layersGPUAccelerated,0-151,0-111) fuzzy-if(webrender,0-65,0-3) == size-1.html size-1-ref.html +== size-2.html size-2-ref.html +== baseline-1.html baseline-1-ref.html +== chrome://reftest/content/forms/input/text/centering-1.xhtml chrome://reftest/content/forms/input/text/centering-1-ref.xhtml +== chrome://reftest/content/forms/input/text/dynamic-height-1.xhtml chrome://reftest/content/forms/input/text/dynamic-height-1-ref.xhtml +fuzzy-if(skiaContent,0-1,0-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-2.5.html line-height-1.0.html +== shadow-rules.html shadow-rules-ref.html +!= height-small-font.html height-small-font-notref.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 0000000000..added237cf --- /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 0000000000..eba0c38244 --- /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/shadow-rules-ref.html b/layout/reftests/forms/input/text/shadow-rules-ref.html new file mode 100644 index 0000000000..edc6813db3 --- /dev/null +++ b/layout/reftests/forms/input/text/shadow-rules-ref.html @@ -0,0 +1,7 @@ +<!doctype html> +<div id="host"></div> +<script> + host.attachShadow({ mode: "open" }).innerHTML = ` + <input type="text" value="Should not be red"> + `; +</script> diff --git a/layout/reftests/forms/input/text/shadow-rules.html b/layout/reftests/forms/input/text/shadow-rules.html new file mode 100644 index 0000000000..906472ea5a --- /dev/null +++ b/layout/reftests/forms/input/text/shadow-rules.html @@ -0,0 +1,10 @@ +<!doctype html> +<div id="host"></div> +<script> + host.attachShadow({ mode: "open" }).innerHTML = ` + <style> + input > *|* { color: red !important; } + </style> + <input type="text" value="Should not be red"> + `; +</script> 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 0000000000..c9a4803585 --- /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 0000000000..e0390261d5 --- /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 0000000000..94512260b7 --- /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 0000000000..7353238f76 --- /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> |