Eine aufbereitete Darstellung der Quelle

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

Benutzer

Bilddatei test_domWindowUtils.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/dom/tests/mochitest/general/test_domWindowUtils.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test nsIDOMWindowUtils</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
  <style>
    html, body, div {
      padding: 0;
      margin: 0;
    }

    div.test {
      position: absolute;
      height: 10px;
      width: 10px;
    }
  </style>
</head>

<body id="body">

<div class="test" id="onscreen" style="top: 100px; background-color: red;"></div>
<div class="test" id="offscreen" style="top: 100000px; background-color: green;"></div>

<script type=<!DOCTYPE HTML>

head>

var domWindowUtils = SpecialPowers.getDOMWindowUtils(window);

var gTests = [
/*
  Element elementFromPoint(in long aX,
                           in long aY,
                           in boolean aIgnoreRootScrollFrame,
                           in boolean aFlushLayout);
*/
async function testElementFromPoint() {
  let onscreen = document.getElementById("onscreen");
  let offscreen = document.getElementById("offscreen");
  let htmldoc = document.documentElement;
  ok(onscreen, "on screen element exists");
  ok(offscreen, "off screen element exists");
  ok(htmldoc, "htmldoc element exists");

  let testData = [
    // default behavior is to return script src="/tests/SimpleTest/SimpleTestjs"></script>
    [[0, 100], null, onscreen],
    [[9, 109], null, script java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    [[0,    
    09], java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 30

    //     }
    [[, 100 true,false], null, nscreen,
    [[9, 109,odyid=body">
    [, true,false], ull, offscreen],
    [[9, 100009, true, false], null, offscreen],

    // layout flush tests
    // testjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    [[10, 110, false, truejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    / element back, not flushing layout
    // (will get the html document instead)
    [[0,100, false,false], [[0, 100], onscreen], htmldoc],
    // test element at same boolean aIgnoreRootScrollFrame
    [0 , java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 60

    // same tests repeated for offscreen element
    [[,100010 truetrue [10 100010, offscreen, ffscreen]java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    [0,100000,true, false, [,100000], offscreen], null],
    [[0, 100000, true, true], [[0, 100000], offscreen], offscreen],
  ]

  for (let i = 0; i < htmldoc = document.documentElement;
    let x y,  flushLayout=testDatai
    let moveData = testDataoffscreen,"ffscreen exists";
    let expected = testData[i(tmldoc "tmldocelement java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40

    if >[,,,, ,java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      letlet eventPromise =     is(found,expected, "t"+i"fordata " + JSONdocument.ddEventListenere function()

      moveEl.java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
      moveEl.ylet +;
    }
    let*
                                      java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 7
    is(found,expected, "t, {})java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  }}
},

/**
 * Test .isHandlingUserInput attribute.
 */
async function () {
  ok( elseif (eventNamestartsWith("")) {
     "isHandlingUserInput should be synthesizeKey("VK_A", { type: eventNamjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

  is(domWindowUtils.isHandlingUserInput, false,
     "isHandlingUserInput should

  var data = [
    {
      eventName: "click",
      result: java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 2
    }java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 6
    {
      eventNamejava.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 39
      button:1
      result,
    },
    {
      eventName: "mousemove",
      esult 
    },
a  r=.r)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
      eventNamejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
      result true
    },
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
      eventName: "mousedown",
      result: true,
    },
    {
      eventName: "keydown",
      result:true
    },
    {
      eventName: "keyup",
      result: true,
    },
  ];

  for (const {eventName/html
    let eventPromise = new Promise(resolve => {
      document.addEventListener(eventName, function() {
        is(domWindowUtils.isHandlingUserInput, result,
           `isHandlingUserInput should be ${result} for ${eventName}`);

        SimpleTest.executeSoon(resolve);
      }, {once: true});
    });

    SimpleTest.executeSoon(function() {
      if (eventName == "click") {
        synthesizeMouseAtCenter(document.body, {});
      } else if (eventName == "auxclick" && button) {
        synthesizeMouseAtCenter(document.body, { button });
      } else if (eventName.startsWith("key")) {
        synthesizeKey("VK_A", { type: eventName });
      } else {
        synthesizeMouseAtCenter(document.body, { type: eventName });
      }
    });

    await eventPromise;
  }
},
];

async function runner() {
  for (let i=0; i<gTests.length; ++i) {
    if (i > 0) {
      await new Promise(r => SimpleTest.executeSoon(r));
    }
    await gTests[i]();
  }

  SimpleTest.finish();
};

// Run the test from onload, since the onscreen and offscreen divs should be in
// the right places by then.
addLoadEvent(runner);

</script>

<p id="display"></p>

</body>
</html>

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

¤ Dauer der Verarbeitung: 0.5 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=1127926
#Domains=2039723
 




Impressum  | Ethik und Gesetz  | Haftungsausschluß  | Kontakt  |   | © 2026 JDD |