Bug 1289425 - Remove domUtils from the InplaceEditor; r=tromey

MozReview-Commit-ID: D9thpWSNwKC

--HG--
extra : rebase_source : b11d3b8bc1f4c3b4777386e93dc03cee07508f86
This commit is contained in:
Greg Tatum 2016-08-05 11:40:51 -05:00
Родитель a17cc41d63
Коммит cce5c3c6ef
2 изменённых файлов: 11 добавлений и 11 удалений

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

@ -23,7 +23,7 @@
"use strict";
const {Ci, Cc} = require("chrome");
const {Ci} = require("chrome");
const Services = require("Services");
const focusManager = Services.focus;
const {KeyCodes} = require("devtools/client/shared/keycodes");
@ -43,7 +43,6 @@ const MAX_POPUP_ENTRIES = 500;
const FOCUS_FORWARD = focusManager.MOVEFOCUS_FORWARD;
const FOCUS_BACKWARD = focusManager.MOVEFOCUS_BACKWARD;
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
const EventEmitter = require("devtools/shared/event-emitter");
const { findMostRelevantCssPropertyIndex } = require("./suggestion-picker");
@ -1467,7 +1466,7 @@ InplaceEditor.prototype = {
* @return {Array} array of CSS property names (Strings)
*/
_getCSSPropertyList: function () {
return CSSPropertyList;
return this.cssProperties.getNames().sort();
},
/**
@ -1556,11 +1555,3 @@ function copyBoxModelStyles(from, to) {
function moveFocus(win, direction) {
return focusManager.moveFocus(win, null, direction, 0);
}
XPCOMUtils.defineLazyGetter(this, "CSSPropertyList", function () {
return domUtils.getCSSPropertyNames(domUtils.INCLUDE_ALIASES).sort();
});
XPCOMUtils.defineLazyGetter(this, "domUtils", function () {
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
});

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

@ -109,6 +109,15 @@ CssProperties.prototype = {
*/
getValues(property) {
return this.properties[property] ? this.properties[property].values : [];
},
/**
* Gets the CSS property names.
*
* @return {Array} An array of strings.
*/
getNames(property) {
return Object.keys(this.properties);
}
};