Bug 673873 - Display placeholder when focusing empty input - part 2: update reftests. r=mounir

This commit is contained in:
Frank Yan 2012-05-24 03:54:26 -07:00
Родитель 6daa0281dc
Коммит e6ca5c7bf0
17 изменённых файлов: 51 добавлений и 19 удалений

Просмотреть файл

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<link rel='stylesheet' type='text/css' href='style.css'>
<script>
function loadHandler()
{
@ -11,6 +12,6 @@
}
</script>
<body onload='loadHandler();'>
<input id='i' onfocus='focusHandler();'>
<input id='i' class='ref' value='foo' onfocus='focusHandler();'>
</body>
</html>

Просмотреть файл

@ -1,7 +1,7 @@
input:-moz-placeholder,
input.ref {
-moz-appearance: none;
color: black;
color: -moz-FieldText;
background-color: green;
}

Просмотреть файл

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<link rel='stylesheet' type='text/css' href='style.css'>
<script>
function loadHandler()
{
@ -11,6 +12,6 @@
}
</script>
<body onload='loadHandler();'>
<textarea id='t' onfocus='focusHandler();'></textarea>
<textarea id='t' class='ref' onfocus='focusHandler();'>foo</textarea>
</body>
</html>

Просмотреть файл

@ -1,7 +1,7 @@
textarea:-moz-placeholder,
textarea.ref {
-moz-appearance: none;
color: black;
color: -moz-FieldText;
background-color: green;
}

Просмотреть файл

@ -1,5 +1,6 @@
<!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()

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<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()
{
@ -8,7 +9,7 @@
}
function setPlaceholder()
{
document.getElementById('p1').placeholder = 'new placeholder';
document.getElementById('p1').placeholder = 'my placeholder';
}
function disableReftestWait()
{
@ -17,6 +18,6 @@
</script>
<body onload="focusPlaceholder();">
<input type="text" id="p1" value="" placeholder="my placeholder" onfocus="setPlaceholder(); disableReftestWait();">
<input type="text" id="p1" value="" placeholder="old placeholder" onfocus="setPlaceholder(); disableReftestWait();">
</body>
</html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, value reset shouldn't show placeholder. -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<!-- Test: when focused, value reset should show placeholder. -->
<script type="text/javascript">
function focusPlaceholder()
{

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<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()
{
@ -8,7 +9,7 @@
}
function setPlaceholder()
{
document.getElementById('p1').placeholder = 'new placeholder';
document.getElementById('p1').placeholder = 'my placeholder';
}
function disableReftestWait()
{

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<!-- Test: when focused, clearing placeholder attribute should work. -->
<script type="text/javascript">
function focusPlaceholder()
{

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<!-- Test: when focused, clearing placeholder attribute should work. -->
<script type="text/javascript">
function focusPlaceholder()
{

Просмотреть файл

@ -1,5 +1,6 @@
<!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()

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, placeholder update shouldn't show placeholder. -->
<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()
{
@ -8,7 +9,7 @@
}
function setPlaceholder()
{
document.getElementById('p1').placeholder = 'new placeholder';
document.getElementById('p1').placeholder = 'my placeholder';
}
function disableReftestWait()
{
@ -17,6 +18,6 @@
</script>
<body onload="focusPlaceholder();">
<input type="text" id="p1" value="" placeholder="my placeholder" onfocus="setPlaceholder(); disableReftestWait();">
<input type="text" id="p1" value="" placeholder="old placeholder" onfocus="setPlaceholder(); disableReftestWait();">
</body>
</html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when focused, value reset shouldn't show placeholder. -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<!-- Test: when focused, value reset should show placeholder. -->
<script type="text/javascript">
function focusPlaceholder()
{

Просмотреть файл

@ -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>

Просмотреть файл

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript">
function focusInput()
{
@ -11,6 +12,6 @@
}
</script>
<body onload="focusInput();">
<input id='t1' type="text" onfocus="disableReftestWait();">
<input id='t1' type="text" class="placeholder" value="my placeholder" onfocus="disableReftestWait();">
</body>
</html>

Просмотреть файл

@ -2,3 +2,9 @@ textarea.placeholder,
input.placeholder {
color: GrayText;
}
/* workaround until :-moz-placeholder is re-implemented as a pseudo-element */
textarea:focus,
input:focus {
color: -moz-FieldText;
}

Просмотреть файл

@ -22,5 +22,5 @@ needs-focus == placeholder-17.html placeholder-focus-ref.html
== placeholder-18.html placeholder-overridden-ref.html
== placeholder-19.xul placeholder-overridden-ref.xul
needs-focus == placeholder-20.html placeholder-focus-ref.html
needs-focus == placeholder-21.html placeholder-focus-ref.html
needs-focus == placeholder-22.html placeholder-focus-ref.html
needs-focus == placeholder-21.html placeholder-blank-ref.html
needs-focus == placeholder-22.html placeholder-blank-ref.html