Skip to content

Commit

Permalink
DevTools: [CSS] rename WI.CSSStyleModel.MatchedStyleResult into WI.CS…
Browse files Browse the repository at this point in the history
…SMatchedStyles

The patch renames WI.CSSStyleModel.MatchedStyleResult into WI.CSSMatchedStyles
and puts it into its own file.

BUG=none
R=dgozman, pfeldman

Review URL: https://codereview.chromium.org/1756363002

Cr-Commit-Position: refs/heads/master@{#378887}
  • Loading branch information
aslushnikov authored and Commit bot committed Mar 3, 2016
1 parent 086e9bf commit c3959d8
Show file tree
Hide file tree
Showing 7 changed files with 470 additions and 466 deletions.
1 change: 1 addition & 0 deletions devtools.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
'front_end/sdk/CookieParser.js',
'front_end/sdk/CPUProfileDataModel.js',
'front_end/sdk/CPUProfilerModel.js',
'front_end/sdk/CSSMatchedStyles.js',
'front_end/sdk/CSSMedia.js',
'front_end/sdk/CSSMetadata.js',
'front_end/sdk/CSSParser.js',
Expand Down
2 changes: 1 addition & 1 deletion front_end/audits/AuditRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
var targetResult = {};

/**
* @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyleResult
* @param {?WebInspector.CSSMatchedStyles} matchedStyleResult
*/
function matchedCallback(matchedStyleResult)
{
Expand Down
10 changes: 5 additions & 5 deletions front_end/elements/ComputedStyleWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ WebInspector.ComputedStyleWidget.prototype = {

/**
* @param {?WebInspector.SharedSidebarModel.ComputedStyle} nodeStyle
* @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {?WebInspector.CSSMatchedStyles} matchedStyles
*/
_innerRebuildUpdate: function(nodeStyle, matchedStyles)
{
Expand Down Expand Up @@ -241,7 +241,7 @@ WebInspector.ComputedStyleWidget.prototype = {

/**
* @param {!WebInspector.CSSStyleModel} cssModel
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @param {!WebInspector.DOMNode} node
* @param {!TreeElement} rootTreeElement
* @param {!Array<!WebInspector.CSSProperty>} tracedProperties
Expand All @@ -253,7 +253,7 @@ WebInspector.ComputedStyleWidget.prototype = {
for (var property of tracedProperties) {
var trace = createElement("div");
trace.classList.add("property-trace");
if (matchedStyles.propertyState(property) === WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded)
if (matchedStyles.propertyState(property) === WebInspector.CSSMatchedStyles.PropertyState.Overloaded)
trace.classList.add("property-trace-inactive");
else
activeProperty = property;
Expand Down Expand Up @@ -289,7 +289,7 @@ WebInspector.ComputedStyleWidget.prototype = {
},

/**
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @return {!Map<string, !Array<!WebInspector.CSSProperty>>}
*/
_computePropertyTraces: function(matchedStyles)
Expand All @@ -309,7 +309,7 @@ WebInspector.ComputedStyleWidget.prototype = {
},

/**
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @return {!Set<string>}
*/
_computeInheritedProperties: function(matchedStyles)
Expand Down
30 changes: 15 additions & 15 deletions front_end/elements/StylesSidebarPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,20 @@ WebInspector.StylesSidebarPane.prototype = {
},

/**
* @return {!Promise.<?WebInspector.CSSStyleModel.MatchedStyleResult>}
* @return {!Promise.<?WebInspector.CSSMatchedStyles>}
*/
fetchMatchedCascade: function()
{
var node = this.node();
if (!node)
return Promise.resolve(/** @type {?WebInspector.CSSStyleModel.MatchedStyleResult} */(null));
return Promise.resolve(/** @type {?WebInspector.CSSMatchedStyles} */(null));
if (!this._matchedCascadePromise)
this._matchedCascadePromise = this._matchedStylesForNode(node).then(validateStyles.bind(this));
return this._matchedCascadePromise;

/**
* @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @return {?WebInspector.CSSStyleModel.MatchedStyleResult}
* @param {?WebInspector.CSSMatchedStyles} matchedStyles
* @return {?WebInspector.CSSMatchedStyles}
* @this {WebInspector.StylesSidebarPane}
*/
function validateStyles(matchedStyles)
Expand All @@ -271,13 +271,13 @@ WebInspector.StylesSidebarPane.prototype = {

/**
* @param {!WebInspector.DOMNode} node
* @return {!Promise.<?WebInspector.CSSStyleModel.MatchedStyleResult>}
* @return {!Promise.<?WebInspector.CSSMatchedStyles>}
*/
_matchedStylesForNode: function(node)
{
var cssModel = this.cssModel();
if (!cssModel)
return Promise.resolve(/** @type {?WebInspector.CSSStyleModel.MatchedStyleResult} */(null));
return Promise.resolve(/** @type {?WebInspector.CSSMatchedStyles} */(null));
return cssModel.matchedStylesPromise(node.id)
},

Expand Down Expand Up @@ -348,7 +348,7 @@ WebInspector.StylesSidebarPane.prototype = {
},

/**
* @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {?WebInspector.CSSMatchedStyles} matchedStyles
*/
_innerRebuildUpdate: function(matchedStyles)
{
Expand Down Expand Up @@ -411,7 +411,7 @@ WebInspector.StylesSidebarPane.prototype = {
},

/**
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @return {!Array.<!WebInspector.SectionBlock>}
*/
_rebuildSectionsForMatchedStyleRules: function(matchedStyles)
Expand Down Expand Up @@ -721,7 +721,7 @@ WebInspector.SectionBlock.prototype = {
/**
* @constructor
* @param {!WebInspector.StylesSidebarPane} parentPane
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @param {!WebInspector.CSSStyleDeclaration} style
*/
WebInspector.StylePropertiesSection = function(parentPane, matchedStyles, style)
Expand Down Expand Up @@ -1143,7 +1143,7 @@ WebInspector.StylePropertiesSection.prototype = {
*/
_isPropertyOverloaded: function(property)
{
return this._matchedStyles.propertyState(property) === WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded;
return this._matchedStyles.propertyState(property) === WebInspector.CSSMatchedStyles.PropertyState.Overloaded;
},

/**
Expand Down Expand Up @@ -1569,7 +1569,7 @@ WebInspector.StylePropertiesSection.prototype = {
}

/**
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @param {!WebInspector.Linkifier} linkifier
* @param {?WebInspector.CSSRule} rule
* @return {!Node}
Expand Down Expand Up @@ -1628,7 +1628,7 @@ WebInspector.StylePropertiesSection._linkifyRuleLocation = function(cssModel, li
* @constructor
* @extends {WebInspector.StylePropertiesSection}
* @param {!WebInspector.StylesSidebarPane} stylesPane
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @param {string} defaultSelectorText
* @param {string} styleSheetId
* @param {!WebInspector.TextRange} ruleLocation
Expand Down Expand Up @@ -1769,7 +1769,7 @@ WebInspector.BlankStylePropertiesSection.prototype = {
* @constructor
* @extends {WebInspector.StylePropertiesSection}
* @param {!WebInspector.StylesSidebarPane} stylesPane
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @param {!WebInspector.CSSStyleDeclaration} style
*/
WebInspector.KeyframePropertiesSection = function(stylesPane, matchedStyles, style)
Expand Down Expand Up @@ -1864,7 +1864,7 @@ WebInspector.KeyframePropertiesSection.prototype = {
* @constructor
* @extends {TreeElement}
* @param {!WebInspector.StylesSidebarPane} stylesPane
* @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
* @param {!WebInspector.CSSMatchedStyles} matchedStyles
* @param {!WebInspector.CSSProperty} property
* @param {boolean} isShorthand
* @param {boolean} inherited
Expand Down Expand Up @@ -2150,7 +2150,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
var section = this.section();
if (section) {
inherited = section.isPropertyInherited(name);
overloaded = this._matchedStyles.propertyState(longhandProperties[i]) === WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded;
overloaded = this._matchedStyles.propertyState(longhandProperties[i]) === WebInspector.CSSMatchedStyles.PropertyState.Overloaded;
}

var item = new WebInspector.StylePropertyTreeElement(this._parentPane, this._matchedStyles, longhandProperties[i], false, inherited, overloaded);
Expand Down
Loading

0 comments on commit c3959d8

Please sign in to comment.