diff --git a/.eslintrc.js b/.eslintrc.js index 59c73ee9fad6..9a45d0925a74 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -478,7 +478,6 @@ module.exports = { { files: [ "dom/**", - "gfx/**", "image/test/browser/browser_image.js", "layout/**", "mobile/android/**", diff --git a/gfx/layers/apz/test/mochitest/apz_test_utils.js b/gfx/layers/apz/test/mochitest/apz_test_utils.js index 45f0e19188f2..555976a3f2dc 100644 --- a/gfx/layers/apz/test/mochitest/apz_test_utils.js +++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js @@ -139,7 +139,7 @@ function convertTestData(testData) { // because those don't contain any useful data. function getLastNonemptyBucket(buckets) { for (var i = buckets.length - 1; i >= 0; --i) { - if (buckets[i].scrollFrames.length > 0) { + if (buckets[i].scrollFrames.length) { return buckets[i]; } } @@ -269,7 +269,7 @@ function getLastApzcTree() { ok(false, "expected to have compositor apz test data"); return null; } - if (data.paints.length == 0) { + if (!data.paints.length) { ok(false, "expected to have at least one compositor paint bucket"); return null; } @@ -756,7 +756,7 @@ function getSnapshot(rect) { // produces { "key": { "x": 0, "y": 0 }, "key2": [1, 2, true] } function getQueryArgs() { var args = {}; - if (location.search.length > 0) { + if (location.search.length) { var params = location.search.substr(1).split("&"); for (var p of params) { var [k, v] = p.split("="); @@ -866,7 +866,7 @@ function hitInfoToString(hitInfo) { strs.push(flag); } } - if (strs.length == 0) { + if (!strs.length) { return "INVISIBLE"; } strs.sort(function(a, b) { @@ -1070,7 +1070,7 @@ var ApzCleanup = { _cleanups: [], register(func) { - if (this._cleanups.length == 0) { + if (!this._cleanups.length) { if (!window.isApzSubtest) { SimpleTest.registerCleanupFunction(this.execute.bind(this)); } // else ApzCleanup.execute is called from runSubtestsSeriallyInFreshWindows @@ -1079,7 +1079,7 @@ var ApzCleanup = { }, execute() { - while (this._cleanups.length > 0) { + while (this._cleanups.length) { var func = this._cleanups.pop(); try { func(); diff --git a/gfx/layers/apz/test/mochitest/helper_bug1414336.html b/gfx/layers/apz/test/mochitest/helper_bug1414336.html index c33d6ad1bc9a..6fc6481bbaac 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1414336.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1414336.html @@ -82,7 +82,7 @@ waitUntilApzStable().then(async () => { }, { once: true }); target0.addEventListener("pointerup", (event) => { - ok(target0_events.length == 0, " should receive " + target0_events + " on target0"); + ok(!target0_events.length, " should receive " + target0_events + " on target0"); // Wait until the event is done processing before we end the subtest, // otherwise on Android the pointer events pref is flipped back to false // and debug builds will assert. diff --git a/gfx/layers/apz/test/mochitest/helper_bug1663731_no_pointercancel_on_second_touchstart.html b/gfx/layers/apz/test/mochitest/helper_bug1663731_no_pointercancel_on_second_touchstart.html index f62d2db0509b..e0690c12c647 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1663731_no_pointercancel_on_second_touchstart.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1663731_no_pointercancel_on_second_touchstart.html @@ -51,7 +51,7 @@ async function test() { // end the test at the right time. body.addEventListener("touchend", function(e) { dump(`Got touchend with ${e.touches.length} touches\n`); - if (e.touches.length == 0) { + if (!e.touches.length) { resolve(); } }); diff --git a/gfx/layers/apz/test/mochitest/helper_bug1682170_pointercancel_on_touchaction_pinchzoom.html b/gfx/layers/apz/test/mochitest/helper_bug1682170_pointercancel_on_touchaction_pinchzoom.html index 7d0cccf18d13..b9c31dfe89f7 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1682170_pointercancel_on_touchaction_pinchzoom.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1682170_pointercancel_on_touchaction_pinchzoom.html @@ -40,7 +40,7 @@ async function test() { // end the test at the right time. body.addEventListener("touchend", function(e) { dump(`Got touchend with ${e.touches.length} touches\n`); - if (e.touches.length == 0) { + if (!e.touches.length) { resolve(); } }); diff --git a/gfx/layers/apz/test/mochitest/helper_bug982141.html b/gfx/layers/apz/test/mochitest/helper_bug982141.html index 83c65a4eaea7..8ffda2dd2f08 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug982141.html +++ b/gfx/layers/apz/test/mochitest/helper_bug982141.html @@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141 // Get the sequence number of the last paint on the compositor side. // We do this before converting the APZ test data because the conversion // loses the order of the paints. - ok(compositorTestData.paints.length > 0, + ok(!!compositorTestData.paints.length, "expected at least one paint in compositor test data"); var lastCompositorPaint = compositorTestData.paints[compositorTestData.paints.length - 1]; var lastCompositorPaintSeqNo = lastCompositorPaint.sequenceNumber; diff --git a/gfx/layers/apz/test/mochitest/helper_interrupted_reflow.html b/gfx/layers/apz/test/mochitest/helper_interrupted_reflow.html index a23c310940c4..0dcaf1d67d2b 100644 --- a/gfx/layers/apz/test/mochitest/helper_interrupted_reflow.html +++ b/gfx/layers/apz/test/mochitest/helper_interrupted_reflow.html @@ -578,7 +578,7 @@ function getAsyncScrollOffsets(aPaintsToIgnore) { if (rcd == null) { continue; } - if (rcd.children.length > 0) { + if (rcd.children.length) { // The child may not be layerized in the first few paints, but once it is // layerized, it should stay layerized. childIsLayerized = true; @@ -654,7 +654,7 @@ async function test() { var asyncScrollOffsets = getAsyncScrollOffsets(framesToSkip); dump("Got scroll offsets: " + JSON.stringify(asyncScrollOffsets) + "\n"); var maxScrollParentLayerPixels = maxScroll; - while (asyncScrollOffsets.length > 0) { + while (asyncScrollOffsets.length) { let offset = asyncScrollOffsets.shift(); switch (state) { // 0 is the initial state, the scroll offset might be zero but should