summaryrefslogtreecommitdiffstats
path: root/layout/reftests/forms/placeholder
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/forms/placeholder
parentInitial commit. (diff)
downloadfirefox-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 'layout/reftests/forms/placeholder')
-rw-r--r--layout/reftests/forms/placeholder/placeholder-1-password.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-1-text.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-1-textarea.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-10.html27
-rw-r--r--layout/reftests/forms/placeholder/placeholder-11.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-12.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-13.html18
-rw-r--r--layout/reftests/forms/placeholder/placeholder-14.html18
-rw-r--r--layout/reftests/forms/placeholder/placeholder-18.html22
-rw-r--r--layout/reftests/forms/placeholder/placeholder-2-textarea.html19
-rw-r--r--layout/reftests/forms/placeholder/placeholder-2.html19
-rw-r--r--layout/reftests/forms/placeholder/placeholder-20.html23
-rw-r--r--layout/reftests/forms/placeholder/placeholder-21.html22
-rw-r--r--layout/reftests/forms/placeholder/placeholder-22.html22
-rw-r--r--layout/reftests/forms/placeholder/placeholder-3.html7
-rw-r--r--layout/reftests/forms/placeholder/placeholder-4.html18
-rw-r--r--layout/reftests/forms/placeholder/placeholder-5.html19
-rw-r--r--layout/reftests/forms/placeholder/placeholder-6-textarea.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-6.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-7.html19
-rw-r--r--layout/reftests/forms/placeholder/placeholder-8.html23
-rw-r--r--layout/reftests/forms/placeholder/placeholder-9.html23
-rw-r--r--layout/reftests/forms/placeholder/placeholder-blank-ref.html16
-rw-r--r--layout/reftests/forms/placeholder/placeholder-focus-ref.html17
-rw-r--r--layout/reftests/forms/placeholder/placeholder-overflow-ref.html13
-rw-r--r--layout/reftests/forms/placeholder/placeholder-overflow-textarea-ref.html13
-rw-r--r--layout/reftests/forms/placeholder/placeholder-overridden-ref.html6
-rw-r--r--layout/reftests/forms/placeholder/placeholder-rtl-ref.html9
-rw-r--r--layout/reftests/forms/placeholder/placeholder-rtl.html8
-rw-r--r--layout/reftests/forms/placeholder/placeholder-style.css10
-rw-r--r--layout/reftests/forms/placeholder/placeholder-visible-ref.html13
-rw-r--r--layout/reftests/forms/placeholder/placeholder-visible-textarea-ref.html13
-rw-r--r--layout/reftests/forms/placeholder/reftest.list36
33 files changed, 509 insertions, 0 deletions
diff --git a/layout/reftests/forms/placeholder/placeholder-1-password.html b/layout/reftests/forms/placeholder/placeholder-1-password.html
new file mode 100644
index 0000000000..1c3d582f10
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-1-password.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: placeholder should be used by input password elements -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input type="password" value="" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-1-text.html b/layout/reftests/forms/placeholder/placeholder-1-text.html
new file mode 100644
index 0000000000..30df2f3484
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-1-text.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: placeholder should be used by input text elements -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input type="text" value="" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-1-textarea.html b/layout/reftests/forms/placeholder/placeholder-1-textarea.html
new file mode 100644
index 0000000000..89f990ce01
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-1-textarea.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: placeholder should be used by textarea elements -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <textarea placeholder="my placeholder"></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-10.html b/layout/reftests/forms/placeholder/placeholder-10.html
new file mode 100644
index 0000000000..40a35669ec
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-10.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: when unfocused, if value='', newest placeholder should be shown -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = 'my placeholder';
+ }
+ function unFocusPlaceholder()
+ {
+ document.getElementById('p1').blur();
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="" placeholder="old placeholder" onfocus="setPlaceholder(); unFocusPlaceholder(); disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-11.html b/layout/reftests/forms/placeholder/placeholder-11.html
new file mode 100644
index 0000000000..62c77351c8
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-11.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: placeholder shouldn't show new lines (&#10; version) -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input type="text" value="" placeholder="my&#10; placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-12.html b/layout/reftests/forms/placeholder/placeholder-12.html
new file mode 100644
index 0000000000..7cfd00a0eb
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-12.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: placeholder shouldn't show new lines (&#13; version) -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input type="text" value="" placeholder="my&#13; placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-13.html b/layout/reftests/forms/placeholder/placeholder-13.html
new file mode 100644
index 0000000000..19fc172937
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-13.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: placeholder shouldn't show new lines (\r version) -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = 'my\r placeholder';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload="setPlaceholder(); disableReftestWait();">
+ <input type="text" id="p1" value="" placeholder="">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-14.html b/layout/reftests/forms/placeholder/placeholder-14.html
new file mode 100644
index 0000000000..ad99420eb1
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-14.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: placeholder shouldn't show new lines (\n version) -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = 'my\n placeholder';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload="setPlaceholder(); disableReftestWait();">
+ <input type="text" id="p1" value="" placeholder="">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-18.html b/layout/reftests/forms/placeholder/placeholder-18.html
new file mode 100644
index 0000000000..159d5d7e27
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-18.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: placeholder should appear with dynamic DOM modifications -->
+ <script type="text/javascript">
+ function setPlaceholder()
+ {
+ var i = document.getElementById('p1');
+ i.focus();
+ i.blur();
+ i.value = "not empty";
+ i.value = "";
+ i.value = "my value";
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload="setPlaceholder(); disableReftestWait();">
+ <input type="text" id="p1" value="" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-2-textarea.html b/layout/reftests/forms/placeholder/placeholder-2-textarea.html
new file mode 100644
index 0000000000..06678a3db9
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-2-textarea.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: placeholder has to be used if set via javascript -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = "my placeholder";
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="setPlaceholder(); disableReftestWait();">
+ <textarea id="p1" placeholder=""></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-2.html b/layout/reftests/forms/placeholder/placeholder-2.html
new file mode 100644
index 0000000000..36b883ab25
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: placeholder has to be used if set via javascript -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = "my placeholder";
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="setPlaceholder(); disableReftestWait();">
+ <input type="text" id="p1" value="" placeholder="">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-20.html b/layout/reftests/forms/placeholder/placeholder-20.html
new file mode 100644
index 0000000000..323cea849a
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-20.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <!-- Test: when focused, if value='', newest placeholder should be shown. -->
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = 'my placeholder';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="" onfocus="setPlaceholder(); disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-21.html b/layout/reftests/forms/placeholder/placeholder-21.html
new file mode 100644
index 0000000000..483b0d49d6
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-21.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: when focused, clearing placeholder attribute should work. -->
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function setPlaceholder()
+ {
+ document.getElementById('p1').removeAttribute('placeholder');
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="" placeholder="my placeholder" onfocus="setPlaceholder(); disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-22.html b/layout/reftests/forms/placeholder/placeholder-22.html
new file mode 100644
index 0000000000..7ae54e8e71
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-22.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: when focused, clearing placeholder attribute should work. -->
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = '';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="" placeholder="my placeholder" onfocus="setPlaceholder(); disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-3.html b/layout/reftests/forms/placeholder/placeholder-3.html
new file mode 100644
index 0000000000..b58f7ca72f
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-3.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test: value has to be shown when not null -->
+ <body>
+ <input type="text" value="my value" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-4.html b/layout/reftests/forms/placeholder/placeholder-4.html
new file mode 100644
index 0000000000..bfcce20b8c
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-4.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: value has to be shown if set via javascript -->
+ <script type="text/javascript">
+ function setValue()
+ {
+ document.getElementById('p1').value = "my value";
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="setValue(); disableReftestWait();">
+ <input type="text" id="p1" value="" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-5.html b/layout/reftests/forms/placeholder/placeholder-5.html
new file mode 100644
index 0000000000..0f766d160a
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-5.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- Test: placeholder has to be shown if value is reseted via javascript -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function setValue()
+ {
+ document.getElementById('p1').value = "";
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="setValue(); disableReftestWait();">
+ <input type="text" id="p1" value="my value" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-6-textarea.html b/layout/reftests/forms/placeholder/placeholder-6-textarea.html
new file mode 100644
index 0000000000..b56cb04789
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-6-textarea.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test placeholder behavior when textarea is too small -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <textarea cols="5" rows="3" placeholder="my placeholder"></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-6.html b/layout/reftests/forms/placeholder/placeholder-6.html
new file mode 100644
index 0000000000..774aa35d4d
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-6.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <!-- Test placeholder behavior when input is too small -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input type="text" size="5" value="" placeholder="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-7.html b/layout/reftests/forms/placeholder/placeholder-7.html
new file mode 100644
index 0000000000..19fc8eb745
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-7.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <!-- Test: when focused, element should show placeholder. -->
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="" placeholder="my placeholder" onfocus="disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-8.html b/layout/reftests/forms/placeholder/placeholder-8.html
new file mode 100644
index 0000000000..9c1ac995aa
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-8.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <!-- Test: when focused, if value='', newest placeholder should be shown. -->
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function setPlaceholder()
+ {
+ document.getElementById('p1').placeholder = 'my placeholder';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="" placeholder="old placeholder" onfocus="setPlaceholder(); disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-9.html b/layout/reftests/forms/placeholder/placeholder-9.html
new file mode 100644
index 0000000000..35155c0120
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-9.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <!-- Test: when focused, value reset should show placeholder. -->
+ <script type="text/javascript">
+ function focusPlaceholder()
+ {
+ document.getElementById('p1').focus();
+ }
+ function resetValue()
+ {
+ document.getElementById('p1').value = '';
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+
+ <body onload="focusPlaceholder();">
+ <input type="text" id="p1" value="my value" placeholder="my placeholder" onfocus="resetValue(); disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-blank-ref.html b/layout/reftests/forms/placeholder/placeholder-blank-ref.html
new file mode 100644
index 0000000000..115ffac79e
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-blank-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <script type="text/javascript">
+ function focusInput()
+ {
+ document.getElementById('t1').focus();
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload="focusInput();">
+ <input id='t1' type="text" onfocus="disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-focus-ref.html b/layout/reftests/forms/placeholder/placeholder-focus-ref.html
new file mode 100644
index 0000000000..fa8f292a47
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-focus-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <script type="text/javascript">
+ function focusInput()
+ {
+ document.getElementById('t1').focus();
+ }
+ function disableReftestWait()
+ {
+ document.documentElement.className = '';
+ }
+ </script>
+ <body onload="focusInput();">
+ <input id='t1' type="text" class="placeholder" value="my placeholder" onfocus="disableReftestWait();">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-overflow-ref.html b/layout/reftests/forms/placeholder/placeholder-overflow-ref.html
new file mode 100644
index 0000000000..9bceacd626
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-overflow-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ This test 'emulate' the placeholder by setting a style
+ to the value of an input text.
+ This test may break if placeholder default style is changed.
+ -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+
+ <body>
+ <input type="text" class="placeholder" size="5" value="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-overflow-textarea-ref.html b/layout/reftests/forms/placeholder/placeholder-overflow-textarea-ref.html
new file mode 100644
index 0000000000..559945a50f
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-overflow-textarea-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ This test 'emulate' the placeholder by setting a style
+ to the value of a textarea.
+ This test may break if placeholder default style is changed.
+ -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+
+ <body>
+ <textarea class="placeholder" cols="5" rows="3">my placeholder</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-overridden-ref.html b/layout/reftests/forms/placeholder/placeholder-overridden-ref.html
new file mode 100644
index 0000000000..11f756af67
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-overridden-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <input type="text" value="my value">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-rtl-ref.html b/layout/reftests/forms/placeholder/placeholder-rtl-ref.html
new file mode 100644
index 0000000000..91812d0cee
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-rtl-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html dir='rtl'>
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input class='placeholder' value='foo'>
+ <textarea class='placeholder' >foo</textarea>
+ </body>
+</html>
+
diff --git a/layout/reftests/forms/placeholder/placeholder-rtl.html b/layout/reftests/forms/placeholder/placeholder-rtl.html
new file mode 100644
index 0000000000..5898ed55c7
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-rtl.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html dir='rtl'>
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+ <body>
+ <input placeholder='foo'>
+ <textarea placeholder='foo'></textarea>
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-style.css b/layout/reftests/forms/placeholder/placeholder-style.css
new file mode 100644
index 0000000000..0c5bb63333
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-style.css
@@ -0,0 +1,10 @@
+textarea.placeholder,
+input.placeholder,
+input::placeholder,
+textarea::placeholder {
+ /* Unfortunately, we can't style the <input> or <textarea> text so we can't
+ set it to opacity: 0.54; which means we have to revert the style to
+ something that doesn't include an opacity. */
+ color: GrayText;
+ opacity: 1.0;
+}
diff --git a/layout/reftests/forms/placeholder/placeholder-visible-ref.html b/layout/reftests/forms/placeholder/placeholder-visible-ref.html
new file mode 100644
index 0000000000..b05267457e
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-visible-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ This test 'emulate' the placeholder by setting a style
+ to the value of an input text.
+ This test may break if placeholder default style is changed.
+ -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+
+ <body>
+ <input type="text" class="placeholder" value="my placeholder">
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/placeholder-visible-textarea-ref.html b/layout/reftests/forms/placeholder/placeholder-visible-textarea-ref.html
new file mode 100644
index 0000000000..b7bda6f80a
--- /dev/null
+++ b/layout/reftests/forms/placeholder/placeholder-visible-textarea-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ This test 'emulate' the placeholder by setting a style
+ to the value of a textarea.
+ This test may break if placeholder default style is changed.
+ -->
+ <link rel='stylesheet' type='text/css' href='placeholder-style.css'>
+
+ <body>
+ <textarea class="placeholder">my placeholder</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/forms/placeholder/reftest.list b/layout/reftests/forms/placeholder/reftest.list
new file mode 100644
index 0000000000..54ec3b06e0
--- /dev/null
+++ b/layout/reftests/forms/placeholder/reftest.list
@@ -0,0 +1,36 @@
+# Tests using placeholder-focus-ref.html as a reference are disabled because
+# we can't change the caret colour nor disable it and we can't change the
+# text colour without changing the caret which means that the tested page has
+# a black caret with a grey text and the reference has a grey caret with grey
+# text. The only thing that is doable is to make the caret grey in the tested
+# page but that would make the test moot because a failure wouldn't be seen.
+# A real way to fix this would be to be able to style the caret or to implement
+# ::value (bug 648643), depending of the ::value behaviour (it could change the
+# caret colour and the text colour or just the text colour).
+
+== placeholder-1-text.html placeholder-visible-ref.html
+== placeholder-1-password.html placeholder-visible-ref.html
+== placeholder-1-textarea.html placeholder-visible-textarea-ref.html
+== placeholder-2.html placeholder-visible-ref.html
+== placeholder-2-textarea.html placeholder-visible-textarea-ref.html
+== placeholder-3.html placeholder-overridden-ref.html
+== placeholder-4.html placeholder-overridden-ref.html
+== placeholder-5.html placeholder-visible-ref.html
+
+# This tests assumes that the overflowing placeholder won't eat the padding, which is just not true in some platforms...
+fuzzy-if(winWidget,0-160,0-10) fuzzy-if(Android,0-160,0-41) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-146,0-317) == placeholder-6.html placeholder-overflow-ref.html
+
+skip-if(Android&&asyncPan) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html
+# needs-focus == placeholder-7.html placeholder-focus-ref.html
+# needs-focus == placeholder-8.html placeholder-focus-ref.html
+# needs-focus == placeholder-9.html placeholder-focus-ref.html
+needs-focus == placeholder-10.html placeholder-visible-ref.html
+== placeholder-11.html placeholder-visible-ref.html
+== placeholder-12.html placeholder-visible-ref.html
+== placeholder-13.html placeholder-visible-ref.html
+== placeholder-14.html placeholder-visible-ref.html
+== placeholder-18.html placeholder-overridden-ref.html
+# needs-focus == placeholder-20.html placeholder-focus-ref.html
+needs-focus == placeholder-21.html placeholder-blank-ref.html
+needs-focus == placeholder-22.html placeholder-blank-ref.html
+== placeholder-rtl.html placeholder-rtl-ref.html