зеркало из https://github.com/mozilla/gecko-dev.git
Bug 673873 - Display placeholder when focusing empty input - part 2: update reftests. r=mounir
This commit is contained in:
Родитель
6daa0281dc
Коммит
e6ca5c7bf0
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче