зеркало из https://github.com/mozilla/gecko-dev.git
Bug 549311 - New lines management tests for placeholder are missing; r=ehsan
--HG-- extra : rebase_source : ba4be5c6a90abfef87f573968d00b4cc179aafdd
This commit is contained in:
Родитель
8741080d1b
Коммит
4dca577f2e
|
@ -41,6 +41,14 @@ function testPlaceholderForElement(element)
|
|||
element.value = 'value';
|
||||
is(element.placeholder, 'ph', "placeholder in DOM interface has changed when value has changed");
|
||||
is(element.getAttribute('placeholder'), 'ph', "placeholder attribute has changed when value has changed");
|
||||
|
||||
// check new lines are managed correctly (shouldn't be shown but kept in the DOM)
|
||||
element.placeholder = 'place\nholder';
|
||||
is(element.placeholder, 'place\nholder', "\\n shouldn't be stripped");
|
||||
is(element.getAttribute('placeholder'), 'place\nholder', "\\n shouldn't be stripped");
|
||||
element.placeholder = 'place\rholder';
|
||||
is(element.placeholder, 'place\rholder', "\\r shouldn't be stripped");
|
||||
is(element.getAttribute('placeholder'), 'place\rholder', "\\r shouldn't be stripped");
|
||||
}
|
||||
|
||||
testPlaceholderForElement(document.getElementById('inputtext'));
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- Test: placeholder shouldn't show new lines ( version) -->
|
||||
<body>
|
||||
<input type="text" value="" placeholder="my placeholder">
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- Test: placeholder shouldn't show new lines ( version) -->
|
||||
<body>
|
||||
<input type="text" value="" placeholder="my placeholder">
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<!-- Test: placeholder shouldn't show new lines (\r version) -->
|
||||
<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>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<!-- Test: placeholder shouldn't show new lines (\n version) -->
|
||||
<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>
|
|
@ -11,3 +11,7 @@
|
|||
== placeholder-8.html placeholder-focus-ref.html
|
||||
== placeholder-9.html placeholder-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
|
||||
|
|
Загрузка…
Ссылка в новой задаче