зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1515942 - Enable ESLint for gfx/ (fix quotes only). r=jrmuizel
This changes single quotes to double quotes in one patch to match our ESLint rules. This used ESLint's automatic fixing. Differential Revision: https://phabricator.services.mozilla.com/D15204 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
463964570d
Коммит
2994d04574
|
@ -18,12 +18,12 @@ function convertEntries(entries) {
|
|||
|
||||
function getPropertyAsRect(scrollFrames, scrollId, prop) {
|
||||
SimpleTest.ok(scrollId in scrollFrames,
|
||||
'expected scroll frame data for scroll id ' + scrollId);
|
||||
"expected scroll frame data for scroll id " + scrollId);
|
||||
var scrollFrameData = scrollFrames[scrollId];
|
||||
SimpleTest.ok('displayport' in scrollFrameData,
|
||||
'expected a ' + prop + ' for scroll id ' + scrollId);
|
||||
SimpleTest.ok("displayport" in scrollFrameData,
|
||||
"expected a " + prop + " for scroll id " + scrollId);
|
||||
var value = scrollFrameData[prop];
|
||||
var pieces = value.replace(/[()\s]+/g, '').split(',');
|
||||
var pieces = value.replace(/[()\s]+/g, "").split(",");
|
||||
SimpleTest.is(pieces.length, 4, "expected string of form (x,y,w,h)");
|
||||
return { x: parseInt(pieces[0]),
|
||||
y: parseInt(pieces[1]),
|
||||
|
@ -227,7 +227,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
|
|||
if (w.ApzCleanup) { // guard against the subtest not loading apz_test_utils.js
|
||||
w.ApzCleanup.execute();
|
||||
}
|
||||
if (typeof test.dp_suppression != 'undefined') {
|
||||
if (typeof test.dp_suppression != "undefined") {
|
||||
// We modified the suppression when starting the test, so now undo that.
|
||||
SpecialPowers.getDOMWindowUtils(window).respectDisplayPortSuppression(!test.dp_suppression);
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
|
|||
|
||||
SimpleTest.ok(true, "Starting subtest " + test.file);
|
||||
|
||||
if (typeof test.dp_suppression != 'undefined') {
|
||||
if (typeof test.dp_suppression != "undefined") {
|
||||
// Normally during a test, the displayport will get suppressed during page
|
||||
// load, and unsuppressed at a non-deterministic time during the test. The
|
||||
// unsuppression can trigger a repaint which interferes with the test, so
|
||||
|
@ -271,7 +271,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
|
|||
}
|
||||
|
||||
function spawnTest(aFile) {
|
||||
w = window.open('', "_blank");
|
||||
w = window.open("", "_blank");
|
||||
w.subtestDone = advanceSubtestExecution;
|
||||
w.isApzSubtest = true;
|
||||
w.SimpleTest = SimpleTest;
|
||||
|
@ -285,12 +285,12 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
|
|||
w.todo_is = function(a, b, msg) { return todo_is(a, b, aFile + " | " + msg); };
|
||||
w.todo = function(cond, msg) { return todo(cond, aFile + " | " + msg); };
|
||||
if (test.onload) {
|
||||
w.addEventListener('load', function(e) { test.onload(w); }, { once: true });
|
||||
w.addEventListener("load", function(e) { test.onload(w); }, { once: true });
|
||||
}
|
||||
var subtestUrl = location.href.substring(0, location.href.lastIndexOf('/') + 1) + aFile;
|
||||
var subtestUrl = location.href.substring(0, location.href.lastIndexOf("/") + 1) + aFile;
|
||||
function urlResolves(url) {
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET', url, false);
|
||||
request.open("GET", url, false);
|
||||
request.send();
|
||||
return request.status !== 404;
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) {
|
|||
}
|
||||
|
||||
function pushPrefs(prefs) {
|
||||
return SpecialPowers.pushPrefEnv({'set': prefs});
|
||||
return SpecialPowers.pushPrefEnv({"set": prefs});
|
||||
}
|
||||
|
||||
async function waitUntilApzStable() {
|
||||
|
@ -338,9 +338,9 @@ async function waitUntilApzStable() {
|
|||
function parentProcessFlush() {
|
||||
addMessageListener("apz-flush", function() {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var topWin = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!topWin) {
|
||||
topWin = Services.wm.getMostRecentWindow('navigator:geckoview');
|
||||
topWin = Services.wm.getMostRecentWindow("navigator:geckoview");
|
||||
}
|
||||
var topUtils = topWin.windowUtils;
|
||||
|
||||
|
@ -481,11 +481,11 @@ function runContinuation(testFunction) {
|
|||
// The snapshot is returned in the form of a data URL.
|
||||
function getSnapshot(rect) {
|
||||
function parentProcessSnapshot() {
|
||||
addMessageListener('snapshot', function(rect) {
|
||||
ChromeUtils.import('resource://gre/modules/Services.jsm');
|
||||
var topWin = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
addMessageListener("snapshot", function(rect) {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!topWin) {
|
||||
topWin = Services.wm.getMostRecentWindow('navigator:geckoview');
|
||||
topWin = Services.wm.getMostRecentWindow("navigator:geckoview");
|
||||
}
|
||||
|
||||
// reposition the rect relative to the top-level browser window
|
||||
|
@ -498,18 +498,18 @@ function getSnapshot(rect) {
|
|||
canvas.width = rect.w;
|
||||
canvas.height = rect.h;
|
||||
var ctx = canvas.getContext("2d");
|
||||
ctx.drawWindow(topWin, rect.x, rect.y, rect.w, rect.h, 'rgb(255,255,255)', ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_CARET);
|
||||
ctx.drawWindow(topWin, rect.x, rect.y, rect.w, rect.h, "rgb(255,255,255)", ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_CARET);
|
||||
return canvas.toDataURL();
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof getSnapshot.chromeHelper == 'undefined') {
|
||||
if (typeof getSnapshot.chromeHelper == "undefined") {
|
||||
// This is the first time getSnapshot is being called; do initialization
|
||||
getSnapshot.chromeHelper = SpecialPowers.loadChromeScript(parentProcessSnapshot);
|
||||
ApzCleanup.register(function() { getSnapshot.chromeHelper.destroy() });
|
||||
}
|
||||
|
||||
return getSnapshot.chromeHelper.sendSyncMessage('snapshot', JSON.stringify(rect)).toString();
|
||||
return getSnapshot.chromeHelper.sendSyncMessage("snapshot", JSON.stringify(rect)).toString();
|
||||
}
|
||||
|
||||
// Takes the document's query string and parses it, assuming the query string
|
||||
|
@ -524,9 +524,9 @@ function getSnapshot(rect) {
|
|||
function getQueryArgs() {
|
||||
var args = {};
|
||||
if (location.search.length > 0) {
|
||||
var params = location.search.substr(1).split('&');
|
||||
var params = location.search.substr(1).split("&");
|
||||
for (var p of params) {
|
||||
var [k, v] = p.split('=');
|
||||
var [k, v] = p.split("=");
|
||||
args[k] = JSON.parse(v);
|
||||
}
|
||||
}
|
||||
|
@ -545,17 +545,17 @@ function getQueryArgs() {
|
|||
function injectScript(aScript, aWindow = window) {
|
||||
return function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var e = aWindow.document.createElement('script');
|
||||
e.type = 'text/javascript';
|
||||
var e = aWindow.document.createElement("script");
|
||||
e.type = "text/javascript";
|
||||
e.onload = function() {
|
||||
resolve();
|
||||
};
|
||||
e.onerror = function() {
|
||||
dump('Script [' + aScript + '] errored out\n');
|
||||
dump("Script [" + aScript + "] errored out\n");
|
||||
reject();
|
||||
};
|
||||
e.src = aScript;
|
||||
aWindow.document.getElementsByTagName('head')[0].appendChild(e);
|
||||
aWindow.document.getElementsByTagName("head")[0].appendChild(e);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -570,8 +570,8 @@ function injectScript(aScript, aWindow = window) {
|
|||
function getHitTestConfig() {
|
||||
if (!("hitTestConfig" in window)) {
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
var isWebRender = (utils.layerManagerType == 'WebRender');
|
||||
var isWindows = (getPlatform() == 'windows');
|
||||
var isWebRender = (utils.layerManagerType == "WebRender");
|
||||
var isWindows = (getPlatform() == "windows");
|
||||
window.hitTestConfig = { utils, isWebRender, isWindows };
|
||||
}
|
||||
return window.hitTestConfig;
|
||||
|
|
|
@ -31,19 +31,19 @@ function* doubleTapOn(element, x, y, testDriver) {
|
|||
function* test(testDriver) {
|
||||
var resolution = getResolution();
|
||||
ok(resolution > 0,
|
||||
'The initial_resolution is ' + resolution + ', which is some sane value');
|
||||
"The initial_resolution is " + resolution + ", which is some sane value");
|
||||
|
||||
// Check that double-tapping once zooms in
|
||||
yield* doubleTapOn(document.getElementById('target'), 10, 10, testDriver);
|
||||
yield* doubleTapOn(document.getElementById("target"), 10, 10, testDriver);
|
||||
var prev_resolution = resolution;
|
||||
resolution = getResolution();
|
||||
ok(resolution > prev_resolution, 'The first double-tap has increased the resolution to ' + resolution);
|
||||
ok(resolution > prev_resolution, "The first double-tap has increased the resolution to " + resolution);
|
||||
|
||||
// Check that double-tapping again on the same spot zooms out
|
||||
yield* doubleTapOn(document.getElementById('target'), 10, 10, testDriver);
|
||||
yield* doubleTapOn(document.getElementById("target"), 10, 10, testDriver);
|
||||
prev_resolution = resolution;
|
||||
resolution = getResolution();
|
||||
ok(resolution < prev_resolution, 'The second double-tap has decreased the resolution to ' + resolution);
|
||||
ok(resolution < prev_resolution, "The second double-tap has decreased the resolution to " + resolution);
|
||||
}
|
||||
|
||||
waitUntilApzStable()
|
||||
|
|
|
@ -25,7 +25,7 @@ function* test(testDriver) {
|
|||
|
||||
var initial_resolution = getResolution();
|
||||
ok(initial_resolution > 0,
|
||||
'The initial_resolution is ' + initial_resolution + ', which is some sane value');
|
||||
"The initial_resolution is " + initial_resolution + ", which is some sane value");
|
||||
|
||||
// This listener will trigger the test to continue once APZ is done with
|
||||
// processing the scroll.
|
||||
|
@ -53,7 +53,7 @@ function* test(testDriver) {
|
|||
// Flush state and get the resolution we're at now
|
||||
yield waitForApzFlushedRepaints(testDriver);
|
||||
let final_resolution = getResolution();
|
||||
ok(final_resolution > initial_resolution, 'The final resolution (' + final_resolution + ') is greater after zooming in');
|
||||
ok(final_resolution > initial_resolution, "The final resolution (" + final_resolution + ") is greater after zooming in");
|
||||
|
||||
// Check we've got the expected events.
|
||||
// Pinch-zooming the page should fire visual viewport resize events:
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var v = document.getElementById('video');
|
||||
var a = document.getElementById('audio');
|
||||
var d = document.getElementById('div');
|
||||
var v = document.getElementById("video");
|
||||
var a = document.getElementById("audio");
|
||||
var d = document.getElementById("div");
|
||||
|
||||
document.body.ontouchstart = function(e) {
|
||||
if (e.target === v || e.target === a || e.target === d) {
|
||||
e.target.style.display = 'none';
|
||||
ok(true, 'Set display to none on #' + e.target.id);
|
||||
e.target.style.display = "none";
|
||||
ok(true, "Set display to none on #" + e.target.id);
|
||||
} else {
|
||||
ok(false, 'Got unexpected touchstart on ' + e.target);
|
||||
ok(false, "Got unexpected touchstart on " + e.target);
|
||||
}
|
||||
waitForAllPaints(testDriver);
|
||||
};
|
||||
|
@ -27,7 +27,7 @@ function* test(testDriver) {
|
|||
document.body.ontouchend = function(e) {
|
||||
if (e.target === v || e.target === a || e.target === d) {
|
||||
e.target._gotTouchend = true;
|
||||
ok(true, 'Got touchend event on #' + e.target.id);
|
||||
ok(true, "Got touchend event on #" + e.target.id);
|
||||
}
|
||||
testDriver();
|
||||
};
|
||||
|
@ -37,17 +37,17 @@ function* test(testDriver) {
|
|||
var pt = coordinatesRelativeToScreen(25, 5, v);
|
||||
yield utils.sendNativeTouchPoint(0, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, pt.x, pt.y, 1, 90, null);
|
||||
yield utils.sendNativeTouchPoint(0, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, pt.x, pt.y, 1, 90, null);
|
||||
ok(v._gotTouchend, 'Touchend was received on video element');
|
||||
ok(v._gotTouchend, "Touchend was received on video element");
|
||||
|
||||
pt = coordinatesRelativeToScreen(25, 5, a);
|
||||
yield utils.sendNativeTouchPoint(0, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, pt.x, pt.y, 1, 90, null);
|
||||
yield utils.sendNativeTouchPoint(0, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, pt.x, pt.y, 1, 90, null);
|
||||
ok(a._gotTouchend, 'Touchend was received on audio element');
|
||||
ok(a._gotTouchend, "Touchend was received on audio element");
|
||||
|
||||
pt = coordinatesRelativeToScreen(25, 5, d);
|
||||
yield utils.sendNativeTouchPoint(0, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, pt.x, pt.y, 1, 90, null);
|
||||
yield utils.sendNativeTouchPoint(0, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, pt.x, pt.y, 1, 90, null);
|
||||
ok(d._gotTouchend, 'Touchend was received on div element');
|
||||
ok(d._gotTouchend, "Touchend was received on div element");
|
||||
}
|
||||
|
||||
waitUntilApzStable()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
|
||||
<script type="application/javascript">
|
||||
function* test(testDriver) {
|
||||
var scroller = document.getElementById('scroller');
|
||||
var scroller = document.getElementById("scroller");
|
||||
var scrollerPos = scroller.scrollTop;
|
||||
var dx = 100, dy = 50;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ function* test(testDriver) {
|
|||
is(window.scrollY, 0, "Main-thread scroll position is still at 0");
|
||||
|
||||
// Scroll the iframe by 300px.
|
||||
var subframe = document.getElementById('subframe');
|
||||
var subframe = document.getElementById("subframe");
|
||||
yield synthesizeNativeTouchDrag(subframe, 10, 200, 0, -300);
|
||||
|
||||
// Remove the observer, we don't need it any more.
|
||||
|
@ -53,11 +53,11 @@ function* test(testDriver) {
|
|||
var lastPaint = convertScrollFrameData(getLastNonemptyBucket(contentPaints).scrollFrames);
|
||||
var foundIt = 0;
|
||||
for (var scrollId in lastPaint) {
|
||||
if (('contentDescription' in lastPaint[scrollId]) &&
|
||||
(lastPaint[scrollId]['contentDescription'].includes('tall_html'))) {
|
||||
var dp = getPropertyAsRect(lastPaint, scrollId, 'displayport');
|
||||
ok(dp.y <= 0, 'The displayport top should be less than or equal to zero to cover the visible part of the subframe; it is ' + dp.y);
|
||||
ok(dp.y + dp.h >= subframe.clientHeight, 'The displayport bottom should be greater than the clientHeight; it is ' + (dp.y + dp.h));
|
||||
if (("contentDescription" in lastPaint[scrollId]) &&
|
||||
(lastPaint[scrollId]["contentDescription"].includes("tall_html"))) {
|
||||
var dp = getPropertyAsRect(lastPaint, scrollId, "displayport");
|
||||
ok(dp.y <= 0, "The displayport top should be less than or equal to zero to cover the visible part of the subframe; it is " + dp.y);
|
||||
ok(dp.y + dp.h >= subframe.clientHeight, "The displayport bottom should be greater than the clientHeight; it is " + (dp.y + dp.h));
|
||||
foundIt++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,21 +17,21 @@
|
|||
|
||||
eventsList.forEach((eventName) => {
|
||||
eventsCount[eventName] = 0;
|
||||
document.getElementById('div1').addEventListener(eventName, (event) => {
|
||||
document.getElementById("div1").addEventListener(eventName, (event) => {
|
||||
++eventsCount[event.type];
|
||||
ok(true, "Received event " + event.type);
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener("click", (event) => {
|
||||
is(event.target, document.getElementById('div1'), "Clicked on div (at " + event.clientX + "," + event.clientY + ")");
|
||||
is(event.target, document.getElementById("div1"), "Clicked on div (at " + event.clientX + "," + event.clientY + ")");
|
||||
for (var key in eventsCount) {
|
||||
is(eventsCount[key], 1, "Event " + key + " should be generated once");
|
||||
}
|
||||
subtestDone();
|
||||
});
|
||||
|
||||
synthesizeNativeTap(document.getElementById('div1'), 100, 100);
|
||||
synthesizeNativeTap(document.getElementById("div1"), 100, 100);
|
||||
}
|
||||
|
||||
waitUntilApzStable().then(test);
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
target0.addEventListener("pointerdown", () => {
|
||||
++pointerdown_count;
|
||||
});
|
||||
synthesizeNativeTap(document.getElementById('target0'), 100, 100);
|
||||
synthesizeNativeTap(document.getElementById('target0'), 100, 100);
|
||||
synthesizeNativeTap(document.getElementById("target0"), 100, 100);
|
||||
synthesizeNativeTap(document.getElementById("target0"), 100, 100);
|
||||
}
|
||||
waitUntilApzStable().then(runTests);
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var scrollableDiv = document.getElementById('scrollable');
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
var scrollableDiv = document.getElementById("scrollable");
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
|
||||
var dragFinisher = yield* dragVerticalScrollbar(scrollableDiv, testDriver);
|
||||
if (!dragFinisher) {
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var scrollableDiv = document.getElementById('scrollable');
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
var scrollableDiv = document.getElementById("scrollable");
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
|
||||
var dragFinisher = yield* dragVerticalScrollbar(scrollableDiv, testDriver);
|
||||
if (!dragFinisher) {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
function* test(testDriver) {
|
||||
var root = document.scrollingElement;
|
||||
var scrollPos = root.scrollTop;
|
||||
document.addEventListener('scroll', () => {
|
||||
document.addEventListener("scroll", () => {
|
||||
ok(root.scrollTop > scrollPos, "document scrolled after dragging scrollbar");
|
||||
setTimeout(testDriver, 0);
|
||||
}, {once: true});
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var scrollableDiv = document.getElementById('scrollable');
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
var scrollableDiv = document.getElementById("scrollable");
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
|
||||
// Scroll down a small amount (10px). The bug in this case is that the
|
||||
// scrollthumb remains a little "above" where it's supposed to be, so if the
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<div id="anim"></div>
|
||||
</body>
|
||||
<script>
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
const utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
|
||||
|
@ -50,7 +50,7 @@ async function test_opacity() {
|
|||
"Element should have been moved by the offset");
|
||||
}
|
||||
|
||||
if (utils.layerManagerType == 'WebRender') {
|
||||
if (utils.layerManagerType == "WebRender") {
|
||||
ok(true, "This test doesn't need to run on WebRender");
|
||||
subtestDone();
|
||||
} else {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<div id="anim"></div>
|
||||
</body>
|
||||
<script>
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
const utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
|
||||
|
@ -50,7 +50,7 @@ async function test_transform() {
|
|||
"Element should have been moved by the offset");
|
||||
}
|
||||
|
||||
if (utils.layerManagerType == 'WebRender') {
|
||||
if (utils.layerManagerType == "WebRender") {
|
||||
ok(true, "This test doesn't need to run on WebRender");
|
||||
subtestDone();
|
||||
} else {
|
||||
|
|
|
@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1473108
|
|||
|
||||
waitUntilApzStable().then(() => {
|
||||
let target = document.getElementById("target");
|
||||
target.addEventListener('click', function(e) {
|
||||
target.addEventListener("click", function(e) {
|
||||
is(e.target, target, `Clicked on at (${e.clientX}, ${e.clientY})`);
|
||||
subtestDone();
|
||||
});
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var scrollableDiv = document.getElementById('scrollable');
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
var scrollableDiv = document.getElementById("scrollable");
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
|
||||
// Scroll down a small amount (10px). The bug in this case is that the
|
||||
// scrollthumb "jumps" by an additional 40 pixels (height of the "gap" div)
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var scrollableDiv = document.getElementById('scrollable');
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
var scrollableDiv = document.getElementById("scrollable");
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
|
||||
// Scroll down a small amount (10px). The bug in this case is that the
|
||||
// scrollthumb "jumps" by an additional 40 pixels (height of the "gap" div)
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
function checkForTestEnd() {
|
||||
if (apzFlushed && endEventReceived) {
|
||||
var target = document.getElementById('carousel');
|
||||
target.removeEventListener('pointermove', moveListener);
|
||||
var target = document.getElementById("carousel");
|
||||
target.removeEventListener("pointermove", moveListener);
|
||||
|
||||
ok(pointerMoveCount > 0, "Got " + pointerMoveCount + " pointermove events");
|
||||
is(document.scrollingElement.scrollTop, 0, "Document didn't y-scroll");
|
||||
|
@ -33,19 +33,19 @@
|
|||
}
|
||||
|
||||
function* test(testDriver) {
|
||||
var target = document.getElementById('carousel');
|
||||
target.addEventListener('pointercancel', (event) => {
|
||||
var target = document.getElementById("carousel");
|
||||
target.addEventListener("pointercancel", (event) => {
|
||||
ok(false, "Received pointercancel, uh-oh!");
|
||||
endEventReceived = true;
|
||||
setTimeout(checkForTestEnd, 0);
|
||||
}, {once: true});
|
||||
target.addEventListener('pointerup', () => {
|
||||
target.addEventListener("pointerup", () => {
|
||||
ok(true, "Received pointerup");
|
||||
endEventReceived = true;
|
||||
setTimeout(checkForTestEnd, 0);
|
||||
}, {once: true});
|
||||
|
||||
target.addEventListener('pointermove', moveListener);
|
||||
target.addEventListener("pointermove", moveListener);
|
||||
|
||||
// Drag mostly horizontally but also slightly vertically. If the
|
||||
// touch-action were not respected due to a bug this might result
|
||||
|
|
|
@ -60,8 +60,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141
|
|||
"expected a content paint with sequence number" + lastCompositorPaintSeqNo);
|
||||
var correspondingContentPaint = contentTestData.paints[lastCompositorPaintSeqNo];
|
||||
|
||||
var dp = getPropertyAsRect(correspondingContentPaint, childScrollId, 'displayport');
|
||||
var subframe = document.getElementById('subframe');
|
||||
var dp = getPropertyAsRect(correspondingContentPaint, childScrollId, "displayport");
|
||||
var subframe = document.getElementById("subframe");
|
||||
// The clientWidth and clientHeight may be less than 50 if there are scrollbars showing.
|
||||
// In general they will be (50 - <scrollbarwidth>, 50 - <scrollbarheight>).
|
||||
SimpleTest.ok(subframe.clientWidth > 0, "Expected a non-zero clientWidth, got: " + subframe.clientWidth);
|
||||
|
|
|
@ -10,23 +10,23 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* clickButton(testDriver) {
|
||||
document.addEventListener('click', clicked);
|
||||
document.addEventListener("click", clicked);
|
||||
|
||||
if (getQueryArgs()['dtc']) {
|
||||
if (getQueryArgs()["dtc"]) {
|
||||
// force a dispatch-to-content region on the document
|
||||
document.addEventListener('wheel', function() { /* no-op */ }, { passive: false });
|
||||
document.addEventListener("wheel", function() { /* no-op */ }, { passive: false });
|
||||
yield waitForAllPaints(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
});
|
||||
}
|
||||
|
||||
synthesizeNativeClick(document.getElementById('b'), 5, 5, function() {
|
||||
synthesizeNativeClick(document.getElementById("b"), 5, 5, function() {
|
||||
dump("Finished synthesizing click, waiting for button to be clicked...\n");
|
||||
});
|
||||
}
|
||||
|
||||
function clicked(e) {
|
||||
is(e.target, document.getElementById('b'), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
is(e.target, document.getElementById("b"), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
subtestDone();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ function scrollOuter() {
|
|||
};
|
||||
SpecialPowers.Services.obs.addObserver(transformEnd, "APZ:TransformEnd");
|
||||
|
||||
synthesizeNativeTouchDrag(document.getElementById('outer'), 10, 100, 0, -50);
|
||||
synthesizeNativeTouchDrag(document.getElementById("outer"), 10, 100, 0, -50);
|
||||
dump("Finished native drag, waiting for transform-end observer...\n");
|
||||
}
|
||||
|
||||
function checkScroll() {
|
||||
var outerScroll = document.getElementById('outer').scrollTop;
|
||||
var outerScroll = document.getElementById("outer").scrollTop;
|
||||
is(outerScroll, 50, "check that the div scrolled");
|
||||
subtestDone();
|
||||
}
|
||||
|
|
|
@ -10,25 +10,25 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
document.addEventListener('click', clicked);
|
||||
document.addEventListener("click", clicked);
|
||||
|
||||
// Ensure the pointer is inside the window
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 5, 5, nativeMouseMoveEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById("b"), 5, 5, nativeMouseMoveEventMsg(), testDriver);
|
||||
// mouse down, move it around, and release it near where it went down. this
|
||||
// should generate a click at the release point
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 5, 5, nativeMouseDownEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 100, 100, nativeMouseMoveEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 10, 10, nativeMouseMoveEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById('b'), 8, 8, nativeMouseUpEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById("b"), 5, 5, nativeMouseDownEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById("b"), 100, 100, nativeMouseMoveEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById("b"), 10, 10, nativeMouseMoveEventMsg(), testDriver);
|
||||
yield synthesizeNativeMouseEvent(document.getElementById("b"), 8, 8, nativeMouseUpEventMsg(), testDriver);
|
||||
dump("Finished synthesizing click with a drag in the middle\n");
|
||||
}
|
||||
|
||||
function clicked(e) {
|
||||
// The mouse down at (5, 5) should not have generated a click, but the up
|
||||
// at (8, 8) should have.
|
||||
is(e.target, document.getElementById('b'), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
is(e.clientX, 8 + Math.floor(document.getElementById('b').getBoundingClientRect().left), 'x-coord of click event looks sane');
|
||||
is(e.clientY, 8 + Math.floor(document.getElementById('b').getBoundingClientRect().top), 'y-coord of click event looks sane');
|
||||
is(e.target, document.getElementById("b"), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
is(e.clientX, 8 + Math.floor(document.getElementById("b").getBoundingClientRect().left), "x-coord of click event looks sane");
|
||||
is(e.clientY, 8 + Math.floor(document.getElementById("b").getBoundingClientRect().top), "y-coord of click event looks sane");
|
||||
subtestDone();
|
||||
}
|
||||
|
||||
|
|
|
@ -41,15 +41,15 @@ function moveTo(mouseY, testDriver) {
|
|||
}
|
||||
|
||||
function setupDragging(testDriver) {
|
||||
bar = document.getElementById('scrollbar');
|
||||
bar = document.getElementById("scrollbar");
|
||||
mouseDown = false;
|
||||
|
||||
bar.addEventListener('mousedown', function(e) {
|
||||
bar.addEventListener("mousedown", function(e) {
|
||||
mouseDown = true;
|
||||
moveTo(e.clientY, testDriver);
|
||||
}, true);
|
||||
|
||||
bar.addEventListener('mousemove', function(e) {
|
||||
bar.addEventListener("mousemove", function(e) {
|
||||
if (mouseDown) {
|
||||
dump("Got mousemove clientY " + e.clientY + "\n");
|
||||
moveTo(e.clientY, testDriver);
|
||||
|
@ -57,11 +57,11 @@ function setupDragging(testDriver) {
|
|||
}
|
||||
}, true);
|
||||
|
||||
bar.addEventListener('mouseup', function(e) {
|
||||
bar.addEventListener("mouseup", function(e) {
|
||||
mouseDown = false;
|
||||
}, true);
|
||||
|
||||
window.addEventListener('mousemove', function(e) {
|
||||
window.addEventListener("mousemove", function(e) {
|
||||
if (mouseDown) {
|
||||
ok(false, "The mousemove at " + e.clientY + " was not stopped by the bar listener, and is a glitchy event!");
|
||||
setTimeout(testDriver, 0);
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
function* test(testDriver) {
|
||||
var config = getHitTestConfig();
|
||||
|
||||
var subframe = document.getElementById('front');
|
||||
var subframe = document.getElementById("front");
|
||||
|
||||
// Set a displayport to ensure the subframe is layerized.
|
||||
// This is not required for exercising the behavior we want to test,
|
||||
|
|
|
@ -21,8 +21,8 @@ function* test(testDriver) {
|
|||
var config = getHitTestConfig();
|
||||
var utils = config.utils;
|
||||
|
||||
var scroller = document.getElementById('scroller');
|
||||
var apzaware = document.getElementById('apzaware');
|
||||
var scroller = document.getElementById("scroller");
|
||||
var apzaware = document.getElementById("apzaware");
|
||||
|
||||
checkHitResult(hitTest(centerOf(scroller)),
|
||||
APZHitResultFlags.VISIBLE | APZHitResultFlags.DISPATCH_TO_CONTENT,
|
||||
|
|
|
@ -21,7 +21,7 @@ function* test(testDriver) {
|
|||
var config = getHitTestConfig();
|
||||
var utils = config.utils;
|
||||
|
||||
var scroller = document.getElementById('scroller');
|
||||
var scroller = document.getElementById("scroller");
|
||||
|
||||
// Activate the scrollframe but keep the main-thread scroll position at 0.
|
||||
// Also apply an async scroll offset in the y-direction such that the
|
||||
|
|
|
@ -68,11 +68,11 @@ function* test(testDriver) {
|
|||
var utils = config.utils;
|
||||
|
||||
// layerize the scrollable frame
|
||||
var subframe = document.querySelector('.subframe');
|
||||
var subframe = document.querySelector(".subframe");
|
||||
utils.setDisplayPortForElement(0, 0, 800, 2000, subframe, 1);
|
||||
yield waitForApzFlushedRepaints(testDriver);
|
||||
|
||||
var target = document.querySelector('.absoluteClip');
|
||||
var target = document.querySelector(".absoluteClip");
|
||||
checkHitResult(hitTest(centerOf(target)),
|
||||
APZHitResultFlags.VISIBLE,
|
||||
utils.getViewId(subframe),
|
||||
|
|
|
@ -38,7 +38,7 @@ function* test(testDriver) {
|
|||
var utils = getHitTestConfig().utils;
|
||||
|
||||
hitTestScrollbar({
|
||||
element: document.getElementById('subframe'),
|
||||
element: document.getElementById("subframe"),
|
||||
directions: { vertical: true },
|
||||
expectedScrollId: utils.getViewId(document.scrollingElement),
|
||||
trackLocation: ScrollbarTrackLocation.START,
|
||||
|
|
|
@ -38,7 +38,7 @@ function* test(testDriver) {
|
|||
var utils = getHitTestConfig().utils;
|
||||
|
||||
hitTestScrollbar({
|
||||
element: document.getElementById('subframe'),
|
||||
element: document.getElementById("subframe"),
|
||||
directions: { horizontal: true },
|
||||
expectedScrollId: utils.getViewId(document.scrollingElement),
|
||||
trackLocation: ScrollbarTrackLocation.START,
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
var config = getHitTestConfig();
|
||||
|
||||
function* test(testDriver) {
|
||||
for (var scroller of document.querySelectorAll('.taBigBox > div')) {
|
||||
for (var scroller of document.querySelectorAll(".taBigBox > div")) {
|
||||
// layerize all the scrollable divs
|
||||
config.utils.setDisplayPortForElement(0, 0, 100, 100, scroller, 1);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ function* test(testDriver) {
|
|||
var scrollId = config.utils.getViewId(document.scrollingElement);
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taNone')),
|
||||
hitTest(centerOf("taNone")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -124,7 +124,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: none");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerNonePanX')),
|
||||
hitTest(centerOf("taInnerNonePanX")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -133,7 +133,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: pan-x inside touch-action: none");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerNoneManip')),
|
||||
hitTest(centerOf("taInnerNoneManip")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -143,7 +143,7 @@ function* test(testDriver) {
|
|||
"touch-action: manipulation inside touch-action: none");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taPanX')),
|
||||
hitTest(centerOf("taPanX")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
|
@ -151,7 +151,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: pan-x");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerPanXY')),
|
||||
hitTest(centerOf("taInnerPanXY")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -160,7 +160,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: pan-y inside touch-action: pan-x");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerPanXManip')),
|
||||
hitTest(centerOf("taInnerPanXManip")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
|
@ -169,7 +169,7 @@ function* test(testDriver) {
|
|||
"touch-action: manipulation inside touch-action: pan-x");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taPanY')),
|
||||
hitTest(centerOf("taPanY")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
|
@ -177,7 +177,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: pan-y");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerPanYX')),
|
||||
hitTest(centerOf("taInnerPanYX")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -186,7 +186,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: pan-x inside touch-action: pan-y");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerPanYY')),
|
||||
hitTest(centerOf("taInnerPanYY")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
|
@ -195,14 +195,14 @@ function* test(testDriver) {
|
|||
"touch-action: pan-y inside touch-action: pan-y");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taPanXY')),
|
||||
hitTest(centerOf("taPanXY")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
scrollId,
|
||||
"touch-action: pan-x pan-y");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerPanXYNone')),
|
||||
hitTest(centerOf("taInnerPanXYNone")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -212,13 +212,13 @@ function* test(testDriver) {
|
|||
"touch-action: none inside touch-action: pan-x pan-y");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taManip')),
|
||||
hitTest(centerOf("taManip")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
scrollId,
|
||||
"touch-action: manipulation");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerManipPanX')),
|
||||
hitTest(centerOf("taInnerManipPanX")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
|
@ -226,7 +226,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: pan-x inside touch-action: manipulation");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerManipNone')),
|
||||
hitTest(centerOf("taInnerManipNone")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -235,7 +235,7 @@ function* test(testDriver) {
|
|||
scrollId,
|
||||
"touch-action: none inside touch-action: manipulation");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerManipListener')),
|
||||
hitTest(centerOf("taInnerManipListener")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.DISPATCH_TO_CONTENT |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
|
@ -243,13 +243,13 @@ function* test(testDriver) {
|
|||
"div with touch listener inside touch-action: manipulation");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taListener')),
|
||||
hitTest(centerOf("taListener")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.DISPATCH_TO_CONTENT,
|
||||
scrollId,
|
||||
"div with touch listener");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taInnerListenerPanX')),
|
||||
hitTest(centerOf("taInnerListenerPanX")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.DISPATCH_TO_CONTENT |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
|
@ -259,42 +259,42 @@ function* test(testDriver) {
|
|||
"touch-action: pan-x inside div with touch listener");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taScrollerPanY')),
|
||||
hitTest(centerOf("taScrollerPanY")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
config.utils.getViewId(document.getElementById('taScrollerPanY')),
|
||||
config.utils.getViewId(document.getElementById("taScrollerPanY")),
|
||||
"touch-action: pan-y on scroller");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taScroller')),
|
||||
hitTest(centerOf("taScroller")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_X_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
config.utils.getViewId(document.getElementById('taScroller')),
|
||||
config.utils.getViewId(document.getElementById("taScroller")),
|
||||
"touch-action: pan-y on div inside scroller");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taScroller2')),
|
||||
hitTest(centerOf("taScroller2")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
config.utils.getViewId(document.getElementById('taScroller2')),
|
||||
config.utils.getViewId(document.getElementById("taScroller2")),
|
||||
"zooming restrictions from pan-x outside scroller get inherited in");
|
||||
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taScrollerPanX')),
|
||||
hitTest(centerOf("taScrollerPanX")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.PAN_Y_DISABLED |
|
||||
APZHitResultFlags.PINCH_ZOOM_DISABLED |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
config.utils.getViewId(document.getElementById('taScrollerPanX')),
|
||||
config.utils.getViewId(document.getElementById("taScrollerPanX")),
|
||||
"touch-action: pan-x on scroller inside manipulation");
|
||||
checkHitResult(
|
||||
hitTest(centerOf('taScroller3')),
|
||||
hitTest(centerOf("taScroller3")),
|
||||
APZHitResultFlags.VISIBLE |
|
||||
APZHitResultFlags.DOUBLE_TAP_ZOOM_DISABLED,
|
||||
config.utils.getViewId(document.getElementById('taScroller3')),
|
||||
config.utils.getViewId(document.getElementById("taScroller3")),
|
||||
"touch-action: manipulation outside scroller gets inherited in");
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function scrollOuter() {
|
||||
var outer = document.getElementById('outer');
|
||||
var outer = document.getElementById("outer");
|
||||
var transformEnd = function() {
|
||||
SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd", false);
|
||||
dump("Transform complete; flushing repaints...\n");
|
||||
|
@ -23,7 +23,7 @@ function scrollOuter() {
|
|||
}
|
||||
|
||||
function checkScroll() {
|
||||
var outerScroll = document.getElementById('outer').contentWindow.scrollY;
|
||||
var outerScroll = document.getElementById("outer").contentWindow.scrollY;
|
||||
if (getPlatform() == "windows") {
|
||||
// On windows, because we run this test with native event synthesization,
|
||||
// Windows can end up eating the first touchmove which can result in the
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function longPressLink() {
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, function() {
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, function() {
|
||||
dump("Finished synthesizing touch-start, waiting for events...\n");
|
||||
});
|
||||
}
|
||||
|
@ -22,14 +22,14 @@ function recordEvent(e) {
|
|||
// by APZ, and that's what we use as the trigger to lift the finger. That then
|
||||
// triggers the contextmenu. This matches the platform convention.
|
||||
switch (eventsFired) {
|
||||
case 0: is(e.type, 'touchstart', 'Got a touchstart'); break;
|
||||
case 0: is(e.type, "touchstart", "Got a touchstart"); break;
|
||||
case 1:
|
||||
is(e.type, 'mouselongtap', 'Got a mouselongtap');
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE);
|
||||
is(e.type, "mouselongtap", "Got a mouselongtap");
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE);
|
||||
break;
|
||||
case 2: is(e.type, 'touchend', 'Got a touchend'); break;
|
||||
case 3: is(e.type, 'contextmenu', 'Got a contextmenu'); e.preventDefault(); break;
|
||||
default: ok(false, 'Got an unexpected event of type ' + e.type); break;
|
||||
case 2: is(e.type, "touchend", "Got a touchend"); break;
|
||||
case 3: is(e.type, "contextmenu", "Got a contextmenu"); e.preventDefault(); break;
|
||||
default: ok(false, "Got an unexpected event of type " + e.type); break;
|
||||
}
|
||||
eventsFired++;
|
||||
|
||||
|
@ -45,15 +45,15 @@ function recordEvent(e) {
|
|||
// been detected. Since we prevent-default that, we don't get a mouselongtap
|
||||
// event at all, and instead get a touchcancel.
|
||||
switch (eventsFired) {
|
||||
case 0: is(e.type, 'touchstart', 'Got a touchstart'); break;
|
||||
case 1: is(e.type, 'contextmenu', 'Got a contextmenu'); e.preventDefault(); break;
|
||||
case 2: is(e.type, 'touchcancel', 'Got a touchcancel'); break;
|
||||
default: ok(false, 'Got an unexpected event of type ' + e.type); break;
|
||||
case 0: is(e.type, "touchstart", "Got a touchstart"); break;
|
||||
case 1: is(e.type, "contextmenu", "Got a contextmenu"); e.preventDefault(); break;
|
||||
case 2: is(e.type, "touchcancel", "Got a touchcancel"); break;
|
||||
default: ok(false, "Got an unexpected event of type " + e.type); break;
|
||||
}
|
||||
eventsFired++;
|
||||
|
||||
if (eventsFired == 3) {
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() {
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() {
|
||||
dump("Finished synthesizing touch-end, doing an APZ flush to see if any more unexpected events come through...\n");
|
||||
flushApzRepaints(function() {
|
||||
dump("Done APZ flush, ending test...\n");
|
||||
|
@ -64,11 +64,11 @@ function recordEvent(e) {
|
|||
}
|
||||
}
|
||||
|
||||
window.addEventListener('touchstart', recordEvent, { passive: true, capture: true });
|
||||
window.addEventListener('touchend', recordEvent, { passive: true, capture: true });
|
||||
window.addEventListener('touchcancel', recordEvent, true);
|
||||
window.addEventListener('contextmenu', recordEvent, true);
|
||||
SpecialPowers.addChromeEventListener('mouselongtap', recordEvent, true);
|
||||
window.addEventListener("touchstart", recordEvent, { passive: true, capture: true });
|
||||
window.addEventListener("touchend", recordEvent, { passive: true, capture: true });
|
||||
window.addEventListener("touchcancel", recordEvent, true);
|
||||
window.addEventListener("contextmenu", recordEvent, true);
|
||||
SpecialPowers.addChromeEventListener("mouselongtap", recordEvent, true);
|
||||
|
||||
waitUntilApzStable()
|
||||
.then(longPressLink);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// Add a non-passive listener on the document, so that we have a document-level
|
||||
// APZ-aware listener, and the entire document is put in the dispatch-to-content
|
||||
// region
|
||||
document.addEventListener('wheel', function(e) {
|
||||
document.addEventListener("wheel", function(e) {
|
||||
dump("Wheel listener running...\n");
|
||||
|
||||
// spin for 2 seconds to give APZ time to scroll, if the event region override
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var subframe = document.getElementById('scroll');
|
||||
var subframe = document.getElementById("scroll");
|
||||
|
||||
// scroll over the middle of the subframe, and make sure that the page
|
||||
// does not scroll.
|
||||
|
|
|
@ -34,7 +34,7 @@ function* test(testDriver) {
|
|||
var config = getHitTestConfig();
|
||||
var utils = config.utils;
|
||||
|
||||
var subframe = document.getElementById('subframe');
|
||||
var subframe = document.getElementById("subframe");
|
||||
|
||||
// Activate the scrollframe but keep the main-thread scroll position at 0.
|
||||
// Also apply an async scroll offset in the y-direction large enough
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var iframe = document.getElementById('scroll');
|
||||
var iframe = document.getElementById("scroll");
|
||||
var iframeWindow = iframe.contentWindow;
|
||||
var iframeContent = iframeWindow.document.documentElement;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var subframe = document.getElementById('scroll');
|
||||
var subframe = document.getElementById("scroll");
|
||||
|
||||
// scroll over the middle of the subframe, to make sure it scrolls,
|
||||
// not the page
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var subframe = document.getElementById('scroll');
|
||||
var subframe = document.getElementById("scroll");
|
||||
|
||||
// scroll over the middle of the subframe, and make sure that it scrolls,
|
||||
// not the page
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var iframeWin = document.getElementById('iframe').contentWindow;
|
||||
var iframeWin = document.getElementById("iframe").contentWindow;
|
||||
|
||||
// scroll over the middle of the iframe's position:sticky element, check
|
||||
// that it scrolls the iframe
|
||||
|
@ -21,7 +21,7 @@ function* test(testDriver) {
|
|||
ok(iframeWin.scrollY > scrollPos, "iframe scrolled after wheeling over the position:fixed element");
|
||||
|
||||
// same, but scrolling the scrollable frame *inside* the position:fixed item
|
||||
var fpos = document.getElementById('fpos_scrollable');
|
||||
var fpos = document.getElementById("fpos_scrollable");
|
||||
scrollPos = fpos.scrollTop;
|
||||
yield moveMouseAndScrollWheelOver(fpos, 50, 150, testDriver);
|
||||
ok(fpos.scrollTop > scrollPos, "scrollable item inside fixed-pos element scrolled");
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var subframe = document.getElementById('scroll');
|
||||
var subframe = document.getElementById("scroll");
|
||||
|
||||
// scroll over the scrollbar, and make sure the subframe scrolls
|
||||
var scrollPos = subframe.scrollTop;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
|
||||
<script type="application/javascript">
|
||||
function* test(testDriver) {
|
||||
var subframe = document.getElementById('content-wrapper');
|
||||
var subframe = document.getElementById("content-wrapper");
|
||||
|
||||
// scroll over the middle of the subframe, to make sure it scrolls,
|
||||
// not the page
|
||||
|
|
|
@ -26,7 +26,7 @@ function* test(testDriver) {
|
|||
// like. However if any bugfixes are made to that function this code might
|
||||
// need to be updated as well.
|
||||
|
||||
var scrollableDiv = document.getElementById('scrollable');
|
||||
var scrollableDiv = document.getElementById("scrollable");
|
||||
var boundingClientRect = scrollableDiv.getBoundingClientRect();
|
||||
var verticalScrollbarWidth = boundingClientRect.width - scrollableDiv.clientWidth;
|
||||
if (verticalScrollbarWidth == 0) {
|
||||
|
@ -35,7 +35,7 @@ function* test(testDriver) {
|
|||
}
|
||||
|
||||
// register a scroll listener for the initial drag
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
|
||||
var upArrowHeight = verticalScrollbarWidth; // assume square scrollbar buttons
|
||||
var mouseX = scrollableDiv.clientWidth + (verticalScrollbarWidth / 2);
|
||||
|
@ -61,7 +61,7 @@ function* test(testDriver) {
|
|||
// the mouse to. This allows us to wait for a scroll event in either case.
|
||||
// If we only triggered the snapback case then waiting for the scroll to
|
||||
// "not happen" in the other case would be more error-prone.
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
// Add 2 to snapMultipler just to make sure we get far enough away from the scrollbar
|
||||
var snapBackDistance = (snapMultiplier + 2) * verticalScrollbarWidth;
|
||||
yield synthesizeNativeMouseEvent(scrollableDiv, mouseX + snapBackDistance, mouseY + 10, nativeMouseMoveEventMsg(), testDriver);
|
||||
|
@ -76,7 +76,7 @@ function* test(testDriver) {
|
|||
|
||||
// Now we move the mouse back to the old position to ensure the scroll position
|
||||
// gets restored properly
|
||||
scrollableDiv.addEventListener('scroll', () => setTimeout(testDriver, 0), {once: true});
|
||||
scrollableDiv.addEventListener("scroll", () => setTimeout(testDriver, 0), {once: true});
|
||||
yield synthesizeNativeMouseEvent(scrollableDiv, mouseX, mouseY, nativeMouseMoveEventMsg(), testDriver);
|
||||
|
||||
// wait here until the scroll happens
|
||||
|
|
|
@ -24,7 +24,7 @@ function startTest() {
|
|||
// by ensuring the document element did not get painted.
|
||||
var utils = window.opener.SpecialPowers.getDOMWindowUtils(window);
|
||||
var elem = document.documentElement;
|
||||
var skipping = location.search == '?true';
|
||||
var skipping = location.search == "?true";
|
||||
utils.checkAndClearPaintedState(elem);
|
||||
window.scrollTo(0, 20);
|
||||
waitForAllPaints(function() {
|
||||
|
@ -38,15 +38,15 @@ function startTest() {
|
|||
}
|
||||
|
||||
function clickButton() {
|
||||
document.addEventListener('click', clicked);
|
||||
document.addEventListener("click", clicked);
|
||||
|
||||
synthesizeNativeTap(document.getElementById('b'), 5, 5, function() {
|
||||
synthesizeNativeTap(document.getElementById("b"), 5, 5, function() {
|
||||
dump("Finished synthesizing tap, waiting for button to be clicked...\n");
|
||||
});
|
||||
}
|
||||
|
||||
function clicked(e) {
|
||||
is(e.target, document.getElementById('b'), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
is(e.target, document.getElementById("b"), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
subtestDone();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function clickButton() {
|
||||
document.addEventListener('click', clicked);
|
||||
document.addEventListener("click", clicked);
|
||||
|
||||
synthesizeNativeTap(document.getElementById('b'), 5, 5, function() {
|
||||
synthesizeNativeTap(document.getElementById("b"), 5, 5, function() {
|
||||
dump("Finished synthesizing tap, waiting for button to be clicked...\n");
|
||||
});
|
||||
}
|
||||
|
||||
function clicked(e) {
|
||||
is(e.target, document.getElementById('b'), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
is(e.target, document.getElementById("b"), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
subtestDone();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
var touchdownTime;
|
||||
|
||||
function longPressLink() {
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, function() {
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, function() {
|
||||
dump("Finished synthesizing touch-start, waiting for events...\n");
|
||||
});
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ var touchstartReceived = false;
|
|||
function recordEvent(e) {
|
||||
if (!touchstartReceived) {
|
||||
touchstartReceived = true;
|
||||
is(e.type, 'touchstart', 'Got a touchstart');
|
||||
is(e.type, "touchstart", "Got a touchstart");
|
||||
e.preventDefault(); // should be a no-op because it's a passive listener
|
||||
return;
|
||||
}
|
||||
|
@ -34,24 +34,24 @@ function recordEvent(e) {
|
|||
// not to wait for the content response, which is the desired behaviour, since
|
||||
// the touchstart listener was registered as a passive listener.
|
||||
if (getPlatform() == "windows") {
|
||||
is(e.type, 'mouselongtap', 'Got a mouselongtap');
|
||||
is(e.type, "mouselongtap", "Got a mouselongtap");
|
||||
} else {
|
||||
is(e.type, 'contextmenu', 'Got a contextmenu');
|
||||
is(e.type, "contextmenu", "Got a contextmenu");
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() {
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() {
|
||||
dump("Finished synthesizing touch-end to clear state; finishing test...\n");
|
||||
subtestDone();
|
||||
});
|
||||
}
|
||||
|
||||
// Note, not passing 'passive'.
|
||||
window.addEventListener('touchstart', recordEvent, { capture: true });
|
||||
window.addEventListener("touchstart", recordEvent, { capture: true });
|
||||
if (getPlatform() == "windows") {
|
||||
SpecialPowers.addChromeEventListener('mouselongtap', recordEvent, true);
|
||||
SpecialPowers.addChromeEventListener("mouselongtap", recordEvent, true);
|
||||
} else {
|
||||
window.addEventListener('contextmenu', recordEvent, true);
|
||||
window.addEventListener("contextmenu", recordEvent, true);
|
||||
}
|
||||
|
||||
waitUntilApzStable()
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
function clickButton() {
|
||||
document.addEventListener('click', clicked);
|
||||
document.addEventListener("click", clicked);
|
||||
|
||||
synthesizeNativeTap(document.getElementById('b'), 5, 5, function() {
|
||||
synthesizeNativeTap(document.getElementById("b"), 5, 5, function() {
|
||||
dump("Finished synthesizing tap, waiting for button to be clicked...\n");
|
||||
});
|
||||
}
|
||||
|
||||
function clicked(e) {
|
||||
is(e.target, document.getElementById('b'), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
is(e.target, document.getElementById("b"), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")");
|
||||
subtestDone();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
var touchdownTime;
|
||||
|
||||
function longPressLink() {
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, function() {
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, function() {
|
||||
dump("Finished synthesizing touch-start, waiting for events...\n");
|
||||
});
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ var touchstartReceived = false;
|
|||
function recordEvent(e) {
|
||||
if (!touchstartReceived) {
|
||||
touchstartReceived = true;
|
||||
is(e.type, 'touchstart', 'Got a touchstart');
|
||||
is(e.type, "touchstart", "Got a touchstart");
|
||||
e.preventDefault(); // should be a no-op because it's a passive listener
|
||||
return;
|
||||
}
|
||||
|
@ -34,23 +34,23 @@ function recordEvent(e) {
|
|||
// not to wait for the content response, which is the desired behaviour, since
|
||||
// the touchstart listener was registered as a passive listener.
|
||||
if (getPlatform() == "windows") {
|
||||
is(e.type, 'mouselongtap', 'Got a mouselongtap');
|
||||
is(e.type, "mouselongtap", "Got a mouselongtap");
|
||||
} else {
|
||||
is(e.type, 'contextmenu', 'Got a contextmenu');
|
||||
is(e.type, "contextmenu", "Got a contextmenu");
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
synthesizeNativeTouch(document.getElementById('b'), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() {
|
||||
synthesizeNativeTouch(document.getElementById("b"), 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() {
|
||||
dump("Finished synthesizing touch-end to clear state; finishing test...\n");
|
||||
subtestDone();
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('touchstart', recordEvent, { passive: true, capture: true });
|
||||
window.addEventListener("touchstart", recordEvent, { passive: true, capture: true });
|
||||
if (getPlatform() == "windows") {
|
||||
SpecialPowers.addChromeEventListener('mouselongtap', recordEvent, true);
|
||||
SpecialPowers.addChromeEventListener("mouselongtap", recordEvent, true);
|
||||
} else {
|
||||
window.addEventListener('contextmenu', recordEvent, true);
|
||||
window.addEventListener("contextmenu", recordEvent, true);
|
||||
}
|
||||
|
||||
waitUntilApzStable()
|
||||
|
|
|
@ -15,9 +15,9 @@ function checkScroll(x, y, desc) {
|
|||
}
|
||||
|
||||
function* test(testDriver) {
|
||||
var target = document.getElementById('target');
|
||||
var target = document.getElementById("target");
|
||||
|
||||
document.body.addEventListener('touchend', testDriver, { passive: true });
|
||||
document.body.addEventListener("touchend", testDriver, { passive: true });
|
||||
|
||||
// drag the page up to scroll down by 50px
|
||||
yield ok(synthesizeNativeTouchDrag(target, 10, 100, 0, -50),
|
||||
|
@ -26,7 +26,7 @@ function* test(testDriver) {
|
|||
checkScroll(0, 50, "After first vertical drag, with pan-y" );
|
||||
|
||||
// switch style to pan-x
|
||||
document.body.style.touchAction = 'pan-x';
|
||||
document.body.style.touchAction = "pan-x";
|
||||
ok(true, "Waiting for pan-x to propagate...");
|
||||
yield waitForAllPaintsFlushed(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
|
@ -52,7 +52,7 @@ function* test(testDriver) {
|
|||
checkScroll(10, 50, "After first diagonal drag, with pan-x");
|
||||
|
||||
// switch style back to pan-y
|
||||
document.body.style.touchAction = 'pan-y';
|
||||
document.body.style.touchAction = "pan-y";
|
||||
ok(true, "Waiting for pan-y to propagate...");
|
||||
yield waitForAllPaintsFlushed(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
|
@ -66,7 +66,7 @@ function* test(testDriver) {
|
|||
checkScroll(10, 10, "After second diagonal drag, with pan-y");
|
||||
|
||||
// switch style to none
|
||||
document.body.style.touchAction = 'none';
|
||||
document.body.style.touchAction = "none";
|
||||
ok(true, "Waiting for none to propagate...");
|
||||
yield waitForAllPaintsFlushed(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
|
@ -79,7 +79,7 @@ function* test(testDriver) {
|
|||
yield flushApzRepaints(testDriver);
|
||||
checkScroll(10, 10, "After third diagonal drag, with none");
|
||||
|
||||
document.body.style.touchAction = 'manipulation';
|
||||
document.body.style.touchAction = "manipulation";
|
||||
ok(true, "Waiting for manipulation to propagate...");
|
||||
yield waitForAllPaintsFlushed(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
|
|
|
@ -20,7 +20,7 @@ function resetConfiguration(config, testDriver) {
|
|||
var i = 0;
|
||||
while (true) {
|
||||
i++;
|
||||
var element = document.getElementById('configuration_' + i);
|
||||
var element = document.getElementById("configuration_" + i);
|
||||
if (element == null) {
|
||||
if (i <= config) {
|
||||
ok(false, "The configuration requested was not encountered!");
|
||||
|
@ -29,14 +29,14 @@ function resetConfiguration(config, testDriver) {
|
|||
}
|
||||
|
||||
if (i == config) {
|
||||
element.style.display = 'block';
|
||||
element.style.display = "block";
|
||||
} else {
|
||||
element.style.display = 'none';
|
||||
element.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// Also reset the scroll position on the scrollframe
|
||||
var s = document.getElementById('scrollframe');
|
||||
var s = document.getElementById("scrollframe");
|
||||
s.scrollLeft = 0;
|
||||
s.scrollTop = 0;
|
||||
|
||||
|
@ -46,9 +46,9 @@ function resetConfiguration(config, testDriver) {
|
|||
}
|
||||
|
||||
function* test(testDriver) {
|
||||
var scrollframe = document.getElementById('scrollframe');
|
||||
var scrollframe = document.getElementById("scrollframe");
|
||||
|
||||
document.body.addEventListener('touchend', testDriver, { passive: true });
|
||||
document.body.addEventListener("touchend", testDriver, { passive: true });
|
||||
|
||||
// Helper function for the tests below.
|
||||
// Touch-pan configuration |configuration| towards scroll offset (dx, dy) with
|
||||
|
@ -67,7 +67,7 @@ function* test(testDriver) {
|
|||
flushApzRepaints(testDriver);
|
||||
});
|
||||
// Check for expected scroll position
|
||||
checkScroll(scrollframe, ex, ey, 'configuration ' + configuration + ' ' + desc);
|
||||
checkScroll(scrollframe, ex, ey, "configuration " + configuration + " " + desc);
|
||||
}
|
||||
|
||||
// Test configuration_1, which contains two sibling elements that are
|
||||
|
|
|
@ -15,7 +15,7 @@ function failure(e) {
|
|||
|
||||
function listener(callback) {
|
||||
return function(e) {
|
||||
ok(e.type == 'touchstart', "The touchstart event handler was triggered after snapshotting completed");
|
||||
ok(e.type == "touchstart", "The touchstart event handler was triggered after snapshotting completed");
|
||||
setTimeout(callback, 0);
|
||||
};
|
||||
}
|
||||
|
@ -32,48 +32,48 @@ function listener(callback) {
|
|||
// at the end to clean up. Returns true on success, false on failure.
|
||||
function chromeTouchEventCounter(operation) {
|
||||
function chromeProcessCounter() {
|
||||
addMessageListener('start', function() {
|
||||
ChromeUtils.import('resource://gre/modules/Services.jsm');
|
||||
var topWin = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
if (typeof topWin.eventCounts != 'undefined') {
|
||||
dump('Found pre-existing eventCounts object on the top window!\n');
|
||||
addMessageListener("start", function() {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (typeof topWin.eventCounts != "undefined") {
|
||||
dump("Found pre-existing eventCounts object on the top window!\n");
|
||||
return false;
|
||||
}
|
||||
topWin.eventCounts = { 'touchstart': 0, 'touchmove': 0, 'touchend': 0 };
|
||||
topWin.eventCounts = { "touchstart": 0, "touchmove": 0, "touchend": 0 };
|
||||
topWin.counter = function(e) {
|
||||
topWin.eventCounts[e.type]++;
|
||||
}
|
||||
|
||||
topWin.addEventListener('touchstart', topWin.counter, { passive: true });
|
||||
topWin.addEventListener('touchmove', topWin.counter, { passive: true });
|
||||
topWin.addEventListener('touchend', topWin.counter, { passive: true });
|
||||
topWin.addEventListener("touchstart", topWin.counter, { passive: true });
|
||||
topWin.addEventListener("touchmove", topWin.counter, { passive: true });
|
||||
topWin.addEventListener("touchend", topWin.counter, { passive: true });
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
addMessageListener('report', function() {
|
||||
ChromeUtils.import('resource://gre/modules/Services.jsm');
|
||||
var topWin = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
addMessageListener("report", function() {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
return JSON.stringify(topWin.eventCounts);
|
||||
});
|
||||
|
||||
addMessageListener('end', function() {
|
||||
ChromeUtils.import('resource://gre/modules/Services.jsm');
|
||||
var topWin = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
if (typeof topWin.eventCounts == 'undefined') {
|
||||
dump('The eventCounts object was not found on the top window!\n');
|
||||
addMessageListener("end", function() {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (typeof topWin.eventCounts == "undefined") {
|
||||
dump("The eventCounts object was not found on the top window!\n");
|
||||
return false;
|
||||
}
|
||||
topWin.removeEventListener('touchstart', topWin.counter);
|
||||
topWin.removeEventListener('touchmove', topWin.counter);
|
||||
topWin.removeEventListener('touchend', topWin.counter);
|
||||
topWin.removeEventListener("touchstart", topWin.counter);
|
||||
topWin.removeEventListener("touchmove", topWin.counter);
|
||||
topWin.removeEventListener("touchend", topWin.counter);
|
||||
delete topWin.counter;
|
||||
delete topWin.eventCounts;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof chromeTouchEventCounter.chromeHelper == 'undefined') {
|
||||
if (typeof chromeTouchEventCounter.chromeHelper == "undefined") {
|
||||
// This is the first time chromeTouchEventCounter is being called; do initialization
|
||||
chromeTouchEventCounter.chromeHelper = SpecialPowers.loadChromeScript(chromeProcessCounter);
|
||||
ApzCleanup.register(function() { chromeTouchEventCounter.chromeHelper.destroy() });
|
||||
|
@ -87,7 +87,7 @@ function chromeTouchEventCounter(operation) {
|
|||
// go by without the condition being satisfied.
|
||||
function waitFor(eventType, count) {
|
||||
var start = Date.now();
|
||||
while (JSON.parse(chromeTouchEventCounter('report'))[eventType] != count) {
|
||||
while (JSON.parse(chromeTouchEventCounter("report"))[eventType] != count) {
|
||||
if (Date.now() - start > 10000) {
|
||||
// It's taking too long, let's abort
|
||||
return false;
|
||||
|
@ -104,7 +104,7 @@ function RunAfterProcessedQueuedInputEvents(aCallback) {
|
|||
function* test(testDriver) {
|
||||
// The main part of this test should run completely before the child process'
|
||||
// main-thread deals with the touch event, so check to make sure that happens.
|
||||
document.body.addEventListener('touchstart', failure, { passive: true });
|
||||
document.body.addEventListener("touchstart", failure, { passive: true });
|
||||
|
||||
// What we want here is to synthesize all of the touch events (from this code in
|
||||
// the child process), and have the chrome process generate and process them,
|
||||
|
@ -175,10 +175,10 @@ function* test(testDriver) {
|
|||
// So, here we go...
|
||||
|
||||
// Set up the chrome process touch listener
|
||||
ok(chromeTouchEventCounter('start'), "Chrome touch counter registered");
|
||||
ok(chromeTouchEventCounter("start"), "Chrome touch counter registered");
|
||||
|
||||
// Set up the child process events and callbacks
|
||||
var scroller = document.getElementById('scroller');
|
||||
var scroller = document.getElementById("scroller");
|
||||
synthesizeNativeTouch(scroller, 10, 110, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, null, 0);
|
||||
RunAfterProcessedQueuedInputEvents(testDriver);
|
||||
for (var i = 1; i < 10; i++) {
|
||||
|
@ -197,12 +197,12 @@ function* test(testDriver) {
|
|||
|
||||
yield; // this will tell the chrome process to synthesize the touchstart event
|
||||
// and then we wait to make sure it got processed:
|
||||
ok(waitFor('touchstart', 1), "Touchstart processed in chrome process");
|
||||
ok(waitFor("touchstart", 1), "Touchstart processed in chrome process");
|
||||
|
||||
// Loop through the touchmove events
|
||||
for (var i = 1; i < 10; i++) {
|
||||
yield;
|
||||
ok(waitFor('touchmove', i), "Touchmove processed in chrome process");
|
||||
ok(waitFor("touchmove", i), "Touchmove processed in chrome process");
|
||||
|
||||
// Take a snapshot after each touch move event. This forces
|
||||
// a composite each time, even we don't get a vsync in this
|
||||
|
@ -225,20 +225,20 @@ function* test(testDriver) {
|
|||
|
||||
// Wait for the touchend as well, to clear all pending testDriver resumes
|
||||
yield;
|
||||
ok(waitFor('touchend', 1), "Touchend processed in chrome process");
|
||||
ok(waitFor("touchend", 1), "Touchend processed in chrome process");
|
||||
|
||||
// Clean up the chrome process hooks
|
||||
chromeTouchEventCounter('end');
|
||||
chromeTouchEventCounter("end");
|
||||
|
||||
// Now we are going to release our grip on the child process main thread,
|
||||
// so that all the DOM events that were queued up can be processed. We
|
||||
// register a touchstart listener to make sure this happens.
|
||||
document.body.removeEventListener('touchstart', failure);
|
||||
document.body.removeEventListener("touchstart", failure);
|
||||
var listenerFunc = listener(testDriver);
|
||||
document.body.addEventListener('touchstart', listenerFunc, { passive: true });
|
||||
dump('done registering listener, going to yield\n');
|
||||
document.body.addEventListener("touchstart", listenerFunc, { passive: true });
|
||||
dump("done registering listener, going to yield\n");
|
||||
yield;
|
||||
document.body.removeEventListener('touchstart', listenerFunc);
|
||||
document.body.removeEventListener("touchstart", listenerFunc);
|
||||
}
|
||||
|
||||
if (SpecialPowers.isMainProcess()) {
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
|
||||
<script type="application/javascript">
|
||||
function* test(testDriver) {
|
||||
var target = document.getElementById('target');
|
||||
var target = document.getElementById("target");
|
||||
|
||||
document.body.addEventListener('touchend', testDriver, { passive: true });
|
||||
document.body.addEventListener("touchend", testDriver, { passive: true });
|
||||
|
||||
// drag the page up to scroll down by 50px
|
||||
yield ok(synthesizeNativeTouchDrag(target, 10, 100, 0, -50),
|
||||
|
|
|
@ -45,12 +45,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1151667
|
|||
<script type="application/javascript">
|
||||
|
||||
function startTest() {
|
||||
var subframe = document.getElementById('subframe');
|
||||
var subframe = document.getElementById("subframe");
|
||||
synthesizeNativeWheelAndWaitForScrollEvent(subframe, 100, 150, 0, -10, continueTest);
|
||||
}
|
||||
|
||||
function continueTest() {
|
||||
var subframe = document.getElementById('subframe');
|
||||
var subframe = document.getElementById("subframe");
|
||||
is(subframe.scrollTop > 0, true, "We should have scrolled the subframe down");
|
||||
is(document.documentElement.scrollTop, 0, "We should not have scrolled the page");
|
||||
SimpleTest.finish();
|
||||
|
|
|
@ -22,12 +22,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1253683
|
|||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
var container = document.getElementById('container');
|
||||
var no_layer = document.getElementById('no_layer');
|
||||
var container = document.getElementById("container");
|
||||
var no_layer = document.getElementById("no_layer");
|
||||
|
||||
// Check initial state
|
||||
is(container.scrollTop, 0, "Initial scrollY should be 0");
|
||||
ok(!isLayerized('no_layer'), "initially 'no_layer' should not be layerized");
|
||||
ok(!isLayerized("no_layer"), "initially 'no_layer' should not be layerized");
|
||||
|
||||
// Scrolling over outer1 should layerize outer1, but not inner1.
|
||||
yield moveMouseAndScrollWheelOver(no_layer, 10, 10, testDriver, true);
|
||||
|
@ -36,7 +36,7 @@ function* test(testDriver) {
|
|||
});
|
||||
|
||||
ok(container.scrollTop > 0, "We should have scrolled the body");
|
||||
ok(!isLayerized('no_layer'), "no_layer should still not be layerized");
|
||||
ok(!isLayerized("no_layer"), "no_layer should still not be layerized");
|
||||
}
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -14,8 +14,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1277814
|
|||
<script type="application/javascript">
|
||||
function* test(testDriver) {
|
||||
// Trigger the buggy scenario
|
||||
var subframe = document.getElementById('bug1277814-div');
|
||||
subframe.classList.add('a');
|
||||
var subframe = document.getElementById("bug1277814-div");
|
||||
subframe.classList.add("a");
|
||||
|
||||
// The transform change is animated, so let's step through 1s of animation
|
||||
var utils = SpecialPowers.getDOMWindowUtils(window);
|
||||
|
@ -50,8 +50,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1277814
|
|||
var paint = contentTestData.paints[seqNo];
|
||||
for (var scrollId in paint) {
|
||||
var scrollFrame = paint[scrollId];
|
||||
if ('contentDescription' in scrollFrame &&
|
||||
scrollFrame['contentDescription'].includes('bug1277814-div')) {
|
||||
if ("contentDescription" in scrollFrame &&
|
||||
scrollFrame["contentDescription"].includes("bug1277814-div")) {
|
||||
foundIt = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1304689
|
|||
|
||||
function* test(testDriver) {
|
||||
var utils = SpecialPowers.DOMWindowUtils;
|
||||
var elm = document.getElementById('outer');
|
||||
var elm = document.getElementById("outer");
|
||||
|
||||
// Set margins on the element, to ensure it is layerized
|
||||
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /*priority*/ 1);
|
||||
|
@ -55,7 +55,7 @@ function* test(testDriver) {
|
|||
// Do another scroll update but also do a frame reconstruction within the same
|
||||
// tick of the refresh driver.
|
||||
elm.scrollTop = 100;
|
||||
elm.classList.add('contentBefore');
|
||||
elm.classList.add("contentBefore");
|
||||
|
||||
// Now let everything settle and all the animations run out
|
||||
for (var i = 0; i < 60; i++) {
|
||||
|
|
|
@ -35,7 +35,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1304689
|
|||
|
||||
function* test(testDriver) {
|
||||
var utils = SpecialPowers.DOMWindowUtils;
|
||||
var elm = document.getElementById('outer');
|
||||
var elm = document.getElementById("outer");
|
||||
|
||||
// Set margins on the element, to ensure it is layerized
|
||||
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /*priority*/ 1);
|
||||
|
@ -57,9 +57,9 @@ function* test(testDriver) {
|
|||
|
||||
// Do another scroll update but also do a frame reconstruction within the same
|
||||
// tick of the refresh driver.
|
||||
elm.classList.add('instant');
|
||||
elm.classList.add("instant");
|
||||
elm.scrollTop = 100;
|
||||
elm.classList.add('contentBefore');
|
||||
elm.classList.add("contentBefore");
|
||||
|
||||
// Now let everything settle and all the animations run out
|
||||
for (var i = 0; i < 60; i++) {
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const subtests = [
|
||||
{ file: 'helper_bug1464568_transform.html',
|
||||
{ file: "helper_bug1464568_transform.html",
|
||||
prefs: [["apz.test.logging_enabled", true]] },
|
||||
{ file: 'helper_bug1464568_opacity.html',
|
||||
{ file: "helper_bug1464568_opacity.html",
|
||||
prefs: [["apz.test.logging_enabled", true]] },
|
||||
];
|
||||
// Run the actual test in its own window, because it requires that the
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
function* test(testDriver) {
|
||||
var elm = document.getElementsByClassName('inner')[0];
|
||||
var elm = document.getElementsByClassName("inner")[0];
|
||||
elm.scrollTop = 0;
|
||||
yield flushApzRepaints(testDriver);
|
||||
|
||||
|
@ -178,11 +178,11 @@ function* test(testDriver) {
|
|||
// Register the listener that triggers the frame reconstruction
|
||||
elm.onscroll = function() {
|
||||
// Do the reconstruction
|
||||
elm.parentNode.classList.add('contentBefore');
|
||||
elm.parentNode.classList.add("contentBefore");
|
||||
frameReconstructionTriggered++;
|
||||
// schedule a thing to undo the changes above
|
||||
setTimeout(function() {
|
||||
elm.parentNode.classList.remove('contentBefore');
|
||||
elm.parentNode.classList.remove("contentBefore");
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,15 +27,15 @@ var prefs = [
|
|||
];
|
||||
|
||||
var subtests = [
|
||||
{'file': 'helper_hittest_basic.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_fixed_in_scrolled_transform.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_float_bug1434846.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_float_bug1443518.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_checkerboard.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_backface_hidden.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_touchaction.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_nested_transforms_bug1459696.html', 'prefs': prefs},
|
||||
{'file': 'helper_hittest_sticky_bug1478304.html', 'prefs': prefs}
|
||||
{"file": "helper_hittest_basic.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_fixed_in_scrolled_transform.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_float_bug1434846.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_float_bug1443518.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_checkerboard.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_backface_hidden.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_touchaction.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_nested_transforms_bug1459696.html", "prefs": prefs},
|
||||
{"file": "helper_hittest_sticky_bug1478304.html", "prefs": prefs}
|
||||
];
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<script type="application/javascript">
|
||||
|
||||
var subtests = [
|
||||
{'file': 'helper_key_scroll.html', prefs: [["apz.test.logging_enabled", true],
|
||||
{"file": "helper_key_scroll.html", prefs: [["apz.test.logging_enabled", true],
|
||||
["test.events.async.enabled", true]]},
|
||||
];
|
||||
|
||||
|
|
|
@ -10,28 +10,28 @@
|
|||
|
||||
var subtests = [
|
||||
// Sanity test to synthesize a mouse click
|
||||
{'file': 'helper_click.html?dtc=false'},
|
||||
{"file": "helper_click.html?dtc=false"},
|
||||
// Same as above, but with a dispatch-to-content region that exercises the
|
||||
// main-thread notification codepaths for mouse events
|
||||
{'file': 'helper_click.html?dtc=true'},
|
||||
{"file": "helper_click.html?dtc=true"},
|
||||
// Sanity test for click but with some mouse movement between the down and up
|
||||
{'file': 'helper_drag_click.html'},
|
||||
{"file": "helper_drag_click.html"},
|
||||
// Test for dragging on a fake-scrollbar element that scrolls the page
|
||||
{'file': 'helper_drag_scroll.html'},
|
||||
{"file": "helper_drag_scroll.html"},
|
||||
// Test for dragging the scrollbar with a fixed-pos element overlaying it
|
||||
{'file': 'helper_bug1346632.html'},
|
||||
{"file": "helper_bug1346632.html"},
|
||||
// Test for scrollbar-dragging on a scrollframe that's inactive
|
||||
{'file': 'helper_bug1326290.html'},
|
||||
{"file": "helper_bug1326290.html"},
|
||||
// Test for scrollbar-dragging on a scrollframe inside an SVGEffects
|
||||
{'file': 'helper_bug1331693.html'},
|
||||
{"file": "helper_bug1331693.html"},
|
||||
// Test for scrollbar-dragging on a transformed scrollframe inside a fixed-pos item
|
||||
{'file': 'helper_bug1462961.html'},
|
||||
{"file": "helper_bug1462961.html"},
|
||||
// Scrollbar dragging where we exercise the snapback behaviour by moving the
|
||||
// mouse away from the scrollbar during drag
|
||||
{'file': 'helper_scrollbar_snap_bug1501062.html'},
|
||||
{"file": "helper_scrollbar_snap_bug1501062.html"},
|
||||
// Tests for scrollbar-dragging on scrollframes inside nested transforms
|
||||
{'file': 'helper_bug1490393.html'},
|
||||
{'file': 'helper_bug1490393-2.html'}
|
||||
{"file": "helper_bug1490393.html"},
|
||||
{"file": "helper_bug1490393-2.html"}
|
||||
];
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -11,15 +11,15 @@
|
|||
var prefs = [
|
||||
// turn off smooth scrolling so that we don't have to wait for
|
||||
// APZ animations to finish before sampling the scroll offset
|
||||
['general.smoothScroll', false],
|
||||
["general.smoothScroll", false],
|
||||
// Increase the content response timeout because these tests do preventDefault
|
||||
// and we want to make sure APZ actually waits for them.
|
||||
['apz.content_response_timeout', 10000],
|
||||
["apz.content_response_timeout", 10000],
|
||||
]
|
||||
|
||||
var subtests = [
|
||||
{'file': 'helper_override_root.html', 'prefs': prefs},
|
||||
{'file': 'helper_override_subdoc.html', 'prefs': prefs},
|
||||
{"file": "helper_override_root.html", "prefs": prefs},
|
||||
{"file": "helper_override_subdoc.html", "prefs": prefs},
|
||||
];
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -14,12 +14,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1285070
|
|||
let isWindows = navigator.platform.indexOf("Win") == 0;
|
||||
let enablePE = ["dom.w3c_pointer_events.enabled", true];
|
||||
var subtests = [
|
||||
{'file': 'helper_bug1285070.html', 'prefs': [enablePE]},
|
||||
{'file': 'helper_bug1299195.html', 'prefs': [enablePE]},
|
||||
{'file': 'helper_bug1414336.html', 'prefs': [enablePE,
|
||||
{"file": "helper_bug1285070.html", "prefs": [enablePE]},
|
||||
{"file": "helper_bug1299195.html", "prefs": [enablePE]},
|
||||
{"file": "helper_bug1414336.html", "prefs": [enablePE,
|
||||
["apz.test.fails_with_native_injection", isWindows]
|
||||
]},
|
||||
{'file': 'helper_bug1502010_unconsumed_pan.html', 'prefs': [enablePE]}
|
||||
{"file": "helper_bug1502010_unconsumed_pan.html", "prefs": [enablePE]}
|
||||
];
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -19,22 +19,22 @@ var subtests = [
|
|||
// an injected touch event every 100ms, because it waits for a paint between
|
||||
// the touchstart and the touchend, so we have to use the "fake injection"
|
||||
// code instead.
|
||||
{'file': 'helper_bug1162771.html', 'prefs': [["ui.click_hold_context_menus.delay", 10000],
|
||||
{"file": "helper_bug1162771.html", "prefs": [["ui.click_hold_context_menus.delay", 10000],
|
||||
["apz.test.fails_with_native_injection", isWindows]]},
|
||||
|
||||
// As with the previous test, this test cannot inject touch events every 100ms
|
||||
// because it waits for a long-tap, so we have to use the "fake injection" code
|
||||
// instead.
|
||||
{'file': 'helper_long_tap.html', 'prefs': [["apz.test.fails_with_native_injection", isWindows]]},
|
||||
{"file": "helper_long_tap.html", "prefs": [["apz.test.fails_with_native_injection", isWindows]]},
|
||||
|
||||
// For the following tests, we want to make sure APZ doesn't wait for a content
|
||||
// response that is never going to arrive. To detect this we set the content response
|
||||
// timeout to a day, so that the entire test times out and fails if APZ does
|
||||
// end up waiting.
|
||||
{'file': 'helper_tap_passive.html', 'prefs': [["apz.content_response_timeout", 24 * 60 * 60 * 1000],
|
||||
{"file": "helper_tap_passive.html", "prefs": [["apz.content_response_timeout", 24 * 60 * 60 * 1000],
|
||||
["apz.test.fails_with_native_injection", isWindows]]},
|
||||
|
||||
{'file': 'helper_tap_default_passive.html', 'prefs': [["apz.content_response_timeout", 24 * 60 * 60 * 1000],
|
||||
{"file": "helper_tap_default_passive.html", "prefs": [["apz.content_response_timeout", 24 * 60 * 60 * 1000],
|
||||
["apz.test.fails_with_native_injection", isWindows],
|
||||
["dom.event.default_to_passive_touch_listeners", true]]},
|
||||
|
||||
|
|
|
@ -17,14 +17,14 @@ var touch_action_prefs = [
|
|||
|
||||
var subtests = [
|
||||
// Simple test to exercise touch-action CSS property
|
||||
{'file': 'helper_touch_action.html', 'prefs': touch_action_prefs},
|
||||
{"file": "helper_touch_action.html", "prefs": touch_action_prefs},
|
||||
// More complex touch-action tests, with overlapping regions and such
|
||||
{'file': 'helper_touch_action_complex.html', 'prefs': touch_action_prefs},
|
||||
{"file": "helper_touch_action_complex.html", "prefs": touch_action_prefs},
|
||||
// Tests that touch-action CSS properties are handled in APZ without waiting
|
||||
// on the main-thread, when possible
|
||||
{'file': 'helper_touch_action_regions.html', 'prefs': touch_action_prefs},
|
||||
{"file": "helper_touch_action_regions.html", "prefs": touch_action_prefs},
|
||||
// Tests that touch-action inside zero-opacity items are respected
|
||||
{'file': 'helper_touch_action_zero_opacity_bug1500864.html', 'prefs': touch_action_prefs},
|
||||
{"file": "helper_touch_action_zero_opacity_bug1500864.html", "prefs": touch_action_prefs},
|
||||
|
||||
// Add new subtests to test_group_touchevents-4.html, not this file (exceptions
|
||||
// may be made for quick-running tests that need the touch-action prefs)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
var subtests = [
|
||||
// clicking on element with :active::after CSS property
|
||||
{'file': 'helper_bug1473108.html'},
|
||||
{"file": "helper_bug1473108.html"},
|
||||
// Add new subtests here. If this starts timing out because it's taking too
|
||||
// long, create a test_group_touchevents-5.html file. Refer to 1423011#c57
|
||||
// for more details.
|
||||
|
|
|
@ -14,19 +14,19 @@ var basic_pan_prefs = getPrefs("TOUCH_EVENTS:PAN");
|
|||
var subtests = [
|
||||
// Simple tests to exercise basic panning behaviour
|
||||
// The visual viewport isn't yet enabled by default and we want to test its events, too.
|
||||
{'file': 'helper_basic_pan.html', 'prefs': basic_pan_prefs.concat([["dom.visualviewport.enabled", true]])},
|
||||
{'file': 'helper_div_pan.html', 'prefs': basic_pan_prefs},
|
||||
{'file': 'helper_iframe_pan.html', 'prefs': basic_pan_prefs},
|
||||
{"file": "helper_basic_pan.html", "prefs": basic_pan_prefs.concat([["dom.visualviewport.enabled", true]])},
|
||||
{"file": "helper_div_pan.html", "prefs": basic_pan_prefs},
|
||||
{"file": "helper_iframe_pan.html", "prefs": basic_pan_prefs},
|
||||
|
||||
// Simple test to exercise touch-tapping behaviour
|
||||
{'file': 'helper_tap.html'},
|
||||
{"file": "helper_tap.html"},
|
||||
// Tapping, but with a full-zoom applied
|
||||
{'file': 'helper_tap_fullzoom.html'},
|
||||
{"file": "helper_tap_fullzoom.html"},
|
||||
|
||||
// For the following two tests, disable displayport suppression to make sure it
|
||||
// doesn't interfere with the test by scheduling paints non-deterministically.
|
||||
{'file': 'helper_scrollto_tap.html?true', 'prefs': [["apz.paint_skipping.enabled", true]], 'dp_suppression': false},
|
||||
{'file': 'helper_scrollto_tap.html?false', 'prefs': [["apz.paint_skipping.enabled", false]], 'dp_suppression': false},
|
||||
{"file": "helper_scrollto_tap.html?true", "prefs": [["apz.paint_skipping.enabled", true]], "dp_suppression": false},
|
||||
{"file": "helper_scrollto_tap.html?false", "prefs": [["apz.paint_skipping.enabled", false]], "dp_suppression": false},
|
||||
|
||||
// Add new subtests to test_group_touch_events-4.html, not this file.
|
||||
];
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
var prefs = [
|
||||
// turn off smooth scrolling so that we don't have to wait for
|
||||
// APZ animations to finish before sampling the scroll offset
|
||||
['general.smoothScroll', false],
|
||||
["general.smoothScroll", false],
|
||||
// ensure that any mouse movement will trigger a new wheel transaction,
|
||||
// because in this test we move the mouse a bunch and want to recalculate
|
||||
// the target APZC after each such movement.
|
||||
['mousewheel.transaction.ignoremovedelay', 0],
|
||||
['mousewheel.transaction.timeout', 0]
|
||||
["mousewheel.transaction.ignoremovedelay", 0],
|
||||
["mousewheel.transaction.timeout", 0]
|
||||
]
|
||||
|
||||
// For helper_scroll_over_scrollbar, we need to set a pref to force
|
||||
|
@ -32,15 +32,15 @@ var timeout_prefs = prefs.slice(); // make a copy
|
|||
timeout_prefs.push(["apz.content_response_timeout", 0]);
|
||||
|
||||
var subtests = [
|
||||
{'file': 'helper_scroll_on_position_fixed.html', 'prefs': prefs},
|
||||
{'file': 'helper_bug1271432.html', 'prefs': prefs},
|
||||
{'file': 'helper_overscroll_behavior_bug1425573.html', 'prefs': timeout_prefs},
|
||||
{'file': 'helper_overscroll_behavior_bug1425603.html', 'prefs': prefs},
|
||||
{'file': 'helper_overscroll_behavior_bug1494440.html', 'prefs': prefs},
|
||||
{'file': 'helper_scroll_inactive_perspective.html', 'prefs': prefs},
|
||||
{'file': 'helper_scroll_inactive_zindex.html', 'prefs': prefs},
|
||||
{'file': 'helper_scroll_over_scrollbar.html', 'prefs': scrollbar_prefs},
|
||||
{'file': 'helper_scroll_tables_perspective.html', 'prefs': prefs},
|
||||
{"file": "helper_scroll_on_position_fixed.html", "prefs": prefs},
|
||||
{"file": "helper_bug1271432.html", "prefs": prefs},
|
||||
{"file": "helper_overscroll_behavior_bug1425573.html", "prefs": timeout_prefs},
|
||||
{"file": "helper_overscroll_behavior_bug1425603.html", "prefs": prefs},
|
||||
{"file": "helper_overscroll_behavior_bug1494440.html", "prefs": prefs},
|
||||
{"file": "helper_scroll_inactive_perspective.html", "prefs": prefs},
|
||||
{"file": "helper_scroll_inactive_zindex.html", "prefs": prefs},
|
||||
{"file": "helper_scroll_over_scrollbar.html", "prefs": scrollbar_prefs},
|
||||
{"file": "helper_scroll_tables_perspective.html", "prefs": prefs},
|
||||
];
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -52,11 +52,11 @@ var doubletap_prefs = [
|
|||
];
|
||||
|
||||
var subtests = [
|
||||
{'file': 'helper_bug1280013.html', 'prefs': prefs},
|
||||
{'file': 'helper_basic_zoom.html', 'prefs': prefs},
|
||||
{'file': 'helper_zoomed_pan.html', 'prefs': prefs},
|
||||
{'file': 'helper_fixed_position_scroll_hittest.html', 'prefs': prefs},
|
||||
{'file': 'helper_basic_doubletap_zoom.html', 'prefs': doubletap_prefs},
|
||||
{"file": "helper_bug1280013.html", "prefs": prefs},
|
||||
{"file": "helper_basic_zoom.html", "prefs": prefs},
|
||||
{"file": "helper_zoomed_pan.html", "prefs": prefs},
|
||||
{"file": "helper_fixed_position_scroll_hittest.html", "prefs": prefs},
|
||||
{"file": "helper_basic_doubletap_zoom.html", "prefs": doubletap_prefs},
|
||||
];
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -586,7 +586,7 @@ function getAsyncScrollOffsets(aPaintsToIgnore) {
|
|||
|
||||
ok(rcd.children.length == 1, "Root content APZC has exactly one child");
|
||||
var scroll = rcd.children[0].asyncScrollOffset;
|
||||
var pieces = scroll.replace(/[()\s]+/g, '').split(',');
|
||||
var pieces = scroll.replace(/[()\s]+/g, "").split(",");
|
||||
is(pieces.length, 2, "expected string of form (x,y)");
|
||||
offsets.push({ x: parseInt(pieces[0]),
|
||||
y: parseInt(pieces[1]) });
|
||||
|
@ -602,7 +602,7 @@ function* test(testDriver) {
|
|||
// and discard those later.
|
||||
var framesToSkip = SpecialPowers.getDOMWindowUtils(window).getCompositorAPZTestData().paints.length;
|
||||
|
||||
var elm = document.getElementsByClassName('inner')[0];
|
||||
var elm = document.getElementsByClassName("inner")[0];
|
||||
// Set a zero-margin displayport to ensure that the element is async-scrollable
|
||||
// otherwise on Fennec it is not
|
||||
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, 0);
|
||||
|
@ -624,7 +624,7 @@ function* test(testDriver) {
|
|||
// interruptible reflow. That reflow *will* be interrupted (because of the flag
|
||||
// we set above), and we should end up with a transient 0,0 scroll offset
|
||||
// being sent to the compositor.
|
||||
elm.parentNode.classList.add('contentBefore');
|
||||
elm.parentNode.classList.add("contentBefore");
|
||||
utils.advanceTimeAndRefresh(0);
|
||||
// On android, and maybe non-e10s platforms generally, we need to manually
|
||||
// kick the paint to send the layer transaction to the compositor.
|
||||
|
|
|
@ -74,65 +74,65 @@ function asyncWrapper(testDriver) {
|
|||
|
||||
function* test(testDriver) {
|
||||
// Initially, nothing should be layerized.
|
||||
ok(!isLayerized('outer1'), "initially 'outer1' should not be layerized");
|
||||
ok(!isLayerized('inner1'), "initially 'inner1' should not be layerized");
|
||||
ok(!isLayerized('outer2'), "initially 'outer2' should not be layerized");
|
||||
ok(!isLayerized('inner2'), "initially 'inner2' should not be layerized");
|
||||
ok(!isLayerized('outer3'), "initially 'outer3' should not be layerized");
|
||||
ok(!isLayerized('inner3'), "initially 'inner3' should not be layerized");
|
||||
ok(!isLayerized('outer4'), "initially 'outer4' should not be layerized");
|
||||
ok(!isLayerized('inner4'), "initially 'inner4' should not be layerized");
|
||||
ok(!isLayerized("outer1"), "initially 'outer1' should not be layerized");
|
||||
ok(!isLayerized("inner1"), "initially 'inner1' should not be layerized");
|
||||
ok(!isLayerized("outer2"), "initially 'outer2' should not be layerized");
|
||||
ok(!isLayerized("inner2"), "initially 'inner2' should not be layerized");
|
||||
ok(!isLayerized("outer3"), "initially 'outer3' should not be layerized");
|
||||
ok(!isLayerized("inner3"), "initially 'inner3' should not be layerized");
|
||||
ok(!isLayerized("outer4"), "initially 'outer4' should not be layerized");
|
||||
ok(!isLayerized("inner4"), "initially 'inner4' should not be layerized");
|
||||
|
||||
// Scrolling over outer1 should layerize outer1, but not inner1.
|
||||
yield scrollWheelOver(document.getElementById('outer1'), true, testDriver);
|
||||
ok(isLayerized('outer1'), "scrolling 'outer1' should cause it to be layerized");
|
||||
ok(!isLayerized('inner1'), "scrolling 'outer1' should not cause 'inner1' to be layerized");
|
||||
yield scrollWheelOver(document.getElementById("outer1"), true, testDriver);
|
||||
ok(isLayerized("outer1"), "scrolling 'outer1' should cause it to be layerized");
|
||||
ok(!isLayerized("inner1"), "scrolling 'outer1' should not cause 'inner1' to be layerized");
|
||||
|
||||
// Scrolling over inner2 should layerize both outer2 and inner2.
|
||||
yield scrollWheelOver(document.getElementById('inner2'), true, testDriver);
|
||||
ok(isLayerized('inner2'), "scrolling 'inner2' should cause it to be layerized");
|
||||
ok(isLayerized('outer2'), "scrolling 'inner2' should also cause 'outer2' to be layerized");
|
||||
yield scrollWheelOver(document.getElementById("inner2"), true, testDriver);
|
||||
ok(isLayerized("inner2"), "scrolling 'inner2' should cause it to be layerized");
|
||||
ok(isLayerized("outer2"), "scrolling 'inner2' should also cause 'outer2' to be layerized");
|
||||
|
||||
// The second half of the test repeats the same checks as the first half,
|
||||
// but with an iframe as the outer scrollable frame.
|
||||
|
||||
// Scrolling over outer3 should layerize outer3, but not inner3.
|
||||
yield scrollWheelOver(document.getElementById('outer3').contentDocument.documentElement, true, testDriver);
|
||||
ok(isLayerized('outer3'), "scrolling 'outer3' should cause it to be layerized");
|
||||
ok(!isLayerized('inner3'), "scrolling 'outer3' should not cause 'inner3' to be layerized");
|
||||
yield scrollWheelOver(document.getElementById("outer3").contentDocument.documentElement, true, testDriver);
|
||||
ok(isLayerized("outer3"), "scrolling 'outer3' should cause it to be layerized");
|
||||
ok(!isLayerized("inner3"), "scrolling 'outer3' should not cause 'inner3' to be layerized");
|
||||
|
||||
// Scrolling over outer4 should layerize both outer4 and inner4.
|
||||
yield scrollWheelOver(document.getElementById('outer4').contentDocument.getElementById('inner4'), true, testDriver);
|
||||
ok(isLayerized('inner4'), "scrolling 'inner4' should cause it to be layerized");
|
||||
ok(isLayerized('outer4'), "scrolling 'inner4' should also cause 'outer4' to be layerized");
|
||||
yield scrollWheelOver(document.getElementById("outer4").contentDocument.getElementById("inner4"), true, testDriver);
|
||||
ok(isLayerized("inner4"), "scrolling 'inner4' should cause it to be layerized");
|
||||
ok(isLayerized("outer4"), "scrolling 'inner4' should also cause 'outer4' to be layerized");
|
||||
|
||||
// Now we enable displayport expiry, and verify that things are still
|
||||
// layerized as they were before.
|
||||
yield SpecialPowers.pushPrefEnv({"set": [["apz.displayport_expiry_ms", DISPLAYPORT_EXPIRY]]}, testDriver);
|
||||
ok(isLayerized('outer1'), "outer1 is still layerized after enabling expiry");
|
||||
ok(!isLayerized('inner1'), "inner1 is still not layerized after enabling expiry");
|
||||
ok(isLayerized('outer2'), "outer2 is still layerized after enabling expiry");
|
||||
ok(isLayerized('inner2'), "inner2 is still layerized after enabling expiry");
|
||||
ok(isLayerized('outer3'), "outer3 is still layerized after enabling expiry");
|
||||
ok(!isLayerized('inner3'), "inner3 is still not layerized after enabling expiry");
|
||||
ok(isLayerized('outer4'), "outer4 is still layerized after enabling expiry");
|
||||
ok(isLayerized('inner4'), "inner4 is still layerized after enabling expiry");
|
||||
ok(isLayerized("outer1"), "outer1 is still layerized after enabling expiry");
|
||||
ok(!isLayerized("inner1"), "inner1 is still not layerized after enabling expiry");
|
||||
ok(isLayerized("outer2"), "outer2 is still layerized after enabling expiry");
|
||||
ok(isLayerized("inner2"), "inner2 is still layerized after enabling expiry");
|
||||
ok(isLayerized("outer3"), "outer3 is still layerized after enabling expiry");
|
||||
ok(!isLayerized("inner3"), "inner3 is still not layerized after enabling expiry");
|
||||
ok(isLayerized("outer4"), "outer4 is still layerized after enabling expiry");
|
||||
ok(isLayerized("inner4"), "inner4 is still layerized after enabling expiry");
|
||||
|
||||
// Now we trigger a scroll on some of the things still layerized, so that
|
||||
// the displayport expiry gets triggered.
|
||||
|
||||
// Expire displayport with scrolling on outer1
|
||||
yield scrollWheelOver(document.getElementById('outer1'), true, testDriver);
|
||||
yield scrollWheelOver(document.getElementById("outer1"), true, testDriver);
|
||||
yield waitForAllPaints(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
});
|
||||
yield setTimeout(testDriver, DISPLAYPORT_EXPIRY);
|
||||
yield waitForAllPaints(asyncWrapper(testDriver));
|
||||
ok(!isLayerized('outer1'), "outer1 is no longer layerized after displayport expiry");
|
||||
ok(!isLayerized('inner1'), "inner1 is still not layerized after displayport expiry");
|
||||
ok(!isLayerized("outer1"), "outer1 is no longer layerized after displayport expiry");
|
||||
ok(!isLayerized("inner1"), "inner1 is still not layerized after displayport expiry");
|
||||
|
||||
// Expire displayport with scrolling on inner2
|
||||
yield scrollWheelOver(document.getElementById('inner2'), true, testDriver);
|
||||
yield scrollWheelOver(document.getElementById("inner2"), true, testDriver);
|
||||
yield waitForAllPaints(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
});
|
||||
|
@ -140,10 +140,10 @@ function* test(testDriver) {
|
|||
// both, one at a time.
|
||||
yield setTimeout(testDriver, DISPLAYPORT_EXPIRY);
|
||||
yield waitForAllPaints(asyncWrapper(testDriver));
|
||||
ok(!isLayerized('inner2'), "inner2 is no longer layerized after displayport expiry");
|
||||
ok(!isLayerized("inner2"), "inner2 is no longer layerized after displayport expiry");
|
||||
yield setTimeout(testDriver, DISPLAYPORT_EXPIRY);
|
||||
yield waitForAllPaints(asyncWrapper(testDriver));
|
||||
ok(!isLayerized('outer2'), "outer2 got de-layerized with inner2");
|
||||
ok(!isLayerized("outer2"), "outer2 got de-layerized with inner2");
|
||||
|
||||
// Scroll on inner3. inner3 isn't layerized, and this will cause it to
|
||||
// get layerized, but it will also trigger displayport expiration for inner3
|
||||
|
@ -154,7 +154,7 @@ function* test(testDriver) {
|
|||
// However, if we do get a scroll event while waiting for the expiry, we need
|
||||
// to restart the expiry timer because the displayport expiry got reset. There's
|
||||
// no good way that I can think of to deterministically avoid doing this.
|
||||
let inner3 = document.getElementById('outer3').contentDocument.getElementById('inner3');
|
||||
let inner3 = document.getElementById("outer3").contentDocument.getElementById("inner3");
|
||||
yield scrollWheelOver(inner3, false, testDriver);
|
||||
yield waitForAllPaints(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
|
@ -167,27 +167,27 @@ function* test(testDriver) {
|
|||
// by not updating timerId we ensure that this listener resets the timeout
|
||||
// at most once.
|
||||
};
|
||||
inner3.addEventListener('scroll', timeoutResetter);
|
||||
inner3.addEventListener("scroll", timeoutResetter);
|
||||
yield; // wait for the setTimeout to elapse
|
||||
inner3.removeEventListener('scroll', timeoutResetter);
|
||||
inner3.removeEventListener("scroll", timeoutResetter);
|
||||
|
||||
yield waitForAllPaints(asyncWrapper(testDriver));
|
||||
ok(!isLayerized('inner3'), "inner3 becomes unlayerized after expiry");
|
||||
ok(!isLayerized("inner3"), "inner3 becomes unlayerized after expiry");
|
||||
yield setTimeout(testDriver, DISPLAYPORT_EXPIRY);
|
||||
yield waitForAllPaints(asyncWrapper(testDriver));
|
||||
ok(!isLayerized('outer3'), "outer3 is no longer layerized after inner3 triggered expiry");
|
||||
ok(!isLayerized("outer3"), "outer3 is no longer layerized after inner3 triggered expiry");
|
||||
|
||||
// Scroll outer4 and wait for the expiry. It should NOT get expired because
|
||||
// inner4 is still layerized
|
||||
yield scrollWheelOver(document.getElementById('outer4').contentDocument.documentElement, true, testDriver);
|
||||
yield scrollWheelOver(document.getElementById("outer4").contentDocument.documentElement, true, testDriver);
|
||||
yield waitForAllPaints(function() {
|
||||
flushApzRepaints(testDriver);
|
||||
});
|
||||
// Wait for the expiry to elapse
|
||||
yield setTimeout(testDriver, DISPLAYPORT_EXPIRY);
|
||||
yield waitForAllPaints(asyncWrapper(testDriver));
|
||||
ok(isLayerized('inner4'), "inner4 is still layerized because it never expired");
|
||||
ok(isLayerized('outer4'), "outer4 is still layerized because inner4 is still layerized");
|
||||
ok(isLayerized("inner4"), "inner4 is still layerized because it never expired");
|
||||
ok(isLayerized("outer4"), "outer4 is still layerized because inner4 is still layerized");
|
||||
}
|
||||
|
||||
if (isApzEnabled()) {
|
||||
|
|
|
@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1453425
|
|||
function* test(testDriver) {
|
||||
var utils = SpecialPowers.DOMWindowUtils;
|
||||
|
||||
var elm = document.querySelector('#frame');
|
||||
var elm = document.querySelector("#frame");
|
||||
// Set a zero-margin displayport to ensure that the element is async-scrollable
|
||||
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, 0);
|
||||
elm.scrollTop = 0;
|
||||
|
@ -54,14 +54,14 @@ function* test(testDriver) {
|
|||
elm.scrollBy(0, 100);
|
||||
|
||||
// We are not using `scroll-behavior`
|
||||
is(elm.scrollTop, 100, 'the main thread scroll should be instant');
|
||||
is(elm.scrollTop, 100, "the main thread scroll should be instant");
|
||||
|
||||
// Dispatch a wheel event to have APZ scroll by (0, 8). Wait for the wheel
|
||||
// event to ensure that the APZ has processed the scroll.
|
||||
yield synthesizeNativeWheelAndWaitForWheelEvent(elm, 40, 40, 0, -8, testDriver);
|
||||
|
||||
// APZ should be handling the wheel scroll
|
||||
is(elm.scrollTop, 100, 'the wheel scroll should be handled by APZ');
|
||||
is(elm.scrollTop, 100, "the wheel scroll should be handled by APZ");
|
||||
|
||||
// Restore control of the refresh driver, allowing the main thread to send a
|
||||
// layer transaction containing the (0, 100) scroll.
|
||||
|
|
|
@ -487,8 +487,8 @@ p {
|
|||
</div>
|
||||
<script clss="testbody" type="text/javascript">
|
||||
function ScrollTops() {
|
||||
this.outerScrollTop = document.getElementById('iframe-body').scrollTop;
|
||||
this.innerScrollTop = document.getElementById('subframe').scrollTop;
|
||||
this.outerScrollTop = document.getElementById("iframe-body").scrollTop;
|
||||
this.innerScrollTop = document.getElementById("subframe").scrollTop;
|
||||
}
|
||||
|
||||
var DefaultEvent = {
|
||||
|
@ -498,7 +498,7 @@ var DefaultEvent = {
|
|||
};
|
||||
|
||||
function test() {
|
||||
var subframe = document.getElementById('subframe');
|
||||
var subframe = document.getElementById("subframe");
|
||||
var oldpos = new ScrollTops();
|
||||
sendWheelAndPaint(subframe, 10, 10, DefaultEvent, function () {
|
||||
var newpos = new ScrollTops();
|
||||
|
@ -509,7 +509,7 @@ function test() {
|
|||
}
|
||||
|
||||
function doOuterScroll(subframe, oldpos) {
|
||||
var outer = document.getElementById('iframe-body');
|
||||
var outer = document.getElementById("iframe-body");
|
||||
sendWheelAndPaint(outer, 20, 5, DefaultEvent, function () {
|
||||
var newpos = new ScrollTops();
|
||||
ok(oldpos.outerScrollTop != newpos.outerScrollTop, "viewport should have scrolled");
|
||||
|
@ -529,9 +529,9 @@ function doInnerScrollAgain(subframe, oldpos) {
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
pushPrefs([['general.smoothScroll', false],
|
||||
['mousewheel.transaction.timeout', 0],
|
||||
['mousewheel.transaction.ignoremovedelay', 0]])
|
||||
pushPrefs([["general.smoothScroll", false],
|
||||
["mousewheel.transaction.timeout", 0],
|
||||
["mousewheel.transaction.ignoremovedelay", 0]])
|
||||
.then(waitUntilApzStable)
|
||||
.then(test);
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
</div>
|
||||
<script class="testbody" type="text/javascript">
|
||||
function test() {
|
||||
var container = document.getElementById('container');
|
||||
var outer = document.getElementById('outer');
|
||||
var inner = document.getElementById('inner');
|
||||
var container = document.getElementById("container");
|
||||
var outer = document.getElementById("outer");
|
||||
var inner = document.getElementById("inner");
|
||||
var outerScrollTop = outer.scrollTop;
|
||||
var containerScrollTop = container.scrollTop;
|
||||
var event = {
|
||||
|
@ -38,8 +38,8 @@ function test() {
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
pushPrefs([['general.smoothScroll', false],
|
||||
['mousewheel.transaction.timeout', 1000000]])
|
||||
pushPrefs([["general.smoothScroll", false],
|
||||
["mousewheel.transaction.timeout", 1000000]])
|
||||
.then(waitUntilApzStable)
|
||||
.then(test);
|
||||
|
||||
|
|
|
@ -69,10 +69,10 @@ var DefaultEvent = {
|
|||
var ScrollbarWidth = 0;
|
||||
|
||||
function test() {
|
||||
var subframe = document.getElementById('subframe');
|
||||
var subframe = document.getElementById("subframe");
|
||||
var oldClientWidth = subframe.clientWidth;
|
||||
|
||||
subframe.style.overflow = 'auto';
|
||||
subframe.style.overflow = "auto";
|
||||
subframe.getBoundingClientRect();
|
||||
|
||||
waitForAllPaintsFlushed(function () {
|
||||
|
@ -106,9 +106,9 @@ function testScrolling(subframe) {
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
pushPrefs([['general.smoothScroll', false],
|
||||
['mousewheel.transaction.timeout', 0],
|
||||
['mousewheel.transaction.ignoremovedelay', 0]])
|
||||
pushPrefs([["general.smoothScroll", false],
|
||||
["mousewheel.transaction.timeout", 0],
|
||||
["mousewheel.transaction.ignoremovedelay", 0]])
|
||||
.then(waitUntilApzStable)
|
||||
.then(test);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ function takeSnapshots(e) {
|
|||
var success = false;
|
||||
|
||||
// Get the position of the 'content' div relative to the screen
|
||||
var rect = rectRelativeToScreen(document.getElementById('content'));
|
||||
var rect = rectRelativeToScreen(document.getElementById("content"));
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(16);
|
||||
|
@ -64,15 +64,15 @@ function takeSnapshots(e) {
|
|||
}
|
||||
|
||||
function* test(testDriver) {
|
||||
var box = document.getElementById('box');
|
||||
var box = document.getElementById("box");
|
||||
|
||||
// Ensure the div is layerized by scrolling it
|
||||
yield moveMouseAndScrollWheelOver(box, 10, 10, testDriver);
|
||||
|
||||
box.addEventListener('touchstart', function(e) {
|
||||
box.addEventListener("touchstart", function(e) {
|
||||
ok(false, "This should never be run");
|
||||
});
|
||||
box.addEventListener('wheel', takeSnapshots, { capture: false, passive: true });
|
||||
box.addEventListener("wheel", takeSnapshots, { capture: false, passive: true });
|
||||
|
||||
// Let the event regions and layerization propagate to the APZ
|
||||
yield waitForAllPaints(function() {
|
||||
|
|
|
@ -78,11 +78,11 @@ document.getElementById("scrollbox").addEventListener("wheel", function (e) {
|
|||
});
|
||||
|
||||
function* test(testDriver) {
|
||||
var content = document.getElementById('content');
|
||||
var content = document.getElementById("content");
|
||||
for (i = 0; i < 300; i++) { // enough iterations that we would scroll to the bottom of 'content'
|
||||
yield synthesizeNativeWheelAndWaitForWheelEvent(content, 100, 150, 0, -5, testDriver);
|
||||
}
|
||||
var scrollbox = document.getElementById('scrollbox');
|
||||
var scrollbox = document.getElementById("scrollbox");
|
||||
is(content.scrollTop > 0, true, "We should have scrolled down somewhat");
|
||||
is(content.scrollTop < content.scrollTopMax, true, "We should not have scrolled to the bottom of the scrollframe");
|
||||
is(rotationAdjusted, true, "The rotation should have been adjusted");
|
||||
|
|
|
@ -46,9 +46,9 @@ function scrollWheelOver(element, deltaY, testDriver) {
|
|||
}
|
||||
|
||||
function* test(testDriver) {
|
||||
var outer = document.getElementById('outer-frame');
|
||||
var inner = document.getElementById('inner-frame');
|
||||
var innerContent = document.getElementById('inner-content');
|
||||
var outer = document.getElementById("outer-frame");
|
||||
var inner = document.getElementById("inner-frame");
|
||||
var innerContent = document.getElementById("inner-content");
|
||||
|
||||
// Register a wheel event listener that records the target of
|
||||
// the last wheel event, so that we can make assertions about it.
|
||||
|
|
|
@ -76,12 +76,12 @@ function parseDisplayList(lines) {
|
|||
var lastSpace = -1;
|
||||
var lastFieldStart = -1;
|
||||
for (var j = 0; j < rest.length; j++) {
|
||||
if (rest.charAt(j) == '(') {
|
||||
if (rest.charAt(j) == "(") {
|
||||
nesting++;
|
||||
if (nesting == 1) {
|
||||
startIndex = j;
|
||||
}
|
||||
} else if (rest.charAt(j) == ')') {
|
||||
} else if (rest.charAt(j) == ")") {
|
||||
nesting--;
|
||||
if (nesting == 0) {
|
||||
var name = rest.substring(lastSpace + 1, startIndex);
|
||||
|
@ -99,7 +99,7 @@ function parseDisplayList(lines) {
|
|||
layerObject[name] = value;
|
||||
}
|
||||
}
|
||||
} else if (nesting == 0 && rest.charAt(j) == ' ') {
|
||||
} else if (nesting == 0 && rest.charAt(j) == " ") {
|
||||
lastSpace = j;
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ function parseDisplayList(lines) {
|
|||
}
|
||||
|
||||
function trim(s){
|
||||
return ( s || '' ).replace( /^\s+|\s+$/g, '' );
|
||||
return ( s || "" ).replace( /^\s+|\s+$/g, "" );
|
||||
}
|
||||
|
||||
function getDataURI(str) {
|
||||
|
@ -220,7 +220,7 @@ function parseLayers(layersDumpLines) {
|
|||
str = trim(str);
|
||||
|
||||
// Something like '< (x=0, y=0, w=2842, h=158); (x=0, y=1718, w=2842, h=500); >'
|
||||
if (str.charAt(0) != '<' || str.charAt(str.length - 1) != '>') {
|
||||
if (str.charAt(0) != "<" || str.charAt(str.length - 1) != ">") {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -336,12 +336,12 @@ function parseLayers(layersDumpLines) {
|
|||
var nesting = 0;
|
||||
var startIndex;
|
||||
for (var j = 0; j < rest.length; j++) {
|
||||
if (rest.charAt(j) == '[') {
|
||||
if (rest.charAt(j) == "[") {
|
||||
nesting++;
|
||||
if (nesting == 1) {
|
||||
startIndex = j;
|
||||
}
|
||||
} else if (rest.charAt(j) == ']') {
|
||||
} else if (rest.charAt(j) == "]") {
|
||||
nesting--;
|
||||
if (nesting == 0) {
|
||||
fields.push(rest.substring(startIndex + 1, j));
|
||||
|
@ -391,7 +391,7 @@ function parseLayers(layersDumpLines) {
|
|||
layerObject[fieldName].type = "color";
|
||||
continue;
|
||||
}
|
||||
if (rest[0] == '{' && rest[rest.length - 1] == '}') {
|
||||
if (rest[0] == "{" && rest[rest.length - 1] == "}") {
|
||||
var object = {};
|
||||
parseProperties(rest.substring(1, rest.length - 2).trim(), object);
|
||||
layerObject[fieldName] = object;
|
||||
|
@ -405,21 +405,21 @@ function parseLayers(layersDumpLines) {
|
|||
}
|
||||
parseProperties(rest, layerObject);
|
||||
|
||||
if (!layerObject['shadow-transform']) {
|
||||
if (!layerObject["shadow-transform"]) {
|
||||
// No shadow transform = identify
|
||||
layerObject['shadow-transform'] = [[1, 0], [0, 1], [0, 0]];
|
||||
layerObject["shadow-transform"] = [[1, 0], [0, 1], [0, 0]];
|
||||
}
|
||||
|
||||
// Compute screenTransformX/screenTransformY
|
||||
// TODO Fully support transforms
|
||||
if (layerObject['shadow-transform'] && layerObject['transform']) {
|
||||
layerObject['screen-transform'] = [layerObject['shadow-transform'][2][0], layerObject['shadow-transform'][2][1]];
|
||||
if (layerObject["shadow-transform"] && layerObject["transform"]) {
|
||||
layerObject["screen-transform"] = [layerObject["shadow-transform"][2][0], layerObject["shadow-transform"][2][1]];
|
||||
var currIndentation = indentation - 1;
|
||||
while (currIndentation >= 0) {
|
||||
var transform = objectAtIndentation[currIndentation]['shadow-transform'] || objectAtIndentation[currIndentation]['transform'];
|
||||
var transform = objectAtIndentation[currIndentation]["shadow-transform"] || objectAtIndentation[currIndentation]["transform"];
|
||||
if (transform) {
|
||||
layerObject['screen-transform'][0] += transform[2][0];
|
||||
layerObject['screen-transform'][1] += transform[2][1];
|
||||
layerObject["screen-transform"][0] += transform[2][0];
|
||||
layerObject["screen-transform"][1] += transform[2][1];
|
||||
}
|
||||
currIndentation--;
|
||||
}
|
||||
|
@ -597,9 +597,9 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
|
|||
hasImg = true;
|
||||
var offsetX = 0;
|
||||
var offsetY = 0;
|
||||
if (root.contentHostProp && root.contentHostProp['buffer-rect']) {
|
||||
offsetX = root.contentHostProp['buffer-rect'][0];
|
||||
offsetY = root.contentHostProp['buffer-rect'][1];
|
||||
if (root.contentHostProp && root.contentHostProp["buffer-rect"]) {
|
||||
offsetX = root.contentHostProp["buffer-rect"][0];
|
||||
offsetY = root.contentHostProp["buffer-rect"][1];
|
||||
}
|
||||
var surfaceImgElem = createElement("img", {
|
||||
src: getDataURI(root.surfaceURI),
|
||||
|
|
Загрузка…
Ссылка в новой задаче