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

Quelle  test_input_number_l10n.html

  Sprache: HTML
 

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


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

<head>
  <title>Test localization of number control input</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <script type="text/javascript" src="test_input_number_data.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <meta charset="UTF-8">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=844744">Mozilla Bug 844744</a>
<p id="display"></p>
<div id="content">
  <input id="input" type="number" step="any">
</div>
<pre id="test">
<script type="application/javascript">

/**
 * Test for Bug 844744
 * This test checks that localized input that is typed into <input type=number>
 * is correctly handled.
 **/
SimpleTest.waitForExplicitFinish();

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

var elem;

function runTest(test) {
  elem.lang = test.langTag;
  elem.value = 0;
  elem.focus();
  elem.select();
  sendString(test.inputWithGrouping);
  is(elem.value, """Test " + test.desc + " ('" + test.langTag +
                     "') localization with grouping separator");
  elem.value = 0;
  elem.select();
  sendString(test.inputWithoutGrouping);
  is(elem.valueAsNumber, test.value, "Test " + test.desc + " ('" + test.langTag +
                                     "') localization without grouping separator");
  is(elem.value, String(test.value), "Test " + test.desc + " ('" + test.langTag +
                                     "') localization without grouping separator as string");
}

function runInvalidInputTest(test) {
  elem.lang = test.langTag;
  elem.value = 0;
  elem.focus();
  elem.select();
  sendString(test.input);
  is(elem.value, """Test " + test.desc + " ('" + test.langTag +
                             "') with invalid input: " + test.input);
}

function startTests() {
  elem = document.getElementById("input");
  for (var test of tests) {
    runTest(test, elem);
  }
  for (var test of invalidTests) {
    runInvalidInputTest(test, elem);
  }
}

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

Messung V0.5 in Prozent
C=86 H=94 G=89

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