Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/html/test/forms/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 4 kB image not shown  

Quelle  test_input_radio_indeterminate.html   Sprache: HTML

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


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

<head>
  <title>Test for Bug 885359</title>
  <script src="/tests/SimpleTest/SimpleTest.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=885359">Mozilla Bug 343444</a>
<p id="display"></p>
<form>
  <input type="radio" id='radio1'/><br/>

  <input type="radio" id="g1radio1" name="group1"/>
  <input type="radio" id="g1radio2" name="group1"/></br>
  <input type="radio" id="g1radio3" name="group1"/></br>

  <input type="radio" id="g2radio1" name="group2"/>
  <input type="radio" id="g2radio2" name="group2" checked/></br>
</form>
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();

var radio1 = document.getElementById("radio1");
var g1radio1 = document.getElementById("g1radio1");
var g1radio2 = document.getElementById("g1radio2");
var g1radio3 = document.getElementById("g1radio3");
var g2radio1 = document.getElementById("g2radio1");
var g2radio2 = document.getElementById("g2radio2");

SimpleTest.waitForFocus(function() {
  test();
  SimpleTest.finish();
});

function verifyIndeterminateState(aElement, aIsIndeterminate, aMessage) {
  is(aElement.mozMatchesSelector(':indeterminate'), aIsIndeterminate, aMessage);
}

function test() {
  // Initial State.
  verifyIndeterminateState(radio1, true,
    "Unchecked radio in its own group (no name attribute)");
  verifyIndeterminateState(g1radio1, true, "No selected radio in its group");
  verifyIndeterminateState(g1radio2, true, "No selected radio in its group");
  verifyIndeterminateState(g1radio3, true, "No selected radio in its group");
  verifyIndeterminateState(g2radio1, false, "Selected radio in its group");
  verifyIndeterminateState(g2radio2, false, "Selected radio in its group");

  // Selecting radio buttion.
  g1radio1.checked = true;
  verifyIndeterminateState(g1radio1, false,
    "Selecting a radio should affect all radios in the group");
  verifyIndeterminateState(g1radio2, false,
    "Selecting a radio should affect all radios in the group");
  verifyIndeterminateState(g1radio3, false,
    "Selecting a radio should affect all radios in the group");

  // Changing the selected radio button.
  g1radio3.checked = true;
  verifyIndeterminateState(g1radio1, false,
    "Selecting a radio should affect all radios in the group");
  verifyIndeterminateState(g1radio2, false,
    "Selecting a radio should affect all radios in the group");
  verifyIndeterminateState(g1radio3, false,
    "Selecting a radio should affect all radios in the group");

  // Deselecting radio button.
  g2radio2.checked = false;
  verifyIndeterminateState(g2radio1, true,
    "Deselecting a radio should affect all radios in the group");
  verifyIndeterminateState(g2radio2, true,
    "Deselecting a radio should affect all radios in the group");

  // Move a selected radio button to another group.
  g1radio3.name = "group2";

  // The radios' state in the original group becomes indeterminated.
  verifyIndeterminateState(g1radio1, true,
    "Removing a radio from a group should affect all radios in the group");
  verifyIndeterminateState(g1radio2, true,
    "Removing a radio from a group should affect all radios in the group");

  // The radios' state in the new group becomes determinated.
  verifyIndeterminateState(g1radio3, false,
    "Adding a radio from a group should affect all radios in the group");
  verifyIndeterminateState(g2radio1, false,
    "Adding a radio from a group should affect all radios in the group");
  verifyIndeterminateState(g2radio2, false,
    "Adding a radio from a group should affect all radios in the group");

  // Change input type to 'text'.
  g1radio3.type = "text";
  verifyIndeterminateState(g1radio3, false,
    "Input type text does not have an indeterminate state");
  verifyIndeterminateState(g2radio1, true,
    "Changing input type should affect all radios in the group");
  verifyIndeterminateState(g2radio2, true,
    "Changing input type should affect all radios in the group");
}
</script>
</pre>
</body>
</html>


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

¤ Dauer der Verarbeitung: 0.10 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.