Bug 1326479 - Fix 'indent' eslint errors now that eslint scans multiline array and object definitions. r=Gijs

MozReview-Commit-ID: 99mWjxu8PPn

--HG--
extra : rebase_source : f78d800263b8544ce0accbdb2dc57b303969543f
This commit is contained in:
Jared Wein 2017-01-03 10:07:50 -05:00
parent 4e35ed6e8a
commit 560afd3f8e
37 changed files with 268 additions and 258 deletions

View File

@ -110,13 +110,12 @@ function promisePossiblyInaccurateContentDimensions(browser) {
return { return {
window: copyProps(content, window: copyProps(content,
["innerWidth", "innerHeight", "outerWidth", "outerHeight", ["innerWidth", "innerHeight", "outerWidth", "outerHeight",
"scrollX", "scrollY", "scrollMaxX", "scrollMaxY"]), "scrollX", "scrollY", "scrollMaxX", "scrollMaxY"]),
body: copyProps(content.document.body, body: copyProps(content.document.body,
["clientWidth", "clientHeight", "scrollWidth", "scrollHeight"]), ["clientWidth", "clientHeight", "scrollWidth", "scrollHeight"]),
root: copyProps(content.document.documentElement, root: copyProps(content.document.documentElement,
["clientWidth", "clientHeight", "scrollWidth", "scrollHeight"]), ["clientWidth", "clientHeight", "scrollWidth", "scrollHeight"]),
isStandards: content.document.compatMode !== "BackCompat", isStandards: content.document.compatMode !== "BackCompat",
}; };
}); });

View File

@ -130,8 +130,8 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD
let places = getFileResource(types.HISTORY, ["places.sqlite"]); let places = getFileResource(types.HISTORY, ["places.sqlite"]);
let cookies = getFileResource(types.COOKIES, ["cookies.sqlite"]); let cookies = getFileResource(types.COOKIES, ["cookies.sqlite"]);
let passwords = getFileResource(types.PASSWORDS, let passwords = getFileResource(types.PASSWORDS,
["signons.sqlite", "logins.json", "key3.db", ["signons.sqlite", "logins.json", "key3.db",
"signedInUser.json"]); "signedInUser.json"]);
let formData = getFileResource(types.FORMDATA, ["formhistory.sqlite"]); let formData = getFileResource(types.FORMDATA, ["formhistory.sqlite"]);
let bookmarksBackups = getFileResource(types.OTHERDATA, let bookmarksBackups = getFileResource(types.OTHERDATA,
[PlacesBackups.profileRelativeFolderPath]); [PlacesBackups.profileRelativeFolderPath]);

View File

@ -329,9 +329,9 @@ SearchStrings.prototype = {
let recentSearchStrings = aDict.get("RecentSearchStrings"); let recentSearchStrings = aDict.get("RecentSearchStrings");
if (recentSearchStrings && recentSearchStrings.length > 0) { if (recentSearchStrings && recentSearchStrings.length > 0) {
let changes = recentSearchStrings.map((searchString) => ( let changes = recentSearchStrings.map((searchString) => (
{op: "add", {op: "add",
fieldname: "searchbar-history", fieldname: "searchbar-history",
value: searchString})); value: searchString}));
FormHistory.update(changes); FormHistory.update(changes);
} }
} }

View File

@ -85,7 +85,7 @@ var getServerTraits = Task.async(function* (target) {
{ name: "hasSetCurrentTime", actor: "animationplayer", { name: "hasSetCurrentTime", actor: "animationplayer",
method: "setCurrentTime" }, method: "setCurrentTime" },
{ name: "hasMutationEvents", actor: "animations", { name: "hasMutationEvents", actor: "animations",
method: "stopAnimationPlayerUpdates" }, method: "stopAnimationPlayerUpdates" },
{ name: "hasSetPlaybackRate", actor: "animationplayer", { name: "hasSetPlaybackRate", actor: "animationplayer",
method: "setPlaybackRate" }, method: "setPlaybackRate" },
{ name: "hasSetPlaybackRates", actor: "animations", { name: "hasSetPlaybackRates", actor: "animations",

View File

@ -60,7 +60,8 @@ var AnimationsPanel = {
} }
// Binding functions that need to be called in scope. // Binding functions that need to be called in scope.
for (let functionName of ["onKeyDown", "onPickerStarted", for (let functionName of [
"onKeyDown", "onPickerStarted",
"onPickerStopped", "refreshAnimationsUI", "onToggleAllClicked", "onPickerStopped", "refreshAnimationsUI", "onToggleAllClicked",
"onTabNavigated", "onTimelineDataChanged", "onTimelinePlayClicked", "onTabNavigated", "onTimelineDataChanged", "onTimelinePlayClicked",
"onTimelineRewindClicked", "onRateChanged"]) { "onTimelineRewindClicked", "onRateChanged"]) {

View File

@ -23,11 +23,11 @@
const el = document.createElement("div"); const el = document.createElement("div");
document.body.appendChild(el); document.body.appendChild(el);
el.animate({ opacity: [0, 1] }, el.animate({ opacity: [0, 1] },
{ duration: 200000, { duration: 200000,
iterations: 1, iterations: 1,
fill: "both", fill: "both",
delay: delay, delay: delay,
endDelay: endDelay }); endDelay: endDelay });
}); });
}); });
</script> </script>

View File

@ -65,7 +65,7 @@ const Accordion = React.createClass({
(created[i] || opened[i]) ? (created[i] || opened[i]) ?
div( div(
{ className: "_content", { className: "_content",
style: { display: opened[i] ? "block" : "none" } style: { display: opened[i] ? "block" : "none" }
}, },
React.createElement(item.component, item.componentProps || {}) React.createElement(item.component, item.componentProps || {})
) : ) :

View File

@ -24,7 +24,8 @@ const COLLAPSE_DATA_URL_REGEX = /^data.+base64/;
const COLLAPSE_DATA_URL_LENGTH = 60; const COLLAPSE_DATA_URL_LENGTH = 60;
// Contains only void (without end tag) HTML elements // Contains only void (without end tag) HTML elements
const HTML_VOID_ELEMENTS = [ "area", "base", "br", "col", "command", "embed", const HTML_VOID_ELEMENTS = [
"area", "base", "br", "col", "command", "embed",
"hr", "img", "input", "keygen", "link", "meta", "param", "source", "hr", "img", "input", "keygen", "link", "meta", "param", "source",
"track", "wbr" ]; "track", "wbr" ];

View File

@ -109,9 +109,9 @@ function executeInContent(name, data = {}, objects = {},
*/ */
function* getComputedStyleProperty(selector, pseudo, propName) { function* getComputedStyleProperty(selector, pseudo, propName) {
return yield executeInContent("Test:GetComputedStylePropertyValue", return yield executeInContent("Test:GetComputedStylePropertyValue",
{selector, {selector,
pseudo, pseudo,
name: propName}); name: propName});
} }
/** /**
@ -146,10 +146,10 @@ function getStyle(testActor, selector, propName) {
*/ */
function* waitForComputedStyleProperty(selector, pseudo, name, expected) { function* waitForComputedStyleProperty(selector, pseudo, name, expected) {
return yield executeInContent("Test:WaitForComputedStylePropertyValue", return yield executeInContent("Test:WaitForComputedStylePropertyValue",
{selector, {selector,
pseudo, pseudo,
expected, expected,
name}); name});
} }
/** /**

View File

@ -152,10 +152,12 @@ function executeInContent(name, data = {}, objects = {},
* name of the property. * name of the property.
*/ */
function* getComputedStyleProperty(selector, pseudo, propName) { function* getComputedStyleProperty(selector, pseudo, propName) {
return yield executeInContent("Test:GetComputedStylePropertyValue", let data = {
{selector, selector,
pseudo, pseudo,
name: propName}); name: propName
};
return yield executeInContent("Test:GetComputedStylePropertyValue", data);
} }
/** /**
@ -174,11 +176,13 @@ function* getComputedStyleProperty(selector, pseudo, propName) {
* the name used in test message * the name used in test message
*/ */
function* waitForComputedStyleProperty(selector, pseudo, name, expected) { function* waitForComputedStyleProperty(selector, pseudo, name, expected) {
return yield executeInContent("Test:WaitForComputedStylePropertyValue", let data = {
{selector, selector,
pseudo, pseudo,
expected, expected,
name}); name
};
return yield executeInContent("Test:WaitForComputedStylePropertyValue", data);
} }
/** /**

View File

@ -8,21 +8,21 @@
const TEST_URI = URL_ROOT + "doc_inspector_breadcrumbs.html"; const TEST_URI = URL_ROOT + "doc_inspector_breadcrumbs.html";
const NODES = [ const NODES = [
{selector: "#i1111", ids: "i1 i11 i111 i1111", nodeName: "div", {selector: "#i1111", ids: "i1 i11 i111 i1111", nodeName: "div",
title: "div#i1111"}, title: "div#i1111"},
{selector: "#i22", ids: "i2 i22", nodeName: "div", {selector: "#i22", ids: "i2 i22", nodeName: "div",
title: "div#i22"}, title: "div#i22"},
{selector: "#i2111", ids: "i2 i21 i211 i2111", nodeName: "div", {selector: "#i2111", ids: "i2 i21 i211 i2111", nodeName: "div",
title: "div#i2111"}, title: "div#i2111"},
{selector: "#i21", ids: "i2 i21 i211 i2111", nodeName: "div", {selector: "#i21", ids: "i2 i21 i211 i2111", nodeName: "div",
title: "div#i21"}, title: "div#i21"},
{selector: "#i22211", ids: "i2 i22 i222 i2221 i22211", nodeName: "div", {selector: "#i22211", ids: "i2 i22 i222 i2221 i22211", nodeName: "div",
title: "div#i22211"}, title: "div#i22211"},
{selector: "#i22", ids: "i2 i22 i222 i2221 i22211", nodeName: "div", {selector: "#i22", ids: "i2 i22 i222 i2221 i22211", nodeName: "div",
title: "div#i22"}, title: "div#i22"},
{selector: "#i3", ids: "i3", nodeName: "article", {selector: "#i3", ids: "i3", nodeName: "article",
title: "article#i3"}, title: "article#i3"},
{selector: "clipPath", ids: "vector clip", nodeName: "clipPath", {selector: "clipPath", ids: "vector clip", nodeName: "clipPath",
title: "clipPath#clip"}, title: "clipPath#clip"},
]; ];
add_task(function* () { add_task(function* () {

View File

@ -24,9 +24,9 @@ const TEST_URI = "data:application/xhtml+xml;charset=utf-8," + encodeURI(XHTML);
const NODES = [ const NODES = [
{selector: "clipPath", nodes: ["svg:svg", "svg:clipPath"], {selector: "clipPath", nodes: ["svg:svg", "svg:clipPath"],
nodeName: "svg:clipPath", title: "svg:clipPath#clip"}, nodeName: "svg:clipPath", title: "svg:clipPath#clip"},
{selector: "circle", nodes: ["svg:svg", "svg:circle"], {selector: "circle", nodes: ["svg:svg", "svg:circle"],
nodeName: "svg:circle", title: "svg:circle"}, nodeName: "svg:circle", title: "svg:circle"},
]; ];
add_task(function* () { add_task(function* () {

View File

@ -44,8 +44,8 @@ define(function (require, exports, module) {
render: function () { render: function () {
return ( return (
input({className: "searchBox", input({className: "searchBox",
placeholder: Locale.$STR("jsonViewer.filterJSON"), placeholder: Locale.$STR("jsonViewer.filterJSON"),
onChange: this.onSearch}) onChange: this.onSearch})
); );
}, },
}); });

View File

@ -72,14 +72,14 @@ var JsFlameGraphView = Heritage.extend(DetailsSubview, {
}); });
this.graph.setData({ data, this.graph.setData({ data,
bounds: { bounds: {
startTime: 0, startTime: 0,
endTime: duration endTime: duration
}, },
visible: { visible: {
startTime: interval.startTime || 0, startTime: interval.startTime || 0,
endTime: interval.endTime || duration endTime: interval.endTime || duration
} }
}); });
this.graph.focus(); this.graph.focus();

View File

@ -69,7 +69,8 @@ var MemoryFlameGraphView = Heritage.extend(DetailsSubview, {
&& L10N.getStr("table.idle") && L10N.getStr("table.idle")
}); });
this.graph.setData({ data, this.graph.setData({
data,
bounds: { bounds: {
startTime: 0, startTime: 0,
endTime: duration endTime: duration

View File

@ -75,12 +75,14 @@ module.exports = createClass({
let listContent; let listContent;
if (state == Types.deviceListState.LOADED) { if (state == Types.deviceListState.LOADED) {
listContent = [dom.option({ listContent = [
value: "", dom.option({
title: "", value: "",
disabled: true, title: "",
hidden: true, disabled: true,
}, getStr("responsive.noDeviceSelected")), hidden: true,
},
getStr("responsive.noDeviceSelected")),
options.map(device => { options.map(device => {
return dom.option({ return dom.option({
key: device.name, key: device.name,

View File

@ -1330,9 +1330,8 @@ InplaceEditor.prototype = {
startCheckQuery = ""; startCheckQuery = "";
} }
list = list = ["!important",
["!important", ...this._getCSSValuesForPropertyName(this.property.name)];
...this._getCSSValuesForPropertyName(this.property.name)];
if (query == "") { if (query == "") {
// Do not suggest '!important' without any manually typed character. // Do not suggest '!important' without any manually typed character.
@ -1356,9 +1355,8 @@ InplaceEditor.prototype = {
// We are in CSS value completion // We are in CSS value completion
let propertyName = let propertyName =
query.match(/[;"'=]\s*([^"';:= ]+)\s*:\s*[^"';:=]*$/)[1]; query.match(/[;"'=]\s*([^"';:= ]+)\s*:\s*[^"';:=]*$/)[1];
list = list = ["!important;",
["!important;", ...this._getCSSValuesForPropertyName(propertyName)];
...this._getCSSValuesForPropertyName(propertyName)];
let matchLastQuery = /([^\s,.\/]+$)/.exec(match[2] || ""); let matchLastQuery = /([^\s,.\/]+$)/.exec(match[2] || "");
if (matchLastQuery) { if (matchLastQuery) {
startCheckQuery = matchLastQuery[0]; startCheckQuery = matchLastQuery[0];

View File

@ -70,9 +70,9 @@ const ATTRIBUTE_TYPES = [
{namespaceURI: HTML_NS, attributeName: "href", tagName: "area", type: TYPE_URI}, {namespaceURI: HTML_NS, attributeName: "href", tagName: "area", type: TYPE_URI},
{namespaceURI: "*", attributeName: "href", tagName: "link", type: TYPE_CSS_RESOURCE_URI, {namespaceURI: "*", attributeName: "href", tagName: "link", type: TYPE_CSS_RESOURCE_URI,
/* eslint-enable */ /* eslint-enable */
isValid: (namespaceURI, tagName, attributes) => { isValid: (namespaceURI, tagName, attributes) => {
return getAttribute(attributes, "rel") === "stylesheet"; return getAttribute(attributes, "rel") === "stylesheet";
}}, }},
/* eslint-disable max-len */ /* eslint-disable max-len */
{namespaceURI: "*", attributeName: "href", tagName: "link", type: TYPE_URI}, {namespaceURI: "*", attributeName: "href", tagName: "link", type: TYPE_URI},
{namespaceURI: HTML_NS, attributeName: "href", tagName: "base", type: TYPE_URI}, {namespaceURI: HTML_NS, attributeName: "href", tagName: "base", type: TYPE_URI},

View File

@ -132,7 +132,7 @@ function scroll(graph, wheel, axis, x, y = 1) {
y /= window.devicePixelRatio; y /= window.devicePixelRatio;
graph._onMouseMove({ testX: x, testY: y }); graph._onMouseMove({ testX: x, testY: y });
graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel, graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel,
HORIZONTAL_AXIS, HORIZONTAL_AXIS,
VERTICAL_AXIS VERTICAL_AXIS
}); });
} }

View File

@ -86,7 +86,7 @@ function scroll(graph, wheel, axis, x, y = 1) {
y /= window.devicePixelRatio; y /= window.devicePixelRatio;
graph._onMouseMove({ testX: x, testY: y }); graph._onMouseMove({ testX: x, testY: y });
graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel, graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel,
HORIZONTAL_AXIS, HORIZONTAL_AXIS,
VERTICAL_AXIS VERTICAL_AXIS
}); });
} }

View File

@ -47,76 +47,76 @@ const TEST_DATA = [{
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, numeric value.", description: "Valid syntax, numeric value.",
example: "name: 1;", example: "name: 1;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "1"}, {type: "property-value", text: "1"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, url value.", description: "Valid syntax, url value.",
example: "name: url(./name);", example: "name: url(./name);",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "url(./name)"}, {type: "property-value", text: "url(./name)"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, space before ':'.", description: "Valid syntax, space before ':'.",
example: "name : stringValue;", example: "name : stringValue;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, space before ';'.", description: "Valid syntax, space before ';'.",
example: "name: stringValue ;", example: "name: stringValue ;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, trailing space.", description: "Valid syntax, trailing space.",
example: "name: stringValue; ", example: "name: stringValue; ",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"}, {type: "text", text: ";"},
{type: "text", text: " "} {type: "text", text: " "}
]}, { ]}, {
description: "Valid syntax, leading space.", description: "Valid syntax, leading space.",
example: " name: stringValue;", example: " name: stringValue;",
expected: [{type: "text", text: " "}, expected: [{type: "text", text: " "},
{type: "property-name", text: "name"}, {type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, two spaces.", description: "Valid syntax, two spaces.",
example: "name: stringValue;", example: "name: stringValue;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, no spaces.", description: "Valid syntax, no spaces.",
example: "name:stringValue;", example: "name:stringValue;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, two-part value.", description: "Valid syntax, two-part value.",
example: "name: stringValue 1;", example: "name: stringValue 1;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
@ -124,10 +124,10 @@ const TEST_DATA = [{
{type: "property-value", text: "1"}, {type: "property-value", text: "1"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, two declarations.", description: "Valid syntax, two declarations.",
example: "name: stringValue;\n" + example: "name: stringValue;\n" +
"name: 1;", "name: 1;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
@ -139,10 +139,10 @@ const TEST_DATA = [{
{type: "property-value", text: "1"}, {type: "property-value", text: "1"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, commented, numeric value.", description: "Valid syntax, commented, numeric value.",
example: "/* comment */\n" + example: "/* comment */\n" +
"name: 1;", "name: 1;",
expected: [{type: "comment", text: "/* comment */"}, expected: [{type: "comment", text: "/* comment */"},
{type: "text", text: "\n"}, {type: "text", text: "\n"},
{type: "property-name", text: "name"}, {type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
@ -150,11 +150,11 @@ const TEST_DATA = [{
{type: "property-value", text: "1"}, {type: "property-value", text: "1"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, multiline commented, string value.", description: "Valid syntax, multiline commented, string value.",
example: "/* multiline \n" + example: "/* multiline \n" +
"comment */\n" + "comment */\n" +
"name: stringValue;", "name: stringValue;",
expected: [{type: "comment", text: "/* multiline \ncomment */"}, expected: [{type: "comment", text: "/* multiline \ncomment */"},
{type: "text", text: "\n"}, {type: "text", text: "\n"},
{type: "property-name", text: "name"}, {type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
@ -162,12 +162,12 @@ const TEST_DATA = [{
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, commented, two declarations.", description: "Valid syntax, commented, two declarations.",
example: "/* comment 1 */\n" + example: "/* comment 1 */\n" +
"name: 1;\n" + "name: 1;\n" +
"/* comment 2 */\n" + "/* comment 2 */\n" +
"name: stringValue;", "name: stringValue;",
expected: [{type: "comment", text: "/* comment 1 */"}, expected: [{type: "comment", text: "/* comment 1 */"},
{type: "text", text: "\n"}, {type: "text", text: "\n"},
{type: "property-name", text: "name"}, {type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
@ -183,20 +183,20 @@ const TEST_DATA = [{
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, multiline.", description: "Valid syntax, multiline.",
example: "name: \n" + example: "name: \n" +
"stringValue;", "stringValue;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " \n"}, {type: "text", text: " \n"},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Valid syntax, multiline, two declarations.", description: "Valid syntax, multiline, two declarations.",
example: "name: \n" + example: "name: \n" +
"stringValue \n" + "stringValue \n" +
"stringValue2;", "stringValue2;",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " \n"}, {type: "text", text: " \n"},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
@ -204,9 +204,9 @@ const TEST_DATA = [{
{type: "property-value", text: "stringValue2"}, {type: "property-value", text: "stringValue2"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Invalid: not CSS at all.", description: "Invalid: not CSS at all.",
example: "not CSS at all", example: "not CSS at all",
expected: [{type: "property-name", text: "not"}, expected: [{type: "property-name", text: "not"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-name", text: "CSS"}, {type: "property-name", text: "CSS"},
{type: "text", text: " "}, {type: "text", text: " "},
@ -214,23 +214,23 @@ const TEST_DATA = [{
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-name", text: "all"} {type: "property-name", text: "all"}
]}, { ]}, {
description: "Invalid: switched ':' and ';'.", description: "Invalid: switched ':' and ';'.",
example: "name; stringValue:", example: "name; stringValue:",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ";"}, {type: "text", text: ";"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-name", text: "stringValue"}, {type: "property-name", text: "stringValue"},
{type: "text", text: ":"} {type: "text", text: ":"}
]}, { ]}, {
description: "Invalid: unterminated comment.", description: "Invalid: unterminated comment.",
example: "/* unterminated comment\n" + example: "/* unterminated comment\n" +
"name: stringValue;", "name: stringValue;",
expected: [{type: "comment", text: "/* unterminated comment\nname: stringValue;"} expected: [{type: "comment", text: "/* unterminated comment\nname: stringValue;"}
]}, { ]}, {
description: "Invalid: bad comment syntax.", description: "Invalid: bad comment syntax.",
example: "// invalid comment\n" + example: "// invalid comment\n" +
"name: stringValue;", "name: stringValue;",
expected: [{type: "text", text: "/"}, expected: [{type: "text", text: "/"},
{type: "text", text: "/"}, {type: "text", text: "/"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-name", text: "invalid"}, {type: "property-name", text: "invalid"},
@ -243,10 +243,10 @@ const TEST_DATA = [{
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},
{type: "text", text: ";"} {type: "text", text: ";"}
]}, { ]}, {
description: "Invalid: no trailing ';'.", description: "Invalid: no trailing ';'.",
example: "name: stringValue\n" + example: "name: stringValue\n" +
"name: stringValue2", "name: stringValue2",
expected: [{type: "property-name", text: "name"}, expected: [{type: "property-name", text: "name"},
{type: "text", text: ":"}, {type: "text", text: ":"},
{type: "text", text: " "}, {type: "text", text: " "},
{type: "property-value", text: "stringValue"}, {type: "property-value", text: "stringValue"},

View File

@ -72,10 +72,10 @@ function testParseCssProperty(doc, parser) {
["1px solid ", {name: "red"}]), ["1px solid ", {name: "red"}]),
makeColorTest("background-image", makeColorTest("background-image",
"linear-gradient(to right, #F60 10%, rgba(0,0,0,1))", "linear-gradient(to right, #F60 10%, rgba(0,0,0,1))",
["linear-gradient(to right, ", {name: "#F60"}, ["linear-gradient(to right, ", {name: "#F60"},
" 10%, ", {name: "rgba(0,0,0,1)"}, " 10%, ", {name: "rgba(0,0,0,1)"},
")"]), ")"]),
// In "arial black", "black" is a font, not a color. // In "arial black", "black" is a font, not a color.
makeColorTest("font-family", "arial black", ["arial black"]), makeColorTest("font-family", "arial black", ["arial black"]),
@ -84,10 +84,10 @@ function testParseCssProperty(doc, parser) {
["0 0 1em ", {name: "red"}]), ["0 0 1em ", {name: "red"}]),
makeColorTest("box-shadow", makeColorTest("box-shadow",
"0 0 1em red, 2px 2px 0 0 rgba(0,0,0,.5)", "0 0 1em red, 2px 2px 0 0 rgba(0,0,0,.5)",
["0 0 1em ", {name: "red"}, ["0 0 1em ", {name: "red"},
", 2px 2px 0 0 ", ", 2px 2px 0 0 ",
{name: "rgba(0,0,0,.5)"}]), {name: "rgba(0,0,0,.5)"}]),
makeColorTest("content", "\"red\"", ["\"red\""]), makeColorTest("content", "\"red\"", ["\"red\""]),
@ -95,61 +95,61 @@ function testParseCssProperty(doc, parser) {
makeColorTest("hellothere", "'red'", ["'red'"]), makeColorTest("hellothere", "'red'", ["'red'"]),
makeColorTest("filter", makeColorTest("filter",
"blur(1px) drop-shadow(0 0 0 blue) url(red.svg#blue)", "blur(1px) drop-shadow(0 0 0 blue) url(red.svg#blue)",
["<span data-filters=\"blur(1px) drop-shadow(0 0 0 blue) ", ["<span data-filters=\"blur(1px) drop-shadow(0 0 0 blue) ",
"url(red.svg#blue)\"><span>", "url(red.svg#blue)\"><span>",
"blur(1px) drop-shadow(0 0 0 ", "blur(1px) drop-shadow(0 0 0 ",
{name: "blue"}, {name: "blue"},
") url(red.svg#blue)</span></span>"]), ") url(red.svg#blue)</span></span>"]),
makeColorTest("color", "currentColor", ["currentColor"]), makeColorTest("color", "currentColor", ["currentColor"]),
// Test a very long property. // Test a very long property.
makeColorTest("background-image", makeColorTest("background-image",
/* eslint-disable max-len */ /* eslint-disable max-len */
"linear-gradient(to left, transparent 0, transparent 5%,#F00 0, #F00 10%,#FF0 0, #FF0 15%,#0F0 0, #0F0 20%,#0FF 0, #0FF 25%,#00F 0, #00F 30%,#800 0, #800 35%,#880 0, #880 40%,#080 0, #080 45%,#088 0, #088 50%,#008 0, #008 55%,#FFF 0, #FFF 60%,#EEE 0, #EEE 65%,#CCC 0, #CCC 70%,#999 0, #999 75%,#666 0, #666 80%,#333 0, #333 85%,#111 0, #111 90%,#000 0, #000 95%,transparent 0, transparent 100%)", "linear-gradient(to left, transparent 0, transparent 5%,#F00 0, #F00 10%,#FF0 0, #FF0 15%,#0F0 0, #0F0 20%,#0FF 0, #0FF 25%,#00F 0, #00F 30%,#800 0, #800 35%,#880 0, #880 40%,#080 0, #080 45%,#088 0, #088 50%,#008 0, #008 55%,#FFF 0, #FFF 60%,#EEE 0, #EEE 65%,#CCC 0, #CCC 70%,#999 0, #999 75%,#666 0, #666 80%,#333 0, #333 85%,#111 0, #111 90%,#000 0, #000 95%,transparent 0, transparent 100%)",
/* eslint-enable max-len */ /* eslint-enable max-len */
["linear-gradient(to left, ", {name: "transparent"}, ["linear-gradient(to left, ", {name: "transparent"},
" 0, ", {name: "transparent"}, " 0, ", {name: "transparent"},
" 5%,", {name: "#F00"}, " 5%,", {name: "#F00"},
" 0, ", {name: "#F00"}, " 0, ", {name: "#F00"},
" 10%,", {name: "#FF0"}, " 10%,", {name: "#FF0"},
" 0, ", {name: "#FF0"}, " 0, ", {name: "#FF0"},
" 15%,", {name: "#0F0"}, " 15%,", {name: "#0F0"},
" 0, ", {name: "#0F0"}, " 0, ", {name: "#0F0"},
" 20%,", {name: "#0FF"}, " 20%,", {name: "#0FF"},
" 0, ", {name: "#0FF"}, " 0, ", {name: "#0FF"},
" 25%,", {name: "#00F"}, " 25%,", {name: "#00F"},
" 0, ", {name: "#00F"}, " 0, ", {name: "#00F"},
" 30%,", {name: "#800"}, " 30%,", {name: "#800"},
" 0, ", {name: "#800"}, " 0, ", {name: "#800"},
" 35%,", {name: "#880"}, " 35%,", {name: "#880"},
" 0, ", {name: "#880"}, " 0, ", {name: "#880"},
" 40%,", {name: "#080"}, " 40%,", {name: "#080"},
" 0, ", {name: "#080"}, " 0, ", {name: "#080"},
" 45%,", {name: "#088"}, " 45%,", {name: "#088"},
" 0, ", {name: "#088"}, " 0, ", {name: "#088"},
" 50%,", {name: "#008"}, " 50%,", {name: "#008"},
" 0, ", {name: "#008"}, " 0, ", {name: "#008"},
" 55%,", {name: "#FFF"}, " 55%,", {name: "#FFF"},
" 0, ", {name: "#FFF"}, " 0, ", {name: "#FFF"},
" 60%,", {name: "#EEE"}, " 60%,", {name: "#EEE"},
" 0, ", {name: "#EEE"}, " 0, ", {name: "#EEE"},
" 65%,", {name: "#CCC"}, " 65%,", {name: "#CCC"},
" 0, ", {name: "#CCC"}, " 0, ", {name: "#CCC"},
" 70%,", {name: "#999"}, " 70%,", {name: "#999"},
" 0, ", {name: "#999"}, " 0, ", {name: "#999"},
" 75%,", {name: "#666"}, " 75%,", {name: "#666"},
" 0, ", {name: "#666"}, " 0, ", {name: "#666"},
" 80%,", {name: "#333"}, " 80%,", {name: "#333"},
" 0, ", {name: "#333"}, " 0, ", {name: "#333"},
" 85%,", {name: "#111"}, " 85%,", {name: "#111"},
" 0, ", {name: "#111"}, " 0, ", {name: "#111"},
" 90%,", {name: "#000"}, " 90%,", {name: "#000"},
" 0, ", {name: "#000"}, " 0, ", {name: "#000"},
" 95%,", {name: "transparent"}, " 95%,", {name: "transparent"},
" 0, ", {name: "transparent"}, " 0, ", {name: "transparent"},
" 100%)"]), " 100%)"]),
]; ];
let target = doc.querySelector("div"); let target = doc.querySelector("div");

View File

@ -86,12 +86,14 @@ function testGetColor() {
} }
function testColorExistence() { function testColorExistence() {
const vars = ["body-background", "sidebar-background", "contrast-background", const vars = [
"tab-toolbar-background", "toolbar-background", "selection-background", "body-background", "sidebar-background", "contrast-background",
"selection-color", "selection-background-semitransparent", "splitter-color", "comment", "tab-toolbar-background", "toolbar-background", "selection-background",
"body-color", "body-color-alt", "content-color1", "content-color2", "content-color3", "selection-color", "selection-background-semitransparent", "splitter-color",
"highlight-green", "highlight-blue", "highlight-bluegrey", "highlight-purple", "comment", "body-color", "body-color-alt", "content-color1", "content-color2",
"highlight-lightorange", "highlight-orange", "highlight-red", "highlight-pink" "content-color3", "highlight-green", "highlight-blue", "highlight-bluegrey",
"highlight-purple", "highlight-lightorange", "highlight-orange", "highlight-red",
"highlight-pink"
]; ];
for (let type of vars) { for (let type of vars) {

View File

@ -327,10 +327,11 @@ const TEST_DATA = [
{ {
parseComments: true, parseComments: true,
input: "<!-- color: red; --> color: blue;", input: "<!-- color: red; --> color: blue;",
expected: [{name: "color", value: "red", priority: "", expected: [
offsets: [5, 16]}, {name: "color", value: "red", priority: "",
{name: "color", value: "blue", priority: "", offsets: [5, 16]},
offsets: [21, 33]}] {name: "color", value: "blue", priority: "",
offsets: [21, 33]}]
}, },
// Don't error on an empty comment. // Don't error on an empty comment.

View File

@ -211,7 +211,7 @@ Spectrum.prototype = {
let rgb = Spectrum.hsvToRgb(this.hsv[0], this.hsv[1], this.hsv[2], let rgb = Spectrum.hsvToRgb(this.hsv[0], this.hsv[1], this.hsv[2],
this.hsv[3]); this.hsv[3]);
return [Math.round(rgb[0]), Math.round(rgb[1]), Math.round(rgb[2]), return [Math.round(rgb[0]), Math.round(rgb[1]), Math.round(rgb[2]),
Math.round(rgb[3] * 100) / 100]; Math.round(rgb[3] * 100) / 100];
}, },
get rgbNoSatVal() { get rgbNoSatVal() {

View File

@ -185,23 +185,23 @@ add_task(function* () {
["ne 3", ["ne 3",
{line: 2, ch: 11}], {line: 2, ch: 11}],
["line 1", ["line 1",
{line: 0, ch: 9}], {line: 0, ch: 9}],
// Testing find prev // Testing find prev
["line", ["line",
{line: 4, ch: 11}, {line: 4, ch: 11},
true], true],
["line", ["line",
{line: 3, ch: 10}, {line: 3, ch: 10},
true], true],
["line", ["line",
{line: 2, ch: 9}, {line: 2, ch: 9},
true], true],
["line", ["line",
{line: 1, ch: 8}, {line: 1, ch: 8},
true], true],
["line", ["line",
{line: 0, ch: 7}, {line: 0, ch: 7},
true] true]
]; ];
for (let v of testVectors) { for (let v of testVectors) {

View File

@ -10,17 +10,17 @@
const TEST_CASES = [ const TEST_CASES = [
[["localStorage", "http://test1.example.org"], [["localStorage", "http://test1.example.org"],
"ls1", "name"], "ls1", "name"],
[["sessionStorage", "http://test1.example.org"], [["sessionStorage", "http://test1.example.org"],
"ss1", "name"], "ss1", "name"],
[ [
["cookies", "test1.example.org"], ["cookies", "test1.example.org"],
getCookieId("c1", "test1.example.org", "/browser"), "name" getCookieId("c1", "test1.example.org", "/browser"), "name"
], ],
[["indexedDB", "http://test1.example.org", "idb1 (default)", "obj1"], [["indexedDB", "http://test1.example.org", "idb1 (default)", "obj1"],
1, "name"], 1, "name"],
[["Cache", "http://test1.example.org", "plop"], [["Cache", "http://test1.example.org", "plop"],
MAIN_DOMAIN + "404_cached_file.js", "url"], MAIN_DOMAIN + "404_cached_file.js", "url"],
]; ];
add_task(function* () { add_task(function* () {

View File

@ -43,7 +43,7 @@ add_task(function* () {
[["sessionStorage", "https://sectest1.example.org"], "iframe-s-ss1", "name"], [["sessionStorage", "https://sectest1.example.org"], "iframe-s-ss1", "name"],
[["indexedDB", "http://test1.example.org", "idb1 (default)", "obj1"], 1, "name"], [["indexedDB", "http://test1.example.org", "idb1 (default)", "obj1"], 1, "name"],
[["Cache", "http://test1.example.org", "plop"], [["Cache", "http://test1.example.org", "plop"],
MAIN_DOMAIN + "404_cached_file.js", "url"], MAIN_DOMAIN + "404_cached_file.js", "url"],
]; ];
for (let [store, rowName, cellToClick] of deleteHosts) { for (let [store, rowName, cellToClick] of deleteHosts) {

View File

@ -57,11 +57,10 @@ add_task(function* () {
const TESTCASE_URI = makeDocument( const TESTCASE_URI = makeDocument(
[makeStylesheet(".a")], [makeStylesheet(".a")],
[makeDocument([], [makeDocument([],
[FOUR, [FOUR,
DOCUMENT_WITH_INLINE_STYLE]), DOCUMENT_WITH_INLINE_STYLE]),
makeDocument([makeStylesheet(".b"), makeDocument([makeStylesheet(".b"), SIMPLE],
SIMPLE], [makeDocument([makeStylesheet(".c")],
[makeDocument([makeStylesheet(".c")],
[])]), [])]),
makeDocument([SIMPLE], []), makeDocument([SIMPLE], []),
SIMPLE_DOCUMENT SIMPLE_DOCUMENT

View File

@ -402,11 +402,11 @@ DevToolsUtils.defineLazyGetter(this, "NetworkHelper", () => {
* http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/ * http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/
*/ */
function mainThreadFetch(urlIn, aOptions = { loadFromCache: true, function mainThreadFetch(urlIn, aOptions = { loadFromCache: true,
policy: Ci.nsIContentPolicy.TYPE_OTHER, policy: Ci.nsIContentPolicy.TYPE_OTHER,
window: null, window: null,
charset: null, charset: null,
principal: null, principal: null,
cacheKey: null }) { cacheKey: null }) {
// Create a channel. // Create a channel.
let url = urlIn.split(" -> ").pop(); let url = urlIn.split(" -> ").pop();
let channel; let channel;

View File

@ -105,18 +105,18 @@ function test_lexer(cssText, tokenTypes) {
var LEX_TESTS = [ var LEX_TESTS = [
["simple", ["ident:simple"]], ["simple", ["ident:simple"]],
["simple: { hi; }", ["simple: { hi; }",
["ident:simple", "symbol::", ["ident:simple", "symbol::",
"whitespace", "symbol:{", "whitespace", "symbol:{",
"whitespace", "ident:hi", "whitespace", "ident:hi",
"symbol:;", "whitespace", "symbol:;", "whitespace",
"symbol:}"]], "symbol:}"]],
["/* whatever */", ["comment"]], ["/* whatever */", ["comment"]],
["'string'", ["string:string"]], ["'string'", ["string:string"]],
['"string"', ["string:string"]], ['"string"', ["string:string"]],
["rgb(1,2,3)", ["function:rgb", "number", ["rgb(1,2,3)", ["function:rgb", "number",
"symbol:,", "number", "symbol:,", "number",
"symbol:,", "number", "symbol:,", "number",
"symbol:)"]], "symbol:)"]],
["@media", ["at:media"]], ["@media", ["at:media"]],
["#hibob", ["id:hibob"]], ["#hibob", ["id:hibob"]],
["#123", ["hash:123"]], ["#123", ["hash:123"]],

View File

@ -1829,9 +1829,9 @@ this.Schemas = {
parseFunction(path, fun) { parseFunction(path, fun) {
let f = new FunctionEntry(fun, path, fun.name, let f = new FunctionEntry(fun, path, fun.name,
this.parseSchema(fun, path, this.parseSchema(fun, path,
["name", "unsupported", "returns", ["name", "unsupported", "returns",
"permissions", "permissions",
"allowAmbiguousOptionalArguments"]), "allowAmbiguousOptionalArguments"]),
fun.unsupported || false, fun.unsupported || false,
fun.allowAmbiguousOptionalArguments || false, fun.allowAmbiguousOptionalArguments || false,
fun.returns || null, fun.returns || null,
@ -1907,8 +1907,8 @@ this.Schemas = {
/* eslint-enable no-unused-vars */ /* eslint-enable no-unused-vars */
let type = this.parseSchema(event, [namespaceName], let type = this.parseSchema(event, [namespaceName],
["name", "unsupported", "permissions", ["name", "unsupported", "permissions",
"extraParameters", "returns", "filters"]); "extraParameters", "returns", "filters"]);
let e = new Event(event, [namespaceName], event.name, type, extras, let e = new Event(event, [namespaceName], event.name, type, extras,
event.unsupported || false, event.unsupported || false,

View File

@ -40,10 +40,10 @@ const DOWNLOAD_ITEM_CHANGE_FIELDS = ["endTime", "state", "paused", "canResume",
// From https://fetch.spec.whatwg.org/#forbidden-header-name // From https://fetch.spec.whatwg.org/#forbidden-header-name
const FORBIDDEN_HEADERS = ["ACCEPT-CHARSET", "ACCEPT-ENCODING", const FORBIDDEN_HEADERS = ["ACCEPT-CHARSET", "ACCEPT-ENCODING",
"ACCESS-CONTROL-REQUEST-HEADERS", "ACCESS-CONTROL-REQUEST-METHOD", "ACCESS-CONTROL-REQUEST-HEADERS", "ACCESS-CONTROL-REQUEST-METHOD",
"CONNECTION", "CONTENT-LENGTH", "COOKIE", "COOKIE2", "DATE", "DNT", "CONNECTION", "CONTENT-LENGTH", "COOKIE", "COOKIE2", "DATE", "DNT",
"EXPECT", "HOST", "KEEP-ALIVE", "ORIGIN", "REFERER", "TE", "TRAILER", "EXPECT", "HOST", "KEEP-ALIVE", "ORIGIN", "REFERER", "TE", "TRAILER",
"TRANSFER-ENCODING", "UPGRADE", "VIA"]; "TRANSFER-ENCODING", "UPGRADE", "VIA"];
const FORBIDDEN_PREFIXES = /^PROXY-|^SEC-/i; const FORBIDDEN_PREFIXES = /^PROXY-|^SEC-/i;

View File

@ -141,8 +141,8 @@ this.NarrateTestUtils = {
let nodes = Array.from($$(".narrate-word-highlight")); let nodes = Array.from($$(".narrate-word-highlight"));
return nodes.map(node => { return nodes.map(node => {
return { word: node.dataset.word, return { word: node.dataset.word,
left: Number(node.style.left.replace(/px$/, "")), left: Number(node.style.left.replace(/px$/, "")),
top: Number(node.style.top.replace(/px$/, ""))}; top: Number(node.style.top.replace(/px$/, ""))};
}); });
} }
}; };

View File

@ -89,9 +89,11 @@ var AboutReader = function(mm, win, articlePromise) {
let colorSchemeValues = JSON.parse(Services.prefs.getCharPref("reader.color_scheme.values")); let colorSchemeValues = JSON.parse(Services.prefs.getCharPref("reader.color_scheme.values"));
let colorSchemeOptions = colorSchemeValues.map((value) => { let colorSchemeOptions = colorSchemeValues.map((value) => {
return { name: gStrings.GetStringFromName("aboutReader.colorScheme." + value), return {
value, name: gStrings.GetStringFromName("aboutReader.colorScheme." + value),
itemClass: value + "-button" }; value,
itemClass: value + "-button"
};
}); });
let colorScheme = Services.prefs.getCharPref("reader.color_scheme"); let colorScheme = Services.prefs.getCharPref("reader.color_scheme");

View File

@ -25,8 +25,8 @@ addMessageListener("Extension:DisableWebNavigation", () => {
var FormSubmitListener = { var FormSubmitListener = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIFormSubmitObserver, Ci.nsIFormSubmitObserver,
Ci.nsISupportsWeakReference]), Ci.nsISupportsWeakReference]),
init() { init() {
this.formSubmitWindows = new WeakSet(); this.formSubmitWindows = new WeakSet();
Services.obs.addObserver(FormSubmitListener, "earlyformsubmit", false); Services.obs.addObserver(FormSubmitListener, "earlyformsubmit", false);

View File

@ -535,8 +535,8 @@ HttpObserverManager = {
let loadContext = this.getLoadContext(channel); let loadContext = this.getLoadContext(channel);
if (!this.errorCheck(channel, loadContext, channelData)) { if (!this.errorCheck(channel, loadContext, channelData)) {
this.runChannelListener(channel, loadContext, "onError", this.runChannelListener(channel, loadContext, "onError",
{error: this.activityErrorsMap.get(lastActivity) || {error: this.activityErrorsMap.get(lastActivity) ||
`NS_ERROR_NET_UNKNOWN_${lastActivity}`}); `NS_ERROR_NET_UNKNOWN_${lastActivity}`});
} }
} else if (lastActivity !== this.GOOD_LAST_ACTIVITY && } else if (lastActivity !== this.GOOD_LAST_ACTIVITY &&
lastActivity !== nsIHttpActivityObserver.ACTIVITY_SUBTYPE_TRANSACTION_CLOSE) { lastActivity !== nsIHttpActivityObserver.ACTIVITY_SUBTYPE_TRANSACTION_CLOSE) {