Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_bug1101364.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/base/test/test_bug1101364.html


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

<head>
<title>Test for Bug 1101364</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/WindowSnapshot.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <style>
    #test1 {
      user-select: none;
    }

    #testDiv, #test2 {
      user-select: text;
    }
  </style>
</head>
<body id='body'>

<iframe id="test1" srcdoc="

Header

test1
"
></iframe>
<iframe id="test2" srcdoc="
AAABBB
"
></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async () => {
  await (async () => {
    const iframe = document.getElementById("test1");
    iframe.focus();
    const docShell = SpecialPowers.wrap(iframe.contentWindow).docShell;

    docShell.doCommand("cmd_selectAll");
    info(
      "Waiting for getting screenshot of \"Select All\" without contenteditable..."
    );
    const withoutContenteditable = await snapshotWindow(iframe.contentWindow);

    iframe.contentDocument
      .getElementById("testDiv")
      .setAttribute("contentEditable", true);
    docShell.doCommand("cmd_selectAll");
    info(
      "Waiting for getting screenshot of \"Select All\" in contenteditable..."
    );
    const withContenteditable = await snapshotWindow(iframe.contentWindow);
    const result =
      compareSnapshots(withoutContenteditable, withContenteditable, true);
    ok(
      result[0],
      `Select all should look identical\ngot: ${
        result[2]
      }\nexpected: ${result[1]}`
    );
  })();

  await (async () => {
    const iframe = document.getElementById("test2");
    iframe.focus();
    iframe.contentDocument.querySelector("div[contenteditable]").focus();
    const docShell = SpecialPowers.wrap(iframe.contentWindow).docShell;
    const test2Inner = iframe.contentDocument.getElementById("test2Inner");
    test2Inner.style.MozUserSelect = "text";
    docShell.doCommand("cmd_selectAll");
    info(
      "Waiting for getting screenshot of \"Select All\" in contenteditable (use-select: text)..."
    );
    const withoutUserSelect = await snapshotWindow(iframe.contentWindow);

    test2Inner.style.MozUserSelect = "none";
    docShell.doCommand("cmd_selectAll");
    info(
      "Waiting for getting screenshot of \"Select All\" in contenteditable (use-select: none)..."
    );
    const withUserSelect = await snapshotWindow(iframe.contentWindow);
    const result = compareSnapshots(withoutUserSelect, withUserSelect, true);
    ok(
      result[0],
      `Editable fields should ignore user select style\ngot: ${
        result[2]
      }\nexpected: ${result[1]}`
    );
  })();

  SimpleTest.finish();
});
</script>
</pre>
</body>
</html>

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

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge