Bug 903453 - Make some CssLogic members explicitly public that we use elsewhere. r=jwalker

--HG--
extra : rebase_source : b05dce10120d7f7334389c8af32705351020618d
This commit is contained in:
Dave Camp 2013-08-07 09:47:45 -07:00
Родитель e1a4c3d6e7
Коммит 3dc6d04b23
4 изменённых файлов: 27 добавлений и 27 удалений

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

@ -901,7 +901,7 @@ SelectorView.prototype = {
{
let inspector = this.tree.styleInspector.inspector;
let contentDoc = inspector.selection.document;
let cssSheet = this.selectorInfo.selector._cssRule._cssSheet;
let cssSheet = this.selectorInfo.selector.cssRule._cssSheet;
let line = this.selectorInfo.ruleLine || 0;
let contentSheet = false;
let styleSheet;

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

@ -28,7 +28,7 @@ function runTests(doc) {
let selectorText = selectors[i];
let selector = new CssSelector(cssRule, selectorText, i);
let expected = getExpectedSpecificity(selectorText);
let specificity = DOMUtils.getSpecificity(selector._cssRule,
let specificity = DOMUtils.getSpecificity(selector.cssRule,
selector.selectorIndex)
is(specificity, expected,
'selector "' + selectorText + '" has a specificity of ' + expected);

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

@ -219,8 +219,8 @@ var PageStyleActor = protocol.ActorClass({
let matched = [];
let propInfo = this.cssLogic.getPropertyInfo(property);
for (let selectorInfo of propInfo.matchedSelectors) {
let cssRule = selectorInfo.selector._cssRule;
let domRule = cssRule.sourceElement || cssRule._domRule;
let cssRule = selectorInfo.selector.cssRule;
let domRule = cssRule.sourceElement || cssRule.domRule;
let rule = this._styleRef(domRule);
rules.add(rule);

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

@ -448,7 +448,7 @@ CssLogic.prototype = {
this._passId++;
this._matchedSelectors.forEach(function(aValue) {
aCallback.call(aScope, aValue[0], aValue[1]);
aValue[0]._cssRule._passId = this._passId;
aValue[0].cssRule._passId = this._passId;
}, this);
}
return;
@ -468,7 +468,7 @@ CssLogic.prototype = {
rule.selectors.forEach(function (aSelector) {
if (aSelector._matchId !== this._matchId &&
(aSelector.elementStyle ||
this.selectorMatchesElement(rule._domRule, aSelector.selectorIndex))) {
this.selectorMatchesElement(rule.domRule, aSelector.selectorIndex))) {
aSelector._matchId = this._matchId;
this._matchedSelectors.push([ aSelector, status ]);
@ -1030,7 +1030,7 @@ CssSheet.prototype = {
if (cacheId in this._rules) {
for (let i = 0, rulesLen = this._rules[cacheId].length; i < rulesLen; i++) {
rule = this._rules[cacheId][i];
if (rule._domRule === aDomRule) {
if (rule.domRule === aDomRule) {
ruleFound = true;
break;
}
@ -1134,7 +1134,7 @@ CssSheet.prototype = {
function CssRule(aCssSheet, aDomRule, aElement)
{
this._cssSheet = aCssSheet;
this._domRule = aDomRule;
this.domRule = aDomRule;
let parentRule = aDomRule.parentRule;
if (parentRule && parentRule.type == Ci.nsIDOMCSSRule.MEDIA_RULE) {
@ -1142,9 +1142,9 @@ function CssRule(aCssSheet, aDomRule, aElement)
}
if (this._cssSheet) {
// parse _domRule.selectorText on call to this.selectors
// parse domRule.selectorText on call to this.selectors
this._selectors = null;
this.line = domUtils.getRuleLine(this._domRule);
this.line = domUtils.getRuleLine(this.domRule);
this.source = this._cssSheet.shortSource + ":" + this.line;
if (this.mediaText) {
this.source += " @media " + this.mediaText;
@ -1202,7 +1202,7 @@ CssRule.prototype = {
*/
getPropertyValue: function(aProperty)
{
return this._domRule.style.getPropertyValue(aProperty);
return this.domRule.style.getPropertyValue(aProperty);
},
/**
@ -1214,7 +1214,7 @@ CssRule.prototype = {
*/
getPropertyPriority: function(aProperty)
{
return this._domRule.style.getPropertyPriority(aProperty);
return this.domRule.style.getPropertyPriority(aProperty);
},
/**
@ -1232,11 +1232,11 @@ CssRule.prototype = {
// Parse the CSSStyleRule.selectorText string.
this._selectors = [];
if (!this._domRule.selectorText) {
if (!this.domRule.selectorText) {
return this._selectors;
}
let selectors = CssLogic.getSelectors(this._domRule);
let selectors = CssLogic.getSelectors(this.domRule);
for (let i = 0, len = selectors.length; i < len; i++) {
this._selectors.push(new CssSelector(this, selectors[i], i));
@ -1247,7 +1247,7 @@ CssRule.prototype = {
toString: function CssRule_toString()
{
return "[CssRule " + this._domRule.selectorText + "]";
return "[CssRule " + this.domRule.selectorText + "]";
},
};
@ -1262,7 +1262,7 @@ CssRule.prototype = {
*/
function CssSelector(aCssRule, aSelector, aIndex)
{
this._cssRule = aCssRule;
this.cssRule = aCssRule;
this.text = aSelector;
this.elementStyle = this.text == "@element.style";
this._specificity = null;
@ -1282,7 +1282,7 @@ CssSelector.prototype = {
*/
get source()
{
return this._cssRule.source;
return this.cssRule.source;
},
/**
@ -1294,7 +1294,7 @@ CssSelector.prototype = {
*/
get sourceElement()
{
return this._cssRule.sourceElement;
return this.cssRule.sourceElement;
},
/**
@ -1305,7 +1305,7 @@ CssSelector.prototype = {
*/
get href()
{
return this._cssRule.href;
return this.cssRule.href;
},
/**
@ -1316,7 +1316,7 @@ CssSelector.prototype = {
*/
get contentRule()
{
return this._cssRule.contentRule;
return this.cssRule.contentRule;
},
/**
@ -1327,7 +1327,7 @@ CssSelector.prototype = {
*/
get sheetAllowed()
{
return this._cssRule.sheetAllowed;
return this.cssRule.sheetAllowed;
},
/**
@ -1338,7 +1338,7 @@ CssSelector.prototype = {
*/
get sheetIndex()
{
return this._cssRule.sheetIndex;
return this.cssRule.sheetIndex;
},
/**
@ -1349,7 +1349,7 @@ CssSelector.prototype = {
*/
get ruleLine()
{
return this._cssRule.line;
return this.cssRule.line;
},
/**
@ -1391,7 +1391,7 @@ CssSelector.prototype = {
return this._specificity;
}
this._specificity = domUtils.getSpecificity(this._cssRule._domRule,
this._specificity = domUtils.getSpecificity(this.cssRule.domRule,
this.selectorIndex);
return this._specificity;
@ -1534,7 +1534,7 @@ CssPropertyInfo.prototype = {
*/
_processMatchedSelector: function CssPropertyInfo_processMatchedSelector(aSelector, aStatus)
{
let cssRule = aSelector._cssRule;
let cssRule = aSelector.cssRule;
let value = cssRule.getPropertyValue(this.property);
if (value &&
(aStatus == CssLogic.STATUS.MATCHED ||
@ -1560,7 +1560,7 @@ CssPropertyInfo.prototype = {
let ruleCount = 0;
let iterator = function(aSelectorInfo) {
let cssRule = aSelectorInfo.selector._cssRule;
let cssRule = aSelectorInfo.selector.cssRule;
if (cssRule._passId != passId) {
if (cssRule.sheetAllowed) {
ruleCount++;
@ -1604,7 +1604,7 @@ function CssSelectorInfo(aSelector, aProperty, aValue, aStatus)
this.value = aValue;
this.status = aStatus;
let priority = this.selector._cssRule.getPropertyPriority(this.property);
let priority = this.selector.cssRule.getPropertyPriority(this.property);
this.important = (priority === "important");
}