Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_novalidate_attribute.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/html/test/forms/test_novalidate_attribute.html


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

<head>
  <title>Test for Bug 556013</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=556013">Mozilla Bug 556013</a>
<p id="display"></p>
<iframe style='width:50px; height: 50px;' name='t'></iframe>
<div id="content">
  <form target='t' action='data:text/html,' novalidate>
    <input id='av' required>
    <input id='a' type='submit'>
  </form>
  <form target='t' action='data:text/html,' novalidate>
    <input id='bv' type='checkbox' required>
    <button id='b' type='submit'></button>
  </form>
  <form target='t' action='data:text/html,' novalidate>
    <input id='c' required>
  </form>
</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 556013 **/

/**
 * novalidate should prevent form validation, thus not blocking form submission.
 *
 * NOTE: if the MozInvalidForm event doesn't get prevented default, the form
 * submission will never be blocked and this test might be a false-positive but
 * that should not be a problem. We will remove the check for MozInvalidForm
 * event, see bug 587671.
 */
document.forms[0].addEventListener("submit", function(aEvent) {
  ok(true, "novalidate has been correctly used for first form");
  document.getElementById('b').click();
}, {once: true});

document.forms[1].addEventListener("submit", function(aEvent) {
  ok(true, "novalidate has been correctly used for second form");
  var c = document.getElementById('c');
  c.focus();
  synthesizeKey("KEY_Enter");
}, {once: true});

document.forms[2].addEventListener("submit", function(aEvent) {
  ok(true, "novalidate has been correctly used for third form");
  SimpleTest.executeSoon(SimpleTest.finish);
}, {once: true});

/**
 * We have to be sure invalid events are not send too.
 * They should be sent before the submit event so we can just create a test
 * failure if we got one. All of them should be catched if sent.
 * At worst, we got random green which isn't harmful.
 */
function invalidHandling(aEvent)
{
  aEvent.target.removeEventListener("invalid", invalidHandling);
  ok(false, "invalid event should not be sent");
}

document.getElementById('av').addEventListener("invalid", invalidHandling);
document.getElementById('bv').addEventListener("invalid", invalidHandling);
document.getElementById('c').addEventListener("invalid", invalidHandling);

SimpleTest.waitForExplicitFinish();

// This is going to call all the tests (with a chain reaction).
SimpleTest.waitForFocus(function() {
  document.getElementById('a').click();
});

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

Messung V0.5 in Prozent
C=94 H=93 G=93

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik