зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for gfx. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D155170
This commit is contained in:
Родитель
4f95e6b415
Коммит
d86604e53c
|
@ -478,7 +478,6 @@ module.exports = {
|
|||
{
|
||||
files: [
|
||||
"dom/**",
|
||||
"gfx/**",
|
||||
"image/test/browser/browser_image.js",
|
||||
"layout/**",
|
||||
"mobile/android/**",
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче