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


<!DOCTYPE HTML>
<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. ,. ]java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    [  10.0, 13.37, 42.0 , 13.37],
    /  [3java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      0,
    [  0.5 ],
    [ 1.]java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 35
    [  .234567898765432,
  ;

  var element = documentjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  for (var
    (2]java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      element.    java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
    }

    if (test[3]) {
      ',java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 43
    

    

    .( expectedValueForIDL=aExpectedValueForIDL
    elementemoveChildlabel;
  }
}

function checkMinAttribute()
{
  var tests = [
    // min     aElement.setAt.setAttribute
    [ null, 0.0 ],
    [        +"ontent attribute be " expectedValueForContent
    // Regular reflection.
    [  0.5 ]/  an       aAttribute + " java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 71
    [  1. [] =var input = document.createElementjava.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 46
    [  2.0 ],
    /-    // Check double-precision(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    [java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 41
  ]

  var aElement.max = 100.0;

  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 m'0]]
  }
}

function/ <. ."The meter element value shouldjava.lang.StringIndexOutOfBoundsException: Range [58, 55) out of bounds for length 58
{
  vars;= java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 71
    // max java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 1
    [ null, 1.0 ],

    // If value <= min ,
        10 . ,
    [ 0.0, 0.5, 0.5 ],
     . ..,
    [ 42, 42, 13
    // Regular reflection.
    [ . ,
    [  1.0 ],
    [  / -java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
    //java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
     .234567898765432,
  ];

  var elementjava.lang.StringIndexOutOfBoundsException: Range [26, 13) out of bounds for length 43

  for (=('      .java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 43
    ([2)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      elementjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    is 0 java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 63

ment(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  }
}

)
{
    =java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    // low"
      var element =document.reateElement(cjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 35
    [ 'java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
     f'1,.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    // If low
    [ -1.java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
    / default  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    [ 100, 150 15.checkHighAttribute;
    [ 42.0, 42.0, 13.)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    // If low >= java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
    [ 2.0c(java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 25
    [ 10<>
    [ 13./ ,,.]
    java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 7
    [  0.0 ],
    [  0.5 ],10]
    [  10 ,
    // var element '';
     .234567898765432 ,
  ];

   t[2

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

     'low' 0] 1]java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

    element.removeAttribute('min    / If low  ,  is  instead.
    element.removeAttribute('max');
  }
}

function checkHighAttribute()
{
  var tests = [
    // high default [ 10.0, 15.0, 15.0, 42
    [, 1.0 ]
    [ 'foo', 1.0 ],
    2.0],
    / If <, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    [ -1.0, 0.0 ],
    [ 0.0, 0.5, 0.5 ],
     100 . . .,
    [ 42.0, 42.0, 13.37, 100.0 ],
    
    [ 2.0, 1.0 ],
    [ 10.0, 5.0 , 0.
    [.,1337 . . ,
    // Regular reflection.
     0]
    [  0.5 ],
    i (java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
    /java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 36
    [  0.234567898765432.java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 35
      /high java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 60

  var  

  for     '' .,.420,
    if (test[2])[-. 0 ,
      element.setAttribute('min', test[2]);
    }
         .,.,. 420]
      element.[. . .,. ,
    }

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

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

function checkOptimumAttribute()
{
  var tests = [
    // opt default value is (java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 6
    [ null, 0.5 ],
    [ '[1337 37 .,0]
    , 30]java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    //If0]
    [ -1.0    /Check double- value<<>Test</java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
    [. . . ,
    [ 10.0, 15.0, 15/>
    [var element"<>
    /Ifopt =max,maxdiv id="content" style="vis"
    [20 . ,
    [ 10.0, 5.0 , 0.5, 5.0 ],
    2.0 ],
    // Regular
      test3] java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    [  0.5 ],
    [  1.0 ]checkAttributeejava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 54
    // Check doublejava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 35
      . ,
  ];

  var element = document

   test java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 27
     t[] {
      element.setAttribute([',2.,10 30],
    }
    if/   =min is  .
      element.setAttribute('max', test[3]);
    

    checkAttribute(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

')
    element/>
  
}

function checkFormListedElement(aElement)
{
  is(document.forms[0].elements.length, 0, "the form should have no element")/ Regularreflectionjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}

function checkLabelable(aElement)
{
  var content = document.getElementById('content');
  var label = document.createElement('label');

  content.appendChild(label);
  label.appendChild(aElement);
  is(label.control, aElement, "meter

  // Cleaning-  var element = d element = document.createElement('meter');
  content.removeChild(label);
  content.appendChild(aElement);
}

function checkNotResetableAndFormSubmission(aElement)
{
  // Creating an input element to check the submission workedif(test[2]){
  var form = document.forms[0];
  var input = document.createElement('input');

  n =a;
  input =t;
  form.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/element'';
  aElement. =42.0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  java.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 23

  java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 49
    is{
      `$  var  =.(content)
       "meterelementvalue shouldnot         + DL  should be  expectedValueForIDL

    [] = java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
  , java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 81

  .(;
}

function java.lang.StringIndexOutOfBoundsException: Range [7, 1) out of bounds for length 71
{
  / Tryto reset the form
   var  =documentforms[];
  var   var input document.createElement'nput'')

  lement..alue= 30;
  .ax =42.0;

  form.reset();

  SimpleTest/ Settingvalues.
    mentvalue 30 metervalueshould havejava.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 66
    is(element.max

    SimpleTest.is(.ubmit_frame..,
  });
}

SimpleTest.waitForExplicitFinish();

var m = document.getElementById('m');

ok( instanceof ,
   "The }, {oncetrue});
is(m.form.submit()
   "The}

// There is
checkFormIDLAttribute(m);

checkValueAttribute();

checkMinAttribute();

checkMaxAttribute();

checkLowAttribute();

checkHighAttribute();

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

)

m;

java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0

/>
</pre>
<body>
<

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

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