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

Quelle  test_legacy_touch_api.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/events/test/test_legacy_touch_api.html


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

<head>
  <meta charset="utf-8">
  <title>Test for Bug 1412485</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript">

  /** Test for Bug 1412485 */
  SimpleTest.waitForExplicitFinish();

  function testExistenceOfLegacyTouchAPIs(win, enabled) {
    try {
      var event = document.createEvent("TouchEvent");
      ok(event instanceof TouchEvent, "Should be able to create TouchEvent using createEvent.");
    } catch(ex) {
      ok(true, "Shouldn't be able create TouchEvent using createEvent.");
    }

    var targets = [win, win.document, win.document.body];
    for (target of targets) {
      is("ontouchstart" in target, enabled, `ontouchstart on target [${enabled}].`);
      is("ontouchend" in target, enabled, `ontouchend on target [${enabled}].`);
      is("ontouchmove" in target, enabled, `ontouchmove on target [${enabled}].`);
      is("ontouchcancel" in target, enabled, `ontouchcancel on target [${enabled}].`);
    }

    is("createTouch" in win.document, enabled, `createTouch on Document [${enabled}].`);
    is("createTouchList" in win.document, enabled, `createTouchList on Document [${enabled}].`);
  }

  function test() {
    // Test the defaults.
    testExistenceOfLegacyTouchAPIs(window,
                                   navigator.userAgent.includes("Android"));

    // Test explicitly enabling touch APIs.
    SpecialPowers.pushPrefEnv({"set": [["dom.w3c_touch_events.enabled"1],
                                       ["dom.w3c_touch_events.legacy_apis.enabled", true]]},
      function() {
        var iframe = document.createElement("iframe");
        iframe.onload = function() {
          testExistenceOfLegacyTouchAPIs(iframe.contentWindow, true);
          SimpleTest.finish();
        }
        document.body.appendChild(iframe);
      });
  }

  </script>
</head>
<body onload="test()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1412485">Mozilla Bug 1412485</a>
<p id="display"></p>
<div id="content" style="display: none">

</div>
<pre id="test">
</pre>
</body>
</html>

Messung V0.5 in Prozent
C=82 H=97 G=89

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-08-25) ¤

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