Bug 565074 - Write reftests for the placeholder without readonly input element. r=ehsan

--HG--
rename : layout/reftests/forms/placeholder/placeholder-7.html => layout/reftests/forms/placeholder/placeholder-15.html
rename : layout/reftests/forms/placeholder/placeholder-8.html => layout/reftests/forms/placeholder/placeholder-16.html
rename : layout/reftests/forms/placeholder/placeholder-9.html => layout/reftests/forms/placeholder/placeholder-17.html
rename : layout/reftests/forms/placeholder/placeholder-focus-ref.html => layout/reftests/forms/placeholder/placeholder-readonly-focus-ref.html
This commit is contained in:
Mounir Lamouri 2010-05-17 12:20:17 +02:00
parent c42409c3af
commit d42236f376
9 changed files with 88 additions and 11 deletions

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- 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>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<script type="text/javascript">
function focusPlaceholder()
{
document.getElementById('p1').focus();
}
function setPlaceholder()
{
document.getElementById('p1').placeholder = 'new placeholder';
}
function disableReftestWait()
{
document.documentElement.className = '';
}
</script>
<body onload="focusPlaceholder();">
<input type="text" id="p1" value="" placeholder="my placeholder" onfocus="setPlaceholder(); disableReftestWait();">
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, value reset shouldn't 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>

View File

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, element should show placeholder
Using a readonly input text to disable caret -->
<!-- Test: when focused, element should show placeholder. -->
<script type="text/javascript">
function focusPlaceholder()
{

View File

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder
Using a readonly input text to disable caret -->
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<script type="text/javascript">
function focusPlaceholder()
{

View File

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, value reset shouldn't show placeholder
Using a readonly input text to disable caret -->
<!-- Test: when focused, value reset shouldn't show placeholder. -->
<script type="text/javascript">
function focusPlaceholder()
{

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Using a readonly input text to disable caret -->
<script type="text/javascript">
function focusInput()
{
@ -12,6 +11,6 @@
}
</script>
<body onload="focusInput();">
<input id='t1' type="text" readonly onfocus="disableReftestWait();">
<input id='t1' type="text" onfocus="disableReftestWait();">
</body>
</html>

View File

@ -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" readonly onfocus="disableReftestWait();">
</body>
</html>

View File

@ -7,11 +7,14 @@
== placeholder-5.html placeholder-visible-ref.html
== placeholder-6.html placeholder-overflow-ref.html
== placeholder-6-textarea.html placeholder-overflow-textarea-ref.html
== placeholder-7.html placeholder-focus-ref.html
== placeholder-8.html placeholder-focus-ref.html
== placeholder-9.html placeholder-focus-ref.html
== placeholder-7.html placeholder-readonly-focus-ref.html
== placeholder-8.html placeholder-readonly-focus-ref.html
== placeholder-9.html placeholder-readonly-focus-ref.html
== 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-15.html placeholder-focus-ref.html
== placeholder-16.html placeholder-focus-ref.html
== placeholder-17.html placeholder-focus-ref.html