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

Quelle  test_rtl_native_key_bindings_gtk.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/widget/tests/test_rtl_native_key_bindings_gtk.html


<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8"/>
    <title>RTL native key bindings GTK</title>
    <!-- Any copyright is dedicated to the Public Domain.
         http://creativecommons.org/publicdomain/zero/1.0/ -->

    <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
  </head>
  <body>

    <input id="input" dir="rtl" type="text" value="שלום עולם">

    <textarea id="textarea" dir="rtl" cols="40">שלום עולם</textarea>

    <script type="text/javascript">
      // Before the fix, the word-selection commands were logical
      // (SelectWordPrevious / SelectWordNext), which moved in the opposite
      // visual direction.  The fix maps them to the physical SelectLeft2 /
      // SelectRight2 commands.

      SimpleTest.waitForExplicitFinish();

      // The text is two Hebrew words (shalom olam):
      //   index 0-3 = first word  (4 chars)
      //   index 4   = space
      //   index 5-8 = second word (4 chars)
      const WORD2_START = 5;

      function testElement(el) {
        el.focus();
        el.setSelectionRange(WORD2_START, WORD2_START);

        // Ctrl+Shift+Left: in RTL, visual left = toward higher offsets.
        synthesizeKey("KEY_ArrowLeft", {ctrlKey: true, shiftKey: true});
        ok(el.selectionStart != el.selectionEnd,
           el.id + ": Ctrl+Shift+Left should create a selection");
        is(el.selectionStart, WORD2_START,
           el.id + ": Ctrl+Shift+Left anchor should stay at " + WORD2_START);
        ok(el.selectionEnd > WORD2_START,
           el.id + ": Ctrl+Shift+Left should extend toward higher offsets " +
           "(got selectionEnd=" + el.selectionEnd + ")");

        // Reset cursor to the same position.
        el.setSelectionRange(WORD2_START, WORD2_START);

        // Ctrl+Shift+Right: in RTL, visual right = toward lower offsets.
        synthesizeKey("KEY_ArrowRight", {ctrlKey: true, shiftKey: true});
        ok(el.selectionStart != el.selectionEnd,
           el.id + ": Ctrl+Shift+Right should create a selection");
        ok(el.selectionStart < WORD2_START,
           el.id + ": Ctrl+Shift+Right should extend toward lower offsets " +
           "(got selectionStart=" + el.selectionStart + ")");
        is(el.selectionEnd, WORD2_START,
           el.id + ": Ctrl+Shift+Right anchor should stay at " + WORD2_START);
      }

      SimpleTest.waitForFocus(function() {
        testElement(document.getElementById("input"));
        testElement(document.getElementById("textarea"));
        SimpleTest.finish();
      });
    </script>
  </body>
</html>

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

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-09-29) ¤

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