Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_bug613019.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/html/test/test_bug613019.html


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=613019
-->

<head>
  <title>Test for Bug 613019</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=613019">Mozilla Bug 613019</a>
<div id="content">
  <input type="text" maxlength="2" style="width:200px" value="Test">
  <textarea maxlength="2" style="width:200px">Test</textarea>
  <input type="text" minlength="6" style="width:200px" value="Test">
  <textarea minlength="6" style="width:200px">Test</textarea>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

/** Test for Bug 613019 **/

function testInteractivityOfMaxLength(elem) {
  // verify that user interactivity is necessary for validity state to apply.
  is(elem.value, "Test""Element has incorrect starting value.");
  is(elem.validity.tooLong, false, "Element should not be tooLong.");

  elem.setSelectionRange(elem.value.length, elem.value.length)
  elem.focus();

  synthesizeKey("KEY_Backspace");
  is(elem.value, "Tes""Element value was not changed correctly.");
  is(elem.validity.tooLong, true, "Element should still be tooLong.");

  synthesizeKey("KEY_Backspace");
  is(elem.value, "Te""Element value was not changed correctly.");
  is(elem.validity.tooLong, false, "Element should no longer be tooLong.");

  elem.value = "Test";
  is(elem.validity.tooLong, false,
     "Element should not be tooLong after non-interactive value change.");
}

function testInteractivityOfMinLength(elem) {
  // verify that user interactivity is necessary for validity state to apply.
  is(elem.value, "Test""Element has incorrect starting value.");
  is(elem.validity.tooLong, false, "Element should not be tooShort.");

  elem.setSelectionRange(elem.value.length, elem.value.length)
  elem.focus();

  sendString("e");
  is(elem.value, "Teste""Element value was not changed correctly.");
  is(elem.validity.tooShort, true, "Element should still be tooShort.");

  sendString("d");
  is(elem.value, "Tested""Element value was not changed correctly.");
  is(elem.validity.tooShort, false, "Element should no longer be tooShort.");

  elem.value = "Test";
  is(elem.validity.tooShort, false,
     "Element should not be tooShort after non-interactive value change.");
}

function test() {
  window.getSelection().removeAllRanges();
  testInteractivityOfMaxLength(document.querySelector("input[type=text][maxlength]"));
  testInteractivityOfMaxLength(document.querySelector("textarea[maxlength]"));
  testInteractivityOfMinLength(document.querySelector("input[type=text][minlength]"));
  testInteractivityOfMinLength(document.querySelector("textarea[minlength]"));
  SimpleTest.finish();
}

window.onload = function() {
  SimpleTest.waitForExplicitFinish();
  setTimeout(test, 0);
};

</script>
</pre>
</body>
</html>

Messung V0.5
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge