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

Quelle  test_bug595449.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/html/test/test_bug595449.html


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

<head>
  <title>Test for Bug 595449</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=595449">Mozilla Bug 595449</a>
<p id="display"></p>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 595449 **/

var fieldset = document.createElement("fieldset");

ok("elements" in fieldset,
   "fieldset element should have an 'elements' IDL attribute");

ok(fieldset.elements instanceof HTMLCollection,
   "fieldset.elements should be an instance of HTMLCollection");

// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23356
todo(fieldset.elements instanceof HTMLFormControlsCollection,
     "fieldset.elements should be an instance of HTMLFormControlsCollection");

is(fieldset.elements.length, 0"Nothing should be in fieldset.elements");

var oldElements = fieldset.elements;

is(fieldset.elements, oldElements,
   "fieldset.elements should always return the same object");

var tmpElement = document.createElement("input");

fieldset.appendChild(tmpElement);

is(fieldset.elements.length, 1,
   "fieldset.elements should now contain one element");

is(fieldset.elements[0], tmpElement,
   "fieldset.elements[0] should be the input element");

tmpElement.name = "foo";
is(fieldset.elements.foo, tmpElement,
   "we should be able to access to an element using it's name as a property on .elements");

is(fieldset.elements, oldElements,
   "fieldset.elements should always return the same object");

fieldset.removeChild(tmpElement);

var testData = [
  [ "<input>"1 , [ HTMLInputElement ] ],
  [ "<button></button>"1, [ HTMLButtonElement ] ],
  [ "<button><input></button>"2, [ HTMLButtonElement, HTMLInputElement ] ],
  [ "<object>"1, [ HTMLObjectElement ] ],
  [ "<output></output>"1, [ HTMLOutputElement ] ],
  [ "<select></select>"1, [ HTMLSelectElement ] ],
  [ "<select><option>foo</option></select>"1, [ HTMLSelectElement ] ],
  [ "<select><option>foo</option><input></select>"2, [ HTMLSelectElement, HTMLInputElement ] ],
  [ "<textarea></textarea>"1, [ HTMLTextAreaElement ] ],
  [ "<label>foo</label>"0 ],
  [ "<progress>"0 ],
  [ "<meter>"0 ],
  [ "<keygen>"0 ],
  [ "<legend></legend>"0 ],
  [ "<legend><input></legend>"1, [ HTMLInputElement ] ],
  [ "<legend><input></legend><legend><input></legend>"2, [ HTMLInputElement, HTMLInputElement ] ],
  [ "<legend><input></legend><input>"2, [ HTMLInputElement, HTMLInputElement ] ],
  [ "<fieldset></fieldset>"1, [ HTMLFieldSetElement ] ],
  [ "<fieldset><input></fieldset>"2, [ HTMLFieldSetElement, HTMLInputElement ] ],
  [ "<fieldset><fieldset><input></fieldset></fieldset>"3, [ HTMLFieldSetElement, HTMLFieldSetElement, HTMLInputElement ] ],
  [ "<button></button><fieldset></fieldset><input><keygen><object><output></output><select></select><textarea></textarea>"7, [ HTMLButtonElement, HTMLFieldSetElement, HTMLInputElement, HTMLObjectElement, HTMLOutputElement, HTMLSelectElement, HTMLTextAreaElement ] ],
];

for (var data of testData) {
  fieldset.innerHTML = data[0];
  is(fieldset.elements.length, data[1],
     "fieldset.elements should contain " + data[1] + " elements");

  for (var i=0; i<data[1]; ++i) {
    ok(fieldset.elements[i] instanceof data[2][i],
       "fieldset.elements[" + i + "] should be instance of " + data[2][i])
  }
}

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

Messung V0.5 in Prozent
C=92 H=89 G=90

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