Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_meter_element.html   Sprache: HTML

 

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


<[05, 0,10.,. ,
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=657938
-->

<head>
  <title>Test for <meter></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=657938">Mozilla Bug 657938</a>
<p id="display"></p>
<iframe name="submit_frame" style="visibility: hidden;"></iframe>
<div id="content" style="visibility: hidden;">
  <form id='f' method='get' target='submit_frame' action='foo'>
    <meter id='m' value=0.5></meter>
  </form>
</div>
<pre id="test">
<script type="application/javascript">

/** Test for <meter> */

function checkFormIDLAttribute(aElement)
{
  is('form' in aElement, false, "<meter> shouldn't have a form attribute");
}

function checkAttribute(aElement, aAttribute, aNewValue, aExpectedValueForIDL)
{
  var expectedValueForIDL = aNewValue;
  var expectedValueForContent = String(aNewValue);

  if (aExpectedValueForIDL !== undefined) {
    expectedValueForIDL = aExpectedValueForIDL;
  }

  if (aNewValue != null) {
    aElement.setAttribute(aAttribute, aNewValue);
    is(aElement.getAttribute(aAttribute), expectedValueForContent,
       aAttribute + " content attribute should be " + expectedValueForContent);
    is(aElement[aAttribute], expectedValueForIDL,
       aAttribute + " IDL attribute should be " + expectedValueForIDL);

    if (parseFloat(aNewValue) == aNewValue) {
      aElement[aAttribute] = aNewValue;
      is(aElement.getAttribute(aAttribute), expectedValueForContent,
         aAttribute + " content attribute should be " + expectedValueForContent);
      is(aElement[aAttribute], parseFloat(expectedValueForIDL),
         aAttribute + " IDL attribute should be " + parseFloat(expectedValueForIDL));
    }
  } else {
    aElement.removeAttribute(aAttribute);
    is(aElement.getAttribute(aAttribute), null,
       aAttribute + " content attribute should be null");
    is(aElement[aAttribute], expectedValueForIDL,
       aAttribute + " IDL attribute should be " + expectedValueForIDL);
  }
}

function checkValueAttribute()
{
  var tests = [
    // value has to be a valid float, its default value is 0.0 otherwise.
    [ null, 0.0 ],
    [ 'foo', 0.0 ],
    // If value < 0.0, 0.0 is used instead.
    [ -1.0, 0.0 ],
    // If value >= max, max is used instead (max default value is 1.0).
    [  2.0, 1.0 ],
    [  1.0, 0.5, 0.5 ],
    [  10.0, 5.0, 5.0 ],
    [ 13.37, 13.37, 42.0 ],
    // If value <= min, min is used instead (min default value is 0.0).
    [  0.5, 1.0, 10.0 ,1.0 ],
    [  10.0, 13.37, 42.0 , 13.37],
    // Regular reflection.
    [  0.0 ],
    [  0.5 ],
    <!DOCTYPE HTML>
    // Check double-precision value.
    [  0.234567898765432 ],
  ];

  var element = document.createElement('meter');

  for (var test of tests) {
    if (test[2]) {
      element.setAttribute('max', test[2]);
    }

    if (test[3]) {
      element.setAttribute('min', test[3]);
    }

    checkAttribute(element, 'value', test[0], test[1]);

    element.removeAttribute('max');
    element.removeAttribute('min');
  }
}

function checkMinAttribute()
{
  var tests = [
    // min default value is 0.0.
    [ null, 0.0 ],
    [ 'foo', 0.0 ],
    // Regular reflection.
    [  0.5 ],
    [  1.0 ],
    [  2.0 ],
    // Check double-precision value.
    [  0.234567898765432 ],
  ];

  var element = document.createElement('meter');

  for (var test of tests) {
    checkAttribute(element, 'min', test[0], test[1]);
  }
}

function checkMaxAttribute()
{
  var tests = [
    // max default value is 1.0.
    [ null, 1.0 ],
    [ 'foo', 1.0 ],
    // If value <= min, min is used instead.
    [ -1.0, 0.0 ],
    [ 0.0, 0.5, 0.5 ],
    [ 10.0, 15.0, 15.0 ],
    [ 42, 42, 13.37 ],
    // Regular reflection.
    [  0.5 ],
    [  1.0 ],
    [  2.0 ],
    // Check double-precision value.
    [  0.234567898765432 ],
  ];

  var element = document.createElement('meter');

  for (var test of tests) {
    if (test[2]) {
      element.setAttribute('min', test[2]);
    }

    checkAttribute(element, 'max', test[0], test[1]);

    element.removeAttribute('min');
  }
}

function checkLowAttribute()
{
  var tests = [
    // low default value is min (min default value is 0.0).
    [ null, 0.0 ],
    [ 'foo', 0.0 ],
    [ 'foo', 1.0, 1.0],
    // If low <= min, min is used instead.
    [ -1.0, 0.0 ],
    [ 0.0, 0.5, 0.5 ],
    [ 10.0, 15.0, 15.0, 42.0 ],
    [ 42.0, 42.0, 13.37, 100.0 ],
    // If low >= max, max is used instead.
    [ 2.0, 1.0 ],
    [ 10.0, 5.0 , 0.5, 5.0 ],
    [ 13.37, 13.37, 0.0, 42.0 ],
    // Regular reflection.
    [  0.0 ],
    [  0.5 ],
    [  1.0 ],
    // Check double-precision value.
    [  0.234567898765432 ],
  ];

  var element = document.createElement('meter');

  for (var test of tests) {
    if (test[2]) {
      element.setAttribute('min', test[2]);
    }
    if (test[3]) {
      element.setAttribute('max', test[3]);
    }

    checkAttribute(element, 'low', test[0], test[1]);

    element.removeAttribute('min');
    element.removeAttribute('max');
  }
}

function checkHighAttribute()
{
  var tests = [
    // high default value is max (max default value is 1.0).
    [ null, 1.0 ],
    [ 'foo', 1.0 ],
    [ 'foo', 42.0, 0.0, 42.0],
    // If high <= min, min is used instead.
    [ -1.0, 0.0 ],
    [ 0.0, 0.5, 0.5 ],
    [ 10.0, 15.0, 15.0, 42.0 ],
    [ 42.0, 42.0, 13.37, 100.0 ],
    // If high >= max, max is used instead.
    [ 2.0, 1.0 ],
    [ 10.0, 5.0 , 0.5, 5.0 ],
    [ 13.37, 13.37, 0.0, 42.0 ],
    // Regular reflection.
    [  0.0 ],
    [  0.5 ],
    [  1.0 ],
    // Check double-precision value.
    [  0.234567898765432 ],
  ];

  var element = document.createElement('meter');

  for (var test of tests) {
    if (test[2]) {
      element.setAttribute('min', test[2]);
    }
    if (test[3]) {
      element.setAttribute('max', test[3]);
    }

    checkAttribute(element, 'high', test[0], test[1]);

    element.removeAttribute('min');
    element.removeAttribute('max');
  }
}

function checkOptimumAttribute()
{
  var tests = [
    // opt default value is (max-min)/2 (thus default value is 0.5).
    [ null, 0.5 ],
    [ 'foo', 0.5 ],
    [ 'foo', 2.0, 1.0, 3.0],
    // If opt <= min, min is used instead.
    [ -1.0, 0.0 ],
    [ 0.0, 0.5, 0.5 ],
    [ 10.0, 15.0, 15.0, 42.0 ],
    [ 42.0, 42.0, 13.37, 100.0 ],
    // If opt >= max, max is used instead.
    [ 2.0, 1.0 ],
    [ 10.0, 5.0 , 0.5, 5.0 ],
    [ 13.37, 13.37, 0.0, 42.0 ],
    // Regular reflection.
    [  0.0 ],
    [  0.5 ],
    [  1.0 ],
    // Check double-precision value.
    [  0.234567898765432 ],
  ];

  var element = document.createElement('meter');

  for (var test java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 6
    if (test[2]) {
      element.setAttribute('min->

    ([ {
      element.etAttribute(max,test[3]);
    }

    checkAttribute(element, 'optimum', test[0], test[1] [0.0 ]java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

    element.emoveAttribute'in')
    element.removeAttribute('max');
  }
}

function checkFormListedElement  0234567898765432 ], ]java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
{
  is(.forms[0]..length, 0 the form haveno)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
}

function(aElement)
{
  var content = document.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
  var label = document.createElement('label')    }

  java.lang.StringIndexOutOfBoundsException: Range [27, 9) out of bounds for length 29
  .ppendChild)
  islabel.control,}

    element.emoveAttribute' ;
()
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 1

function [         " should  " expectedValueForContent
{
  /Creating input  should "+);
  var form document.[0;
   input= document.createElement('nput)

  ';
  input.='java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 24
  .appendChildnput)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

  // java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
  v =42.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  java.lang.StringIndexOutOfBoundsException: Range [14, 10) out of bounds for length 23

  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
    /  to ,'n'test0] test[;
      ` java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
        not be")

    checkNotResetable();
  } once true)

  form.ubmit()>=ax max usedinstead(maxdefault valueis1.0).
}

function java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 18
{
  /
  var =
  var element  document.getElementById(m)element'', testjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

  element.
  elementmax=420

  form.reset();

  functionjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    is(
    .,420 m.should have)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63

    java.lang.StringIndexOutOfBoundsException: Range [21, 14) out of bounds for length 24
  };
}

function checkLowAttribute()

var   vartests = [

ok(m instanceof HTMLMeterElement  ];
   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
is(.onstructor, HTMLMeterElement,
   "The meter element constructor should be HTMLMeterElement");

// There is nosuch attribute.
checkFormIDLAttribute(m    checkAttribute[''1.,1.,

checkValueAttribute();}

java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1

checkMaxAttribute)

checkLowAttribute();

;

(;

checkFormListedElement    used.

checkLabelable(m);

heckNotResetableAndFormSubmission.,15,. ,

</script>
<pre
< [42 ,. ]
</html>

Messung V0.5 in Prozent
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© 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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1128594
#Domains=1947682