зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1195018 - Support 'background_color' member in the manifest processor. r=marcosc
This commit is contained in:
Родитель
69e504a564
Коммит
25c5f0d76a
|
@ -90,6 +90,7 @@ this.ManifestProcessor = { // jshint ignore:line
|
||||||
),
|
),
|
||||||
'short_name': processShortNameMember(),
|
'short_name': processShortNameMember(),
|
||||||
'theme_color': processThemeColorMember(),
|
'theme_color': processThemeColorMember(),
|
||||||
|
'background_color': processBackgroundColorMember(),
|
||||||
};
|
};
|
||||||
processedManifest.scope = processScopeMember();
|
processedManifest.scope = processScopeMember();
|
||||||
return processedManifest;
|
return processedManifest;
|
||||||
|
@ -224,6 +225,17 @@ this.ManifestProcessor = { // jshint ignore:line
|
||||||
return extractor.extractColorValue(spec);
|
return extractor.extractColorValue(spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function processBackgroundColorMember() {
|
||||||
|
const spec = {
|
||||||
|
objectName: 'manifest',
|
||||||
|
object: rawManifest,
|
||||||
|
property: 'background_color',
|
||||||
|
expectedType: 'string',
|
||||||
|
trim: true
|
||||||
|
};
|
||||||
|
return extractor.extractColorValue(spec);
|
||||||
|
}
|
||||||
|
|
||||||
function processLangMember() {
|
function processLangMember() {
|
||||||
const spec = {
|
const spec = {
|
||||||
objectName: 'manifest',
|
objectName: 'manifest',
|
||||||
|
|
|
@ -53,7 +53,7 @@ ValueExtractor.prototype = {
|
||||||
if (DOMUtils.isValidCSSColor(value)) {
|
if (DOMUtils.isValidCSSColor(value)) {
|
||||||
color = value;
|
color = value;
|
||||||
} else if (value) {
|
} else if (value) {
|
||||||
const msg = `background_color: ${value} is not a valid CSS color.`;
|
const msg = `${spec.property}: ${value} is not a valid CSS color.`;
|
||||||
this.console.warn(msg);
|
this.console.warn(msg);
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче