Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  helper_bug1839095.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/gfx/layers/apz/test/mochitest/helper_bug1839095.html


<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<title>Test that preventDefault() in a dynamically-added touchmove listener prevents scrolling</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<script src="apz_test_utils.js"></script>
<script src="apz_test_native_event_utils.js"></script>
<div style="height: 500vh;"></div>
<script>
async function test() {
  // A passive touchstart listener dynamically adds an active touchmove
  // listener that calls preventDefault(). APZ must re-hit-test on the first
  // touchmove to discover the new listener and wait for a content response,
  // so that the preventDefault() is respected and scrolling is suppressed.
  const touchstartPromise = new Promise(resolve => {
    window.addEventListener("touchstart", () => {
      document.addEventListener("touchmove", e => {
        e.preventDefault();
      }, { passive: false, once: true });
      resolve();
    }, { passive: true, once: true });
  });

  await promiseApzFlushedRepaints();

  await synthesizeNativeTouch(window, 100200,
                              SpecialPowers.DOMWindowUtils.TOUCH_CONTACT);
  await touchstartPromise;

  // Though as of now fast-path notifiction explicitly schedules a paint,
  // it will not in future, so wait two requestAnimationFrames rather than
  // waiting for a paint.
  await promiseFrame();
  await promiseFrame();

  await synthesizeNativeTouch(window, 100150,
                              SpecialPowers.DOMWindowUtils.TOUCH_CONTACT);
  await synthesizeNativeTouch(window, 100100,
                              SpecialPowers.DOMWindowUtils.TOUCH_CONTACT);
  await synthesizeNativeTouch(window, 100100,
                              SpecialPowers.DOMWindowUtils.TOUCH_REMOVE);

  await promiseApzFlushedRepaints();

  is(window.scrollY, 0"Should not have scrolled");
}

waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</html>

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

¤ 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002