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

Quelle  test_spacetopagedown.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/tests/mochitest/general/test_spacetopagedown.html


<html>
<head>
  <meta charset="utf-8">
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
  <script type="application/javascript">

SimpleTest.waitForExplicitFinish();


var windowUtils = SpecialPowers.getDOMWindowUtils(window);

function pressKey(isShift)
{
  return new Promise(resolve => {
    synthesizeKey(" ", { shiftKey: isShift });
    windowUtils.advanceTimeAndRefresh(100);
    SimpleTest.executeSoon(resolve);
  });
}

function initTest()
{
  SpecialPowers.pushPrefEnv({"set":[["general.smoothScroll", false]]}, runTest);
}

function runTest()
{
  (async function() {
    await pressKey(false);

    ok(window.scrollY > 0, "Space with no focus" + window.scrollY);
    await pressKey(true);
    is(window.scrollY, 0, "Shift+Space with no focus");

    let checkbox = document.getElementById("checkbox");
    checkbox.focus();
    await pressKey(false);

    is(window.scrollY, 0, "Space with checkbox focused");
    ok(checkbox.checked, "Space with checkbox focused, checked");
    await pressKey(true);
    is(window.scrollY, 0, "Shift+Space with checkbox focused");
    ok(!checkbox.checked, "Space with checkbox focused, unchecked");

    let input = document.getElementById("input");
    input.focus();
    await pressKey(false);
    is(window.scrollY, 0, "Space with input focused");
    is(input.value, " ""Space with input focused, value");
    await pressKey(true);
    is(window.scrollY, 0, "Shift+Space with input focused");
    is(input.value, " ""Space with input focused, value");

    windowUtils.restoreNormalRefresh();
    SimpleTest.finish();
  })();
}

  </script>
</head>
<body onload="SimpleTest.waitForFocus(initTest)">

<input id="checkbox" type="checkbox">Checkbox
<input id="input">
<p style="height: 4000px">Text</p>

<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

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

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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