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
Родитель 4e35ed6e8a
Коммит 560afd3f8e
37 изменённых файлов: 268 добавлений и 258 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -24,7 +24,8 @@ const COLLAPSE_DATA_URL_REGEX = /^data.+base64/;
const COLLAPSE_DATA_URL_LENGTH = 60;
// 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",
"track", "wbr" ];

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -24,9 +24,9 @@ const TEST_URI = "data:application/xhtml+xml;charset=utf-8," + encodeURI(XHTML);
const NODES = [
{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"],
nodeName: "svg:circle", title: "svg:circle"},
nodeName: "svg:circle", title: "svg:circle"},
];
add_task(function* () {

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -211,7 +211,7 @@ Spectrum.prototype = {
let rgb = Spectrum.hsvToRgb(this.hsv[0], this.hsv[1], this.hsv[2],
this.hsv[3]);
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() {

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -43,7 +43,7 @@ add_task(function* () {
[["sessionStorage", "https://sectest1.example.org"], "iframe-s-ss1", "name"],
[["indexedDB", "http://test1.example.org", "idb1 (default)", "obj1"], 1, "name"],
[["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) {

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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