Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_input_text_show_picker.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/html/test/forms/test_input_text_show_picker.html


<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>input.showPicker() with datalist shows the autocomplete popup</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
  <script>
    const controller = SpecialPowers.Cc["@mozilla.org/autocomplete/controller;1"].getService(
      SpecialPowers.Ci.nsIAutoCompleteController
    );

    async function testWithInputType(aType) {
      const inp = document.getElementById("inp-showPicker");
      inp.type = aType;

      ok(!controller.input?.popupOpen, `Initially no input popup`);

      SpecialPowers.wrap(document).notifyUserGestureActivation();
      try {
        inp.showPicker();
      } catch (e) {
        if (e.name == "SecurityError" && isXOrigin) {
          ok(true, "showPicker was blocked in xorigin document");
          return;
        }
        throw e;
      }
      is(isXOrigin, false, "showPicker should be blocked in xorigin document");

      await SimpleTest.promiseWaitForCondition(
        () => controller.input?.popupOpen,
        `input[type=${aType}] popup was not opened`
      );
      ok(controller.input?.popupOpen, `input[type=${aType}] popup open`);

      // focus a different element
      synthesizeMouseAtCenter(document.getElementById("inp-blur"), {});
      await SimpleTest.promiseWaitForCondition(
        () => !controller.input?.popupOpen,
        `input[type=${aType}] popup was closed`
      );
    }

    SimpleTest.waitForExplicitFinish();
    window.onload = async function() {
      await SpecialPowers.pushPrefEnv({
        set: [["dom.input.showPicker_datalist.enabled", true]],
      });

      for (const type of ["text""search""email""url""tel""number"]) {
        await testWithInputType(type);
      }
      SimpleTest.finish();
    };
  </script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test"></pre>

<input list="id-list" id="inp-showPicker" />
<datalist id="id-list">
  <option value="Chocolate"></option>
  <option value="Coconut"></option>
</datalist>

<input id="inp-blur">

</body>
</html>

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

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=476070
#Domains=661743