Bug 1515942 - Enable ESLint for gfx/ (automatic fixes). r=kats

Differential Revision: https://phabricator.services.mozilla.com/D15205

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2018-12-27 09:44:38 +00:00
parent 2994d04574
commit 4388f2968a
44 changed files with 168 additions and 169 deletions

View file

@ -15,7 +15,7 @@ function getPlatform() {
} }
// Check for Android before Linux // Check for Android before Linux
if (navigator.appVersion.includes("Android")) { if (navigator.appVersion.includes("Android")) {
return "android" return "android";
} }
if (navigator.platform.indexOf("Linux") == 0) { if (navigator.platform.indexOf("Linux") == 0) {
return "linux"; return "linux";
@ -131,7 +131,7 @@ function coordinatesRelativeToScreen(aX, aY, aTarget) {
// The device scale applies to them, but the resolution only zooms the content. // The device scale applies to them, but the resolution only zooms the content.
return { return {
x: (targetWindow.mozInnerScreenX + ((rect.left + aX) * resolution)) * deviceScale, x: (targetWindow.mozInnerScreenX + ((rect.left + aX) * resolution)) * deviceScale,
y: (targetWindow.mozInnerScreenY + ((rect.top + aY) * resolution)) * deviceScale y: (targetWindow.mozInnerScreenY + ((rect.top + aY) * resolution)) * deviceScale,
}; };
} }
@ -145,7 +145,7 @@ function rectRelativeToScreen(aElement) {
x: (targetWindow.mozInnerScreenX + rect.left) * scale, x: (targetWindow.mozInnerScreenX + rect.left) * scale,
y: (targetWindow.mozInnerScreenY + rect.top) * scale, y: (targetWindow.mozInnerScreenY + rect.top) * scale,
w: (rect.width * scale), w: (rect.width * scale),
h: (rect.height * scale) h: (rect.height * scale),
}; };
} }
@ -175,11 +175,11 @@ function synthesizeNativeWheel(aTarget, aX, aY, aDeltaX, aDeltaY, aObserver) {
// synthesizeNativeWheel for details on the parameters. // synthesizeNativeWheel for details on the parameters.
function synthesizeNativeWheelAndWaitForObserver(aElement, aX, aY, aDeltaX, aDeltaY, aCallback) { function synthesizeNativeWheelAndWaitForObserver(aElement, aX, aY, aDeltaX, aDeltaY, aCallback) {
var observer = { var observer = {
observe: function(aSubject, aTopic, aData) { observe(aSubject, aTopic, aData) {
if (aCallback && aTopic == "mousescrollevent") { if (aCallback && aTopic == "mousescrollevent") {
setTimeout(aCallback, 0); setTimeout(aCallback, 0);
} }
} },
}; };
return synthesizeNativeWheel(aElement, aX, aY, aDeltaX, aDeltaY, observer); return synthesizeNativeWheel(aElement, aX, aY, aDeltaX, aDeltaY, observer);
} }
@ -425,7 +425,7 @@ function* dragVerticalScrollbar(element, testDriver, distance = 20, increment =
yield synthesizeNativeMouseEvent(element, mouseX, mouseY + distance, nativeMouseMoveEventMsg(), testDriver); yield synthesizeNativeMouseEvent(element, mouseX, mouseY + distance, nativeMouseMoveEventMsg(), testDriver);
// and return a generator to call afterwards to finish up the drag // and return a generator to call afterwards to finish up the drag
return function*() { return function* () {
dump("Finishing drag of #" + element.id + "\n"); dump("Finishing drag of #" + element.id + "\n");
yield synthesizeNativeMouseEvent(element, mouseX, mouseY + distance, nativeMouseUpEventMsg(), testDriver); yield synthesizeNativeMouseEvent(element, mouseX, mouseY + distance, nativeMouseUpEventMsg(), testDriver);
}; };

View file

@ -106,7 +106,7 @@ function buildApzcTree(paint) {
// Given an APZC tree produced by buildApzcTree, return the RCD node in // Given an APZC tree produced by buildApzcTree, return the RCD node in
// the tree, or null if there was none. // the tree, or null if there was none.
function findRcdNode(apzcTree) { function findRcdNode(apzcTree) {
if (!!apzcTree.isRootContent) { // isRootContent will be undefined or "1" if (apzcTree.isRootContent) { // isRootContent will be undefined or "1"
return apzcTree; return apzcTree;
} }
for (var i = 0; i < apzcTree.children.length; i++) { for (var i = 0; i < apzcTree.children.length; i++) {
@ -129,7 +129,7 @@ function isLayerized(elementId) {
var paint = contentTestData.paints[seqno]; var paint = contentTestData.paints[seqno];
for (var scrollId in paint) { for (var scrollId in paint) {
if ("contentDescription" in paint[scrollId]) { if ("contentDescription" in paint[scrollId]) {
if (paint[scrollId]["contentDescription"].includes(elementId)) { if (paint[scrollId].contentDescription.includes(elementId)) {
return true; return true;
} }
} }
@ -138,7 +138,7 @@ function isLayerized(elementId) {
} }
function promiseApzRepaintsFlushed(aWindow = window) { function promiseApzRepaintsFlushed(aWindow = window) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
var repaintDone = function() { var repaintDone = function() {
SpecialPowers.Services.obs.removeObserver(repaintDone, "apz-repaints-flushed"); SpecialPowers.Services.obs.removeObserver(repaintDone, "apz-repaints-flushed");
setTimeout(resolve, 0); setTimeout(resolve, 0);
@ -362,7 +362,7 @@ async function waitUntilApzStable() {
dump("Parent process: flushing APZ repaints was a no-op, triggering callback directly...\n"); dump("Parent process: flushing APZ repaints was a no-op, triggering callback directly...\n");
repaintDone(); repaintDone();
} }
} };
// Flush APZ repaints, but wait until all the pending paints have been // Flush APZ repaints, but wait until all the pending paints have been
// sent. // sent.
@ -506,7 +506,7 @@ function getSnapshot(rect) {
if (typeof getSnapshot.chromeHelper == "undefined") { if (typeof getSnapshot.chromeHelper == "undefined") {
// This is the first time getSnapshot is being called; do initialization // This is the first time getSnapshot is being called; do initialization
getSnapshot.chromeHelper = SpecialPowers.loadChromeScript(parentProcessSnapshot); getSnapshot.chromeHelper = SpecialPowers.loadChromeScript(parentProcessSnapshot);
ApzCleanup.register(function() { getSnapshot.chromeHelper.destroy() }); ApzCleanup.register(function() { getSnapshot.chromeHelper.destroy(); });
} }
return getSnapshot.chromeHelper.sendSyncMessage("snapshot", JSON.stringify(rect)).toString(); return getSnapshot.chromeHelper.sendSyncMessage("snapshot", JSON.stringify(rect)).toString();
@ -630,11 +630,11 @@ function checkHitResult(hitResult, expectedHitInfo, expectedScrollId, desc) {
// Symbolic constants used by hitTestScrollbar(). // Symbolic constants used by hitTestScrollbar().
var ScrollbarTrackLocation = { var ScrollbarTrackLocation = {
START: 1, START: 1,
END: 2 END: 2,
}; };
var LayerState = { var LayerState = {
ACTIVE: 1, ACTIVE: 1,
INACTIVE: 2 INACTIVE: 2,
}; };
// Perform a hit test on the scrollbar(s) of a scroll frame. // Perform a hit test on the scrollbar(s) of a scroll frame.
@ -699,7 +699,7 @@ function hitTestScrollbar(params) {
x: boundingClientRect.right - (verticalScrollbarWidth / 2), x: boundingClientRect.right - (verticalScrollbarWidth / 2),
y: (params.trackLocation == ScrollbarTrackLocation.START) y: (params.trackLocation == ScrollbarTrackLocation.START)
? (boundingClientRect.y + scrollbarArrowButtonHeight + 5) ? (boundingClientRect.y + scrollbarArrowButtonHeight + 5)
: (boundingClientRect.bottom - horizontalScrollbarHeight - scrollbarArrowButtonHeight - 5) : (boundingClientRect.bottom - horizontalScrollbarHeight - scrollbarArrowButtonHeight - 5),
}; };
checkHitResult(hitTest(verticalScrollbarPoint), checkHitResult(hitTest(verticalScrollbarPoint),
expectedHitInfo | APZHitResultFlags.SCROLLBAR_VERTICAL, expectedHitInfo | APZHitResultFlags.SCROLLBAR_VERTICAL,
@ -754,7 +754,7 @@ function getPrefs(ident) {
var ApzCleanup = { var ApzCleanup = {
_cleanups: [], _cleanups: [],
register: function(func) { register(func) {
if (this._cleanups.length == 0) { if (this._cleanups.length == 0) {
if (!window.isApzSubtest) { if (!window.isApzSubtest) {
SimpleTest.registerCleanupFunction(this.execute.bind(this)); SimpleTest.registerCleanupFunction(this.execute.bind(this));
@ -763,7 +763,7 @@ var ApzCleanup = {
this._cleanups.push(func); this._cleanups.push(func);
}, },
execute: function() { execute() {
while (this._cleanups.length > 0) { while (this._cleanups.length > 0) {
var func = this._cleanups.pop(); var func = this._cleanups.pop();
try { try {
@ -772,5 +772,5 @@ var ApzCleanup = {
SimpleTest.ok(false, "Subtest cleanup function [" + func.toString() + "] threw exception [" + ex + "] on page [" + location.href + "]"); SimpleTest.ok(false, "Subtest cleanup function [" + func.toString() + "] threw exception [" + ex + "] on page [" + location.href + "]");
} }
} }
} },
}; };

View file

@ -22,7 +22,7 @@ function* doubleTapOn(element, x, y, testDriver) {
// We get here once the APZ:TransformEnd has fired, so we don't need that // We get here once the APZ:TransformEnd has fired, so we don't need that
// observer any more. // observer any more.
SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd");
// Flush state so we can query an accurate resolution // Flush state so we can query an accurate resolution
yield flushApzRepaints(testDriver); yield flushApzRepaints(testDriver);

View file

@ -31,7 +31,7 @@ function* test(testDriver) {
// We get here once the APZ:TransformEnd has fired, so we don't need that // We get here once the APZ:TransformEnd has fired, so we don't need that
// observer any more. // observer any more.
SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd");
// Flush state. // Flush state.
yield waitForApzFlushedRepaints(testDriver); yield waitForApzFlushedRepaints(testDriver);

View file

@ -48,7 +48,7 @@ function* test(testDriver) {
// We get here once the APZ:TransformEnd has fired, so we don't need that // We get here once the APZ:TransformEnd has fired, so we don't need that
// observer any more. // observer any more.
SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd");
// Flush state and get the resolution we're at now // Flush state and get the resolution we're at now
yield waitForApzFlushedRepaints(testDriver); yield waitForApzFlushedRepaints(testDriver);

View file

@ -42,7 +42,7 @@ function* test(testDriver) {
yield synthesizeNativeTouchDrag(subframe, 10, 200, 0, -300); yield synthesizeNativeTouchDrag(subframe, 10, 200, 0, -300);
// Remove the observer, we don't need it any more. // Remove the observer, we don't need it any more.
SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd");
// Flush any pending paints // Flush any pending paints
yield flushApzRepaints(testDriver); yield flushApzRepaints(testDriver);
@ -54,7 +54,7 @@ function* test(testDriver) {
var foundIt = 0; var foundIt = 0;
for (var scrollId in lastPaint) { for (var scrollId in lastPaint) {
if (("contentDescription" in lastPaint[scrollId]) && if (("contentDescription" in lastPaint[scrollId]) &&
(lastPaint[scrollId]["contentDescription"].includes("tall_html"))) { (lastPaint[scrollId].contentDescription.includes("tall_html"))) {
var dp = getPropertyAsRect(lastPaint, scrollId, "displayport"); 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 <= 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)); ok(dp.y + dp.h >= subframe.clientHeight, "The displayport bottom should be greater than the clientHeight; it is " + (dp.y + dp.h));

View file

@ -12,7 +12,7 @@
function* clickButton(testDriver) { 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 // 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() { yield waitForAllPaints(function() {

View file

@ -11,7 +11,7 @@
function scrollOuter() { function scrollOuter() {
var transformEnd = function() { var transformEnd = function() {
SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd");
dump("Transform complete; flushing repaints...\n"); dump("Transform complete; flushing repaints...\n");
flushApzRepaints(checkScroll); flushApzRepaints(checkScroll);
}; };

View file

@ -32,7 +32,7 @@
function* test(testDriver) { function* test(testDriver) {
SpecialPowers.Services.obs.addObserver(testDriver, "APZ:TransformEnd"); SpecialPowers.Services.obs.addObserver(testDriver, "APZ:TransformEnd");
yield synthesizeNativeTouchDrag(document.body, 10, 10, -2000, 0); yield synthesizeNativeTouchDrag(document.body, 10, 10, -2000, 0);
SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(testDriver, "APZ:TransformEnd");
yield waitForApzFlushedRepaints(testDriver); yield waitForApzFlushedRepaints(testDriver);
@ -41,7 +41,7 @@
// why and/or rewrite this test entirely. // why and/or rewrite this test entirely.
SpecialPowers.Services.obs.addObserver(testDriver, "mouseevent"); SpecialPowers.Services.obs.addObserver(testDriver, "mouseevent");
yield synthesizeNativeClick(input, 10, 10, testDriver); yield synthesizeNativeClick(input, 10, 10, testDriver);
SpecialPowers.Services.obs.removeObserver(testDriver, "mouseevent", false); SpecialPowers.Services.obs.removeObserver(testDriver, "mouseevent");
} }
window.addEventListener("click", (e) => { window.addEventListener("click", (e) => {
is(e.target, input, "got click"); is(e.target, input, "got click");

View file

@ -44,7 +44,7 @@ function* test(testDriver) {
expectedScrollId: utils.getViewId(document.scrollingElement), expectedScrollId: utils.getViewId(document.scrollingElement),
trackLocation: ScrollbarTrackLocation.START, trackLocation: ScrollbarTrackLocation.START,
expectThumb: true, expectThumb: true,
layerState: LayerState.INACTIVE layerState: LayerState.INACTIVE,
}); });
// activate the scrollframe but keep the main-thread scroll position at 0. // activate the scrollframe but keep the main-thread scroll position at 0.
@ -89,7 +89,7 @@ function* test(testDriver) {
expectedScrollId: scrollerViewId, expectedScrollId: scrollerViewId,
trackLocation: ScrollbarTrackLocation.START, trackLocation: ScrollbarTrackLocation.START,
expectThumb: false, expectThumb: false,
layerState: LayerState.ACTIVE layerState: LayerState.ACTIVE,
}); });
// bottom of scrollbar track (scrollthumb) // bottom of scrollbar track (scrollthumb)
hitTestScrollbar({ hitTestScrollbar({
@ -98,7 +98,7 @@ function* test(testDriver) {
expectedScrollId: scrollerViewId, expectedScrollId: scrollerViewId,
trackLocation: ScrollbarTrackLocation.END, trackLocation: ScrollbarTrackLocation.END,
expectThumb: true, expectThumb: true,
layerState: LayerState.ACTIVE layerState: LayerState.ACTIVE,
}); });
// left part of scrollbar track (has scrollthumb) // left part of scrollbar track (has scrollthumb)
hitTestScrollbar({ hitTestScrollbar({
@ -107,7 +107,7 @@ function* test(testDriver) {
expectedScrollId: scrollerViewId, expectedScrollId: scrollerViewId,
trackLocation: ScrollbarTrackLocation.START, trackLocation: ScrollbarTrackLocation.START,
expectThumb: true, expectThumb: true,
layerState: LayerState.ACTIVE layerState: LayerState.ACTIVE,
}); });
// right part of scrollbar track // right part of scrollbar track
hitTestScrollbar({ hitTestScrollbar({
@ -116,7 +116,7 @@ function* test(testDriver) {
expectedScrollId: scrollerViewId, expectedScrollId: scrollerViewId,
trackLocation: ScrollbarTrackLocation.END, trackLocation: ScrollbarTrackLocation.END,
expectThumb: false, expectThumb: false,
layerState: LayerState.ACTIVE layerState: LayerState.ACTIVE,
}); });
subtestDone(); subtestDone();

View file

@ -43,7 +43,7 @@ function* test(testDriver) {
expectedScrollId: utils.getViewId(document.scrollingElement), expectedScrollId: utils.getViewId(document.scrollingElement),
trackLocation: ScrollbarTrackLocation.START, trackLocation: ScrollbarTrackLocation.START,
expectThumb: true, expectThumb: true,
layerState: LayerState.INACTIVE layerState: LayerState.INACTIVE,
}); });
subtestDone(); subtestDone();

View file

@ -43,7 +43,7 @@ function* test(testDriver) {
expectedScrollId: utils.getViewId(document.scrollingElement), expectedScrollId: utils.getViewId(document.scrollingElement),
trackLocation: ScrollbarTrackLocation.START, trackLocation: ScrollbarTrackLocation.START,
expectThumb: true, expectThumb: true,
layerState: LayerState.INACTIVE layerState: LayerState.INACTIVE,
}); });
subtestDone(); subtestDone();

View file

@ -12,7 +12,7 @@
function scrollOuter() { function scrollOuter() {
var outer = document.getElementById("outer"); var outer = document.getElementById("outer");
var transformEnd = function() { var transformEnd = function() {
SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd", false); SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd");
dump("Transform complete; flushing repaints...\n"); dump("Transform complete; flushing repaints...\n");
flushApzRepaints(checkScroll, outer.contentWindow); flushApzRepaints(checkScroll, outer.contentWindow);
}; };

View file

@ -33,7 +33,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1383365
// current focus state at page load. // current focus state at page load.
window.addEventListener("scroll", waitForScrollBottom); window.addEventListener("scroll", waitForScrollBottom);
window.synthesizeKey("KEY_End"); window.synthesizeKey("KEY_End");
}; }
function waitForScrollBottom() { function waitForScrollBottom() {
if (window.scrollY < window.scrollMaxY) { if (window.scrollY < window.scrollMaxY) {
@ -53,14 +53,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1383365
// Wait for the APZ to reach a stable state as well, before dispatching // Wait for the APZ to reach a stable state as well, before dispatching
// the next key input or the default action won't occur. // the next key input or the default action won't occur.
waitForApzFlushedRepaints(function () { waitForApzFlushedRepaints(function() {
is(checkHasAsyncKeyScrolled(false), false, "expected no async key scrolling before KEY_Home dispatch"); is(checkHasAsyncKeyScrolled(false), false, "expected no async key scrolling before KEY_Home dispatch");
// This scroll should be asynchronous now that the focus state is up to date. // This scroll should be asynchronous now that the focus state is up to date.
window.addEventListener("scroll", waitForScrollTop); window.addEventListener("scroll", waitForScrollTop);
window.synthesizeKey("KEY_Home"); window.synthesizeKey("KEY_Home");
}); });
}; }
function waitForScrollTop() { function waitForScrollTop() {
if (window.scrollY > 0) { if (window.scrollY > 0) {
@ -70,11 +70,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1383365
window.removeEventListener("scroll", waitForScrollTop); window.removeEventListener("scroll", waitForScrollTop);
// Wait for APZ to settle and then check that async scrolling happened. // Wait for APZ to settle and then check that async scrolling happened.
waitForApzFlushedRepaints(function () { waitForApzFlushedRepaints(function() {
is(checkHasAsyncKeyScrolled(true), true, "expected async key scrolling after test"); is(checkHasAsyncKeyScrolled(true), true, "expected async key scrolling after test");
subtestDone(); subtestDone();
}); });
}; }
function checkHasAsyncKeyScrolled(requirePaints) { function checkHasAsyncKeyScrolled(requirePaints) {
// Get the compositor-side test data from nsIDOMWindowUtils. // Get the compositor-side test data from nsIDOMWindowUtils.
@ -101,11 +101,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1383365
if (rcd) { if (rcd) {
return rcd.hasAsyncKeyScrolled === "1"; return rcd.hasAsyncKeyScrolled === "1";
} else { }
SimpleTest.info("Last paint rcd is null"); SimpleTest.info("Last paint rcd is null");
return false; return false;
} }
}
waitUntilApzStable().then(forceLayerTreeToCompositor).then(runTests); waitUntilApzStable().then(forceLayerTreeToCompositor).then(runTests);
</script> </script>

View file

@ -30,7 +30,7 @@ document.addEventListener("wheel", function(e) {
setTimeout(function() { setTimeout(function() {
flushApzRepaints(checkScroll); flushApzRepaints(checkScroll);
}, 0); }, 0);
}, false); });
function scrollPage() { function scrollPage() {
synthesizeNativeWheel(document.body, 100, 100, 0, -50); synthesizeNativeWheel(document.body, 100, 100, 0, -50);

View file

@ -42,7 +42,7 @@ function chromeTouchEventCounter(operation) {
topWin.eventCounts = { "touchstart": 0, "touchmove": 0, "touchend": 0 }; topWin.eventCounts = { "touchstart": 0, "touchmove": 0, "touchend": 0 };
topWin.counter = function(e) { topWin.counter = function(e) {
topWin.eventCounts[e.type]++; topWin.eventCounts[e.type]++;
} };
topWin.addEventListener("touchstart", topWin.counter, { passive: true }); topWin.addEventListener("touchstart", topWin.counter, { passive: true });
topWin.addEventListener("touchmove", topWin.counter, { passive: true }); topWin.addEventListener("touchmove", topWin.counter, { passive: true });
@ -76,7 +76,7 @@ function chromeTouchEventCounter(operation) {
if (typeof chromeTouchEventCounter.chromeHelper == "undefined") { if (typeof chromeTouchEventCounter.chromeHelper == "undefined") {
// This is the first time chromeTouchEventCounter is being called; do initialization // This is the first time chromeTouchEventCounter is being called; do initialization
chromeTouchEventCounter.chromeHelper = SpecialPowers.loadChromeScript(chromeProcessCounter); chromeTouchEventCounter.chromeHelper = SpecialPowers.loadChromeScript(chromeProcessCounter);
ApzCleanup.register(function() { chromeTouchEventCounter.chromeHelper.destroy() }); ApzCleanup.register(function() { chromeTouchEventCounter.chromeHelper.destroy(); });
} }
return chromeTouchEventCounter.chromeHelper.sendSyncMessage(operation, ""); return chromeTouchEventCounter.chromeHelper.sendSyncMessage(operation, "");

View file

@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1151663
function finishTest() { function finishTest() {
w.close(); w.close();
SimpleTest.finish(); SimpleTest.finish();
}; }
</script> </script>
</head> </head>

View file

@ -51,7 +51,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1277814
for (var scrollId in paint) { for (var scrollId in paint) {
var scrollFrame = paint[scrollId]; var scrollFrame = paint[scrollId];
if ("contentDescription" in scrollFrame && if ("contentDescription" in scrollFrame &&
scrollFrame["contentDescription"].includes("bug1277814-div")) { scrollFrame.contentDescription.includes("bug1277814-div")) {
foundIt = true; foundIt = true;
} }
} }

View file

@ -35,7 +35,7 @@ function* test(testDriver) {
var elm = document.getElementById("outer"); var elm = document.getElementById("outer");
// Set margins on the element, to ensure it is layerized // Set margins on the element, to ensure it is layerized
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /*priority*/ 1); utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /* priority*/ 1);
yield waitForAllPaints(function() { yield waitForAllPaints(function() {
flushApzRepaints(testDriver); flushApzRepaints(testDriver);
}); });

View file

@ -38,7 +38,7 @@ function* test(testDriver) {
var elm = document.getElementById("outer"); var elm = document.getElementById("outer");
// Set margins on the element, to ensure it is layerized // Set margins on the element, to ensure it is layerized
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /*priority*/ 1); utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /* priority*/ 1);
yield waitForAllPaints(function() { yield waitForAllPaints(function() {
flushApzRepaints(testDriver); flushApzRepaints(testDriver);
}); });

View file

@ -28,7 +28,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141
function finishTest() { function finishTest() {
w.close(); w.close();
SimpleTest.finish(); SimpleTest.finish();
}; }
</script> </script>
</head> </head>

View file

@ -184,7 +184,7 @@ function* test(testDriver) {
setTimeout(function() { setTimeout(function() {
elm.parentNode.classList.remove("contentBefore"); elm.parentNode.classList.remove("contentBefore");
}, 0); }, 0);
} };
// and do a few more frames of the animation, this should trigger the listener // and do a few more frames of the animation, this should trigger the listener
// and the frame reconstruction // and the frame reconstruction

View file

@ -23,7 +23,7 @@ var prefs = [
// APZ as a MouseInput so the hit result is recorded. // APZ as a MouseInput so the hit result is recorded.
["test.events.async.enabled", true], ["test.events.async.enabled", true],
// Turns on APZTestData logging which we use to obtain the hit test results. // Turns on APZTestData logging which we use to obtain the hit test results.
["apz.test.logging_enabled", true] ["apz.test.logging_enabled", true],
]; ];
var subtests = [ var subtests = [
@ -35,7 +35,7 @@ var subtests = [
{"file": "helper_hittest_backface_hidden.html", "prefs": prefs}, {"file": "helper_hittest_backface_hidden.html", "prefs": prefs},
{"file": "helper_hittest_touchaction.html", "prefs": prefs}, {"file": "helper_hittest_touchaction.html", "prefs": prefs},
{"file": "helper_hittest_nested_transforms_bug1459696.html", "prefs": prefs}, {"file": "helper_hittest_nested_transforms_bug1459696.html", "prefs": prefs},
{"file": "helper_hittest_sticky_bug1478304.html", "prefs": prefs} {"file": "helper_hittest_sticky_bug1478304.html", "prefs": prefs},
]; ];
if (isApzEnabled()) { if (isApzEnabled()) {

View file

@ -31,7 +31,7 @@ var subtests = [
{"file": "helper_scrollbar_snap_bug1501062.html"}, {"file": "helper_scrollbar_snap_bug1501062.html"},
// Tests for scrollbar-dragging on scrollframes inside nested transforms // Tests for scrollbar-dragging on scrollframes inside nested transforms
{"file": "helper_bug1490393.html"}, {"file": "helper_bug1490393.html"},
{"file": "helper_bug1490393-2.html"} {"file": "helper_bug1490393-2.html"},
]; ];
if (isApzEnabled()) { if (isApzEnabled()) {

View file

@ -15,7 +15,7 @@ var prefs = [
// Increase the content response timeout because these tests do preventDefault // Increase the content response timeout because these tests do preventDefault
// and we want to make sure APZ actually waits for them. // and we want to make sure APZ actually waits for them.
["apz.content_response_timeout", 10000], ["apz.content_response_timeout", 10000],
] ];
var subtests = [ var subtests = [
{"file": "helper_override_root.html", "prefs": prefs}, {"file": "helper_override_root.html", "prefs": prefs},

View file

@ -17,9 +17,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1285070
{"file": "helper_bug1285070.html", "prefs": [enablePE]}, {"file": "helper_bug1285070.html", "prefs": [enablePE]},
{"file": "helper_bug1299195.html", "prefs": [enablePE]}, {"file": "helper_bug1299195.html", "prefs": [enablePE]},
{"file": "helper_bug1414336.html", "prefs": [enablePE, {"file": "helper_bug1414336.html", "prefs": [enablePE,
["apz.test.fails_with_native_injection", isWindows] ["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()) { if (isApzEnabled()) {

View file

@ -16,8 +16,8 @@ var prefs = [
// because in this test we move the mouse a bunch and want to recalculate // because in this test we move the mouse a bunch and want to recalculate
// the target APZC after each such movement. // the target APZC after each such movement.
["mousewheel.transaction.ignoremovedelay", 0], ["mousewheel.transaction.ignoremovedelay", 0],
["mousewheel.transaction.timeout", 0] ["mousewheel.transaction.timeout", 0],
] ];
// For helper_scroll_over_scrollbar, we need to set a pref to force // For helper_scroll_over_scrollbar, we need to set a pref to force
// layerization of the scrollbar track to reproduce the bug being fixed. // layerization of the scrollbar track to reproduce the bug being fixed.

View file

@ -628,7 +628,7 @@ function* test(testDriver) {
utils.advanceTimeAndRefresh(0); utils.advanceTimeAndRefresh(0);
// On android, and maybe non-e10s platforms generally, we need to manually // On android, and maybe non-e10s platforms generally, we need to manually
// kick the paint to send the layer transaction to the compositor. // kick the paint to send the layer transaction to the compositor.
yield waitForAllPaints(function() { setTimeout(testDriver, 0) }); yield waitForAllPaints(function() { setTimeout(testDriver, 0); });
// Read the main-thread scroll offset; although this is temporarily 0,0 that // Read the main-thread scroll offset; although this is temporarily 0,0 that
// temporary value is never exposed to content - instead reading this value // temporary value is never exposed to content - instead reading this value

View file

@ -500,7 +500,7 @@ var DefaultEvent = {
function test() { function test() {
var subframe = document.getElementById("subframe"); var subframe = document.getElementById("subframe");
var oldpos = new ScrollTops(); var oldpos = new ScrollTops();
sendWheelAndPaint(subframe, 10, 10, DefaultEvent, function () { sendWheelAndPaint(subframe, 10, 10, DefaultEvent, function() {
var newpos = new ScrollTops(); var newpos = new ScrollTops();
ok(oldpos.outerScrollTop == newpos.outerScrollTop, "viewport should not have scrolled"); ok(oldpos.outerScrollTop == newpos.outerScrollTop, "viewport should not have scrolled");
ok(oldpos.innerScrollTop != newpos.innerScrollTop, "subframe should have scrolled"); ok(oldpos.innerScrollTop != newpos.innerScrollTop, "subframe should have scrolled");
@ -510,7 +510,7 @@ function test() {
function doOuterScroll(subframe, oldpos) { function doOuterScroll(subframe, oldpos) {
var outer = document.getElementById("iframe-body"); var outer = document.getElementById("iframe-body");
sendWheelAndPaint(outer, 20, 5, DefaultEvent, function () { sendWheelAndPaint(outer, 20, 5, DefaultEvent, function() {
var newpos = new ScrollTops(); var newpos = new ScrollTops();
ok(oldpos.outerScrollTop != newpos.outerScrollTop, "viewport should have scrolled"); ok(oldpos.outerScrollTop != newpos.outerScrollTop, "viewport should have scrolled");
ok(oldpos.innerScrollTop == newpos.innerScrollTop, "subframe should not have scrolled"); ok(oldpos.innerScrollTop == newpos.innerScrollTop, "subframe should not have scrolled");
@ -519,7 +519,7 @@ function doOuterScroll(subframe, oldpos) {
} }
function doInnerScrollAgain(subframe, oldpos) { function doInnerScrollAgain(subframe, oldpos) {
sendWheelAndPaint(subframe, 10, 10, DefaultEvent, function () { sendWheelAndPaint(subframe, 10, 10, DefaultEvent, function() {
var newpos = new ScrollTops(); var newpos = new ScrollTops();
ok(oldpos.outerScrollTop == newpos.outerScrollTop, "viewport should not have scrolled"); ok(oldpos.outerScrollTop == newpos.outerScrollTop, "viewport should not have scrolled");
ok(oldpos.innerScrollTop != newpos.innerScrollTop, "subframe should have scrolled"); ok(oldpos.innerScrollTop != newpos.innerScrollTop, "subframe should have scrolled");

View file

@ -29,7 +29,7 @@ function test() {
lineOrPageDeltaX: 0, lineOrPageDeltaX: 0,
lineOrPageDeltaY: 10, lineOrPageDeltaY: 10,
}; };
sendWheelAndPaint(inner, 20, 30, event, function () { sendWheelAndPaint(inner, 20, 30, event, function() {
ok(container.scrollTop == containerScrollTop, "container scrollframe should not have scrolled"); ok(container.scrollTop == containerScrollTop, "container scrollframe should not have scrolled");
ok(outer.scrollTop > outerScrollTop, "nested scrollframe should have scrolled"); ok(outer.scrollTop > outerScrollTop, "nested scrollframe should have scrolled");
SimpleTest.finish(); SimpleTest.finish();

View file

@ -75,7 +75,7 @@ function test() {
subframe.style.overflow = "auto"; subframe.style.overflow = "auto";
subframe.getBoundingClientRect(); subframe.getBoundingClientRect();
waitForAllPaintsFlushed(function () { waitForAllPaintsFlushed(function() {
ScrollbarWidth = oldClientWidth - subframe.clientWidth; ScrollbarWidth = oldClientWidth - subframe.clientWidth;
if (!ScrollbarWidth) { if (!ScrollbarWidth) {
// Probably we have overlay scrollbars - abort the test. // Probably we have overlay scrollbars - abort the test.
@ -98,7 +98,7 @@ function testScrolling(subframe) {
var oldScrollTop = subframe.scrollTop; var oldScrollTop = subframe.scrollTop;
sendWheelAndPaint(subframe, posX, posY, DefaultEvent, function () { sendWheelAndPaint(subframe, posX, posY, DefaultEvent, function() {
ok(subframe.scrollTop > oldScrollTop, "subframe should have scrolled"); ok(subframe.scrollTop > oldScrollTop, "subframe should have scrolled");
SimpleTest.finish(); SimpleTest.finish();
}); });

View file

@ -62,11 +62,11 @@
} }
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
"set" : [ "set": [
[testPref, true] [testPref, true],
] ],
}, startTest); }, startTest);
} };
</script> </script>
</head> </head>

View file

@ -44,7 +44,7 @@ function takeSnapshots(e) {
for (var i = 0; i < 10; i++) { for (var i = 0; i < 10; i++) {
SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(16); SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(16);
var snapshot = getSnapshot(rect); var snapshot = getSnapshot(rect);
//dump("Took snapshot " + snapshot + "\n"); // this might help with debugging // dump("Took snapshot " + snapshot + "\n"); // this might help with debugging
if (lastSnapshot && lastSnapshot != snapshot) { if (lastSnapshot && lastSnapshot != snapshot) {
ok(true, "Found some different pixels in snapshot " + i + " compared to previous"); ok(true, "Found some different pixels in snapshot " + i + " compared to previous");

View file

@ -61,7 +61,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1013412
var rotation = 0; var rotation = 0;
var rotationAdjusted = false; var rotationAdjusted = false;
var incrementForMode = function (mode) { var incrementForMode = function(mode) {
switch (mode) { switch (mode) {
case WheelEvent.DOM_DELTA_PIXEL: return 1; case WheelEvent.DOM_DELTA_PIXEL: return 1;
case WheelEvent.DOM_DELTA_LINE: return 15; case WheelEvent.DOM_DELTA_LINE: return 15;
@ -70,7 +70,7 @@ var incrementForMode = function (mode) {
return 0; return 0;
}; };
document.getElementById("scrollbox").addEventListener("wheel", function (e) { document.getElementById("scrollbox").addEventListener("wheel", function(e) {
rotation += e.deltaY * incrementForMode(e.deltaMode) * 0.2; rotation += e.deltaY * incrementForMode(e.deltaMode) * 0.2;
document.getElementById("circle").style.transform = "rotate(" + rotation + "deg)"; document.getElementById("circle").style.transform = "rotate(" + rotation + "deg)";
rotationAdjusted = true; rotationAdjusted = true;

View file

@ -36,9 +36,9 @@ function parseDisplayList(lines) {
var line = lines[i]; var line = lines[i];
var layerObject = { var layerObject = {
line: line, line,
children: [], children: [],
} };
if (!root) { if (!root) {
root = layerObject; root = layerObject;
} }
@ -87,7 +87,7 @@ function parseDisplayList(lines) {
var name = rest.substring(lastSpace + 1, startIndex); var name = rest.substring(lastSpace + 1, startIndex);
var value = rest.substring(startIndex + 1, j); var value = rest.substring(startIndex + 1, j);
var rectMatches = value.match("^(.*?),(.*?),(.*?),(.*?)$") var rectMatches = value.match("^(.*?),(.*?),(.*?),(.*?)$");
if (rectMatches) { if (rectMatches) {
layerObject[name] = [ layerObject[name] = [
parseFloat(rectMatches[1]), parseFloat(rectMatches[1]),
@ -103,12 +103,12 @@ function parseDisplayList(lines) {
lastSpace = j; lastSpace = j;
} }
} }
//dump("FIELDS: " + JSON.stringify(fields) + "\n"); // dump("FIELDS: " + JSON.stringify(fields) + "\n");
} }
return root; return root;
} }
function trim(s){ function trim(s) {
return ( s || "" ).replace( /^\s+|\s+$/g, "" ); return ( s || "" ).replace( /^\s+|\s+$/g, "" );
} }
@ -291,9 +291,9 @@ function parseLayers(layersDumpLines) {
} }
var layerObject = { var layerObject = {
line: line, line,
children: [], children: [],
} };
if (!root) { if (!root) {
root = layerObject; root = layerObject;
} }
@ -352,7 +352,7 @@ function parseLayers(layersDumpLines) {
for (var j = 0; j < fields.length; j++) { for (var j = 0; j < fields.length; j++) {
// Something like 'valid=< (x=0, y=0, w=1920, h=2218); >' or 'opaqueContent' // Something like 'valid=< (x=0, y=0, w=1920, h=2218); >' or 'opaqueContent'
var field = fields[j]; var field = fields[j];
//dump("FIELD: " + field + "\n"); // dump("FIELD: " + field + "\n");
var parts = field.split("=", 2); var parts = field.split("=", 2);
var fieldName = parts[0]; var fieldName = parts[0];
var rest = field.substring(fieldName.length + 1); var rest = field.substring(fieldName.length + 1);
@ -412,11 +412,11 @@ function parseLayers(layersDumpLines) {
// Compute screenTransformX/screenTransformY // Compute screenTransformX/screenTransformY
// TODO Fully support transforms // TODO Fully support transforms
if (layerObject["shadow-transform"] && layerObject["transform"]) { if (layerObject["shadow-transform"] && layerObject.transform) {
layerObject["screen-transform"] = [layerObject["shadow-transform"][2][0], layerObject["shadow-transform"][2][1]]; layerObject["screen-transform"] = [layerObject["shadow-transform"][2][0], layerObject["shadow-transform"][2][1]];
var currIndentation = indentation - 1; var currIndentation = indentation - 1;
while (currIndentation >= 0) { while (currIndentation >= 0) {
var transform = objectAtIndentation[currIndentation]["shadow-transform"] || objectAtIndentation[currIndentation]["transform"]; var transform = objectAtIndentation[currIndentation]["shadow-transform"] || objectAtIndentation[currIndentation].transform;
if (transform) { if (transform) {
layerObject["screen-transform"][0] += transform[2][0]; layerObject["screen-transform"][0] += transform[2][0];
layerObject["screen-transform"][1] += transform[2][1]; layerObject["screen-transform"][1] += transform[2][1];
@ -425,10 +425,10 @@ function parseLayers(layersDumpLines) {
} }
} }
//dump("Fields: " + JSON.stringify(fields) + "\n"); // dump("Fields: " + JSON.stringify(fields) + "\n");
} }
root.compositeTime = layersDumpLines.compositeTime; root.compositeTime = layersDumpLines.compositeTime;
//dump("OBJECTS: " + JSON.stringify(root) + "\n"); // dump("OBJECTS: " + JSON.stringify(root) + "\n");
return root; return root;
} }
function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, contentScale, rootPreviewParent) { function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, contentScale, rootPreviewParent) {
@ -458,12 +458,12 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
style: { style: {
whiteSpace: "pre", whiteSpace: "pre",
}, },
onmouseover: function() { onmouseover() {
if (this.layerViewport) { if (this.layerViewport) {
this.layerViewport.classList.add("layerHover"); this.layerViewport.classList.add("layerHover");
} }
}, },
onmouseout: function() { onmouseout() {
if (this.layerViewport) { if (this.layerViewport) {
this.layerViewport.classList.remove("layerHover"); this.layerViewport.classList.remove("layerHover");
} }
@ -478,23 +478,23 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
marginRight: "4px", marginRight: "4px",
cursor: "pointer", cursor: "pointer",
}, },
onclick: function() { onclick() {
if (this.layerViewport) { if (this.layerViewport) {
if (this.layerViewport.style.visibility == "hidden") { if (this.layerViewport.style.visibility == "hidden") {
this.layerViewport.style.visibility = ""; this.layerViewport.style.visibility = "";
this.src = "show.png" this.src = "show.png";
} else { } else {
this.layerViewport.style.visibility = "hidden"; this.layerViewport.style.visibility = "hidden";
this.src = "hide.png" this.src = "hide.png";
}
} }
} }
},
}); });
elem.insertBefore(icon, elem.firstChild); elem.insertBefore(icon, elem.firstChild);
pane.appendChild(elem); pane.appendChild(elem);
if (root["shadow-visible"] || root["visible"]) { if (root["shadow-visible"] || root.visible) {
var visibleRegion = root["shadow-visible"] || root["visible"]; var visibleRegion = root["shadow-visible"] || root.visible;
var layerViewport = createElement("div", { var layerViewport = createElement("div", {
id: root.address + "_viewport", id: root.address + "_viewport",
style: { style: {
@ -505,15 +505,15 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
elem.layerViewport = layerViewport; elem.layerViewport = layerViewport;
icon.layerViewport = layerViewport; icon.layerViewport = layerViewport;
var layerViewportMatrix = [1, 0, 0, 1, 0, 0]; var layerViewportMatrix = [1, 0, 0, 1, 0, 0];
if (root["shadow-clip"] || root["clip"]) { if (root["shadow-clip"] || root.clip) {
var clip = root["shadow-clip"] || root["clip"] var clip = root["shadow-clip"] || root.clip;
var clipElem = createElement("div", { var clipElem = createElement("div", {
id: root.address + "_clip", id: root.address + "_clip",
style: { style: {
left: clip[0]+"px", left: clip[0] + "px",
top: clip[1]+"px", top: clip[1] + "px",
width: clip[2]+"px", width: clip[2] + "px",
height: clip[3]+"px", height: clip[3] + "px",
position: "absolute", position: "absolute",
overflow: "hidden", overflow: "hidden",
pointerEvents: "none", pointerEvents: "none",
@ -523,8 +523,8 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
layerViewportMatrix[5] += -clip[1]; layerViewportMatrix[5] += -clip[1];
layerViewport.style.transform = "translate(-" + clip[0] + "px, -" + clip[1] + "px" + ")"; layerViewport.style.transform = "translate(-" + clip[0] + "px, -" + clip[1] + "px" + ")";
} }
if (root["shadow-transform"] || root["transform"]) { if (root["shadow-transform"] || root.transform) {
var matrix = root["shadow-transform"] || root["transform"]; var matrix = root["shadow-transform"] || root.transform;
layerViewportMatrix[0] = matrix[0][0]; layerViewportMatrix[0] = matrix[0][0];
layerViewportMatrix[1] = matrix[0][1]; layerViewportMatrix[1] = matrix[0][1];
layerViewportMatrix[2] = matrix[1][0]; layerViewportMatrix[2] = matrix[1][0];
@ -535,7 +535,7 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
layerViewport.style.transform = "matrix(" + layerViewportMatrix[0] + "," + layerViewportMatrix[1] + "," + layerViewportMatrix[2] + "," + layerViewportMatrix[3] + "," + layerViewportMatrix[4] + "," + layerViewportMatrix[5] + ")"; layerViewport.style.transform = "matrix(" + layerViewportMatrix[0] + "," + layerViewportMatrix[1] + "," + layerViewportMatrix[2] + "," + layerViewportMatrix[3] + "," + layerViewportMatrix[4] + "," + layerViewportMatrix[5] + ")";
if (!hasSeenRoot) { if (!hasSeenRoot) {
hasSeenRoot = true; hasSeenRoot = true;
layerViewport.style.transform = "scale(" + 1/contentScale + "," + 1/contentScale + ")"; layerViewport.style.transform = "scale(" + 1 / contentScale + "," + 1 / contentScale + ")";
} }
if (clipElem) { if (clipElem) {
previewParent.appendChild(clipElem); previewParent.appendChild(clipElem);
@ -621,10 +621,10 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
layerPreview.mouseoverElem = elem; layerPreview.mouseoverElem = elem;
layerPreview.onmouseenter = function() { layerPreview.onmouseenter = function() {
this.mouseoverElem.onmouseover(); this.mouseoverElem.onmouseover();
} };
layerPreview.onmouseout = function() { layerPreview.onmouseout = function() {
this.mouseoverElem.onmouseout(); this.mouseoverElem.onmouseout();
} };
} }
} }
@ -637,9 +637,9 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
style: { style: {
whiteSpace: "pre", whiteSpace: "pre",
}, },
displayItem: displayItem, displayItem,
layerViewport: layerViewport, layerViewport,
onmouseover: function() { onmouseover() {
if (this.diPreview) { if (this.diPreview) {
this.diPreview.classList.add("displayHover"); this.diPreview.classList.add("displayHover");
@ -673,13 +673,13 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
style: { style: {
top: Math.min(box.bottom, document.documentElement.clientHeight - 150) + "px", top: Math.min(box.bottom, document.documentElement.clientHeight - 150) + "px",
left: box.left + "px", left: box.left + "px",
} },
}); });
document.body.appendChild(this.diPreview.tooltip); document.body.appendChild(this.diPreview.tooltip);
} }
}, },
onmouseout: function() { onmouseout() {
if (this.diPreview) { if (this.diPreview) {
this.diPreview.classList.remove("displayHover"); this.diPreview.classList.remove("displayHover");
document.body.removeChild(this.diPreview.tooltip); document.body.removeChild(this.diPreview.tooltip);
@ -693,7 +693,7 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
height: "12px", height: "12px",
marginLeft: "4px", marginLeft: "4px",
marginRight: "4px", marginRight: "4px",
} },
}); });
displayElem.insertBefore(icon, displayElem.firstChild); displayElem.insertBefore(icon, displayElem.firstChild);
pane.appendChild(displayElem); pane.appendChild(displayElem);
@ -707,18 +707,18 @@ function populateLayers(root, displayList, pane, previewParent, hasSeenRoot, con
className: "layerPreview", className: "layerPreview",
style: { style: {
position: "absolute", position: "absolute",
left: rect2d[0]/appUnitsToPixels + "px", left: rect2d[0] / appUnitsToPixels + "px",
top: rect2d[1]/appUnitsToPixels + "px", top: rect2d[1] / appUnitsToPixels + "px",
width: rect2d[2]/appUnitsToPixels + "px", width: rect2d[2] / appUnitsToPixels + "px",
height: rect2d[3]/appUnitsToPixels + "px", height: rect2d[3] / appUnitsToPixels + "px",
border: "solid 1px gray", border: "solid 1px gray",
pointerEvents: "auto", pointerEvents: "auto",
}, },
displayElem: displayElem, displayElem,
onmouseover: function() { onmouseover() {
this.displayElem.onmouseover(); this.displayElem.onmouseover();
}, },
onmouseout: function() { onmouseout() {
this.displayElem.onmouseout(); this.displayElem.onmouseout();
}, },
}); });
@ -750,7 +750,7 @@ function parseMultiLineDump(log) {
var layersRegex = "(" + layerManagerFirstLine + nextLineStartWithSpace + ")"; var layersRegex = "(" + layerManagerFirstLine + nextLineStartWithSpace + ")";
var startLine = "Painting --- after optimization:\n"; var startLine = "Painting --- after optimization:\n";
var endLine = "Painting --- layer tree:" var endLine = "Painting --- layer tree:";
var displayListRegex = "(" + startLine + "(.*\n)*?" + endLine + ")"; var displayListRegex = "(" + startLine + "(.*\n)*?" + endLine + ")";
var regex = new RegExp(layersRegex + "|" + displayListRegex, "gm"); var regex = new RegExp(layersRegex + "|" + displayListRegex, "gm");
@ -787,7 +787,7 @@ function parseMultiLineDump(log) {
if (currMatch.indexOf(startLine) == 0) { if (currMatch.indexOf(startLine) == 0) {
// Display list match // Display list match
var matchLines = matches[i].split("\n") var matchLines = matches[i].split("\n");
lastDisplayList = parseDisplayList(matchLines); lastDisplayList = parseDisplayList(matchLines);
} else { } else {
// Layer tree match: // Layer tree match:
@ -800,12 +800,12 @@ function parseMultiLineDump(log) {
}, },
href: "#", href: "#",
textContent: "LayerTree " + (frameID++), textContent: "LayerTree " + (frameID++),
onclick: function() { onclick() {
contents.innerHTML = ""; contents.innerHTML = "";
var matchLines = matches[i].split("\n") var matchLines = matches[i].split("\n");
var dumpDiv = parseDump(matchLines, displayList); var dumpDiv = parseDump(matchLines, displayList);
contents.appendChild(dumpDiv); contents.appendChild(dumpDiv);
} },
}); });
matchList.appendChild(currFrameDiv); matchList.appendChild(currFrameDiv);
} }
@ -816,7 +816,7 @@ function parseMultiLineDump(log) {
function parseDump(log, displayList, compositeTitle, compositeTime) { function parseDump(log, displayList, compositeTitle, compositeTime) {
compositeTitle |= ""; compositeTitle |= "";
compositeTime |= 0 compositeTime |= 0;
var container = createElement("div", { var container = createElement("div", {
style: { style: {

View file

@ -14,8 +14,8 @@ add_task(async function test_windowlessBrowserTroubleshootCrash() {
Services.obs.removeObserver(listener, "content-document-global-created"); Services.obs.removeObserver(listener, "content-document-global-created");
resolve(); resolve();
} }
} },
} };
Services.obs.addObserver(listener, "content-document-global-created"); Services.obs.addObserver(listener, "content-document-global-created");
}); });
let triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({}); let triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({});

View file

@ -78,7 +78,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1274663
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
window.addEventListener("MozAfterPaint", function paintHandle(e) { window.addEventListener("MozAfterPaint", function paintHandle(e) {
runCanvasTest(); runCanvasTest();
window.removeEventListener("MozAfterPaint", paintHandle, false); window.removeEventListener("MozAfterPaint", paintHandle);
}); });
function runCanvasTest() { function runCanvasTest() {

View file

@ -59,8 +59,7 @@ function runTest() {
} }
var osName = sysInfo.getProperty("name"); var osName = sysInfo.getProperty("name");
switch(osName) switch (osName) {
{
case "Darwin": // Mac OS X. case "Darwin": // Mac OS X.
// We only enable OpenGL layers on machines that don't support QuickDraw // We only enable OpenGL layers on machines that don't support QuickDraw
// plugins. x86-64 architecture is a good proxy for this plugin support. // plugins. x86-64 architecture is a good proxy for this plugin support.

View file

@ -29,13 +29,13 @@ let fontUsed = id => {
range = document.createRange(); range = document.createRange();
range.selectNode(element); range.selectNode(element);
return InspectorUtils.getUsedFontFaces(range)[0].CSSFamilyName; return InspectorUtils.getUsedFontFaces(range)[0].CSSFamilyName;
} };
// A map of the default mono, sans and serif fonts, obtained when // A map of the default mono, sans and serif fonts, obtained when
// whitelisting is disabled. // whitelisting is disabled.
const fonts = { mono : fontUsed("mono"), const fonts = { mono: fontUsed("mono"),
sans : fontUsed("sans"), sans: fontUsed("sans"),
serif : fontUsed("serif") }; serif: fontUsed("serif") };
// Set the font whitelist to contain none, some, or all of the // Set the font whitelist to contain none, some, or all of the
// default mono, sans, and serif fonts. Check that the rendering // default mono, sans, and serif fonts. Check that the rendering
@ -64,7 +64,7 @@ let testFontWhitelist = async function(useMono, useSans, useSerif) {
"Correct sans whitelisting state; got " + fontUsed("sans") + ", requested " + fonts.sans); "Correct sans whitelisting state; got " + fontUsed("sans") + ", requested " + fonts.sans);
is(useSerif || whitelistEmpty, fontUsed("serif") === fonts.serif, is(useSerif || whitelistEmpty, fontUsed("serif") === fonts.serif,
"Correct serif whitelisting state; got " + fontUsed("serif") + ", requested " + fonts.serif); "Correct serif whitelisting state; got " + fontUsed("serif") + ", requested " + fonts.serif);
} };
// Run tests to confirm that only whitelisting fonts are present in a // Run tests to confirm that only whitelisting fonts are present in a
// rendered page. Try turning mono, sans, and serif off and on in // rendered page. Try turning mono, sans, and serif off and on in