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

Quelle  test_drag_drop_caret.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/base/test/test_drag_drop_caret.html


<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Bug 2037794 - Caret should be enabled if input is focused during a drag+drop operation</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
</head>
<body>

<div id="source">source text</div>
<input id="target">

<script>
const Ci = SpecialPowers.Ci;

function isCaretVisible() {
  return SpecialPowers.wrap(window).docShell
        .QueryInterface(Ci.nsIInterfaceRequestor)
        .getInterface(Ci.nsISelectionDisplay)
        .QueryInterface(Ci.nsISelectionController)
        .caretVisible;
}
const source = document.getElementById('source');
const target = document.getElementById('target');

add_task(async() => {
  getSelection().selectAllChildren(source);
  target.addEventListener('drop', () => {
    target.focus();
  }, {once: true});
  await synthesizePlainDragAndDrop({
    srcElement: source,
    destElement: target
  });
  is(document.activeElement, target, '<input> should have been focused by drop event listener.');
  is(target.value, 'source text''<input> should contain dropped text.');
  ok(isCaretVisible(), 'Caret should be visible, now that <input> is focused.');
});
</script>

</body>
</html>

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

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