Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1559)

Unified Diff: Source/devtools/front_end/sdk/CSSStyleModel.js

Issue 1350183004: DevTools: CSS.getMatchedStylesForNode protocol command to return inline styles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/CSSStyleModel.js
diff --git a/Source/devtools/front_end/sdk/CSSStyleModel.js b/Source/devtools/front_end/sdk/CSSStyleModel.js
index 7eb8d379b63ff3a946c2895ff33e117c4ed80c97..ffcf1a7567af2e1bf2b2fc730f8e53427022e50a 100644
--- a/Source/devtools/front_end/sdk/CSSStyleModel.js
+++ b/Source/devtools/front_end/sdk/CSSStyleModel.js
@@ -127,17 +127,22 @@ WebInspector.CSSStyleModel.prototype = {
{
/**
* @param {?Protocol.Error} error
+ * @param {?CSSAgent.CSSStyle=} inlinePayload
+ * @param {?CSSAgent.CSSStyle=} attributesPayload
* @param {!Array.<!CSSAgent.RuleMatch>=} matchedPayload
* @param {!Array.<!CSSAgent.PseudoIdMatches>=} pseudoPayload
* @param {!Array.<!CSSAgent.InheritedStyleEntry>=} inheritedPayload
* @return {?WebInspector.CSSStyleModel.MatchedStyleResult}
* @this {WebInspector.CSSStyleModel}
*/
- function callback(error, matchedPayload, pseudoPayload, inheritedPayload)
+ function callback(error, inlinePayload, attributesPayload, matchedPayload, pseudoPayload, inheritedPayload)
{
if (error)
return null;
+ var inlineStyle = inlinePayload ? WebInspector.CSSStyleDeclaration.parsePayload(this, inlinePayload) : null;
+ var attributesStyle = attributesPayload ? WebInspector.CSSStyleDeclaration.parsePayload(this, attributesPayload) : null;
+
var matchedRules = WebInspector.CSSStyleModel.parseRuleMatchArrayPayload(this, matchedPayload);
var pseudoElements = [];
@@ -152,12 +157,12 @@ WebInspector.CSSStyleModel.prototype = {
if (inheritedPayload) {
for (var i = 0; i < inheritedPayload.length; ++i) {
var entryPayload = inheritedPayload[i];
- var inlineStyle = entryPayload.inlineStyle ? WebInspector.CSSStyleDeclaration.parsePayload(this, entryPayload.inlineStyle) : null;
- var matchedCSSRules = entryPayload.matchedCSSRules ? WebInspector.CSSStyleModel.parseRuleMatchArrayPayload(this, entryPayload.matchedCSSRules) : null;
- inherited.push(new WebInspector.CSSStyleModel.InheritedMatches(inlineStyle, matchedCSSRules));
+ var inheritedInlineStyle = entryPayload.inlineStyle ? WebInspector.CSSStyleDeclaration.parsePayload(this, entryPayload.inlineStyle) : null;
+ var inheritedMatchedCSSRules = entryPayload.matchedCSSRules ? WebInspector.CSSStyleModel.parseRuleMatchArrayPayload(this, entryPayload.matchedCSSRules) : null;
+ inherited.push(new WebInspector.CSSStyleModel.InheritedMatches(inheritedInlineStyle, inheritedMatchedCSSRules));
}
}
- return new WebInspector.CSSStyleModel.MatchedStyleResult(matchedRules, inherited, pseudoElements);
+ return new WebInspector.CSSStyleModel.MatchedStyleResult(inlineStyle, attributesStyle, matchedRules, inherited, pseudoElements);
}
return this._agent.getMatchedStylesForNode(nodeId, callback.bind(this));
@@ -1972,12 +1977,16 @@ WebInspector.CSSStyleModel.fromNode = function(node)
/**
* @constructor
+ * @param {?WebInspector.CSSStyleDeclaration} inlineStyle
+ * @param {?WebInspector.CSSStyleDeclaration} attributesStyle
* @param {?Array.<!WebInspector.CSSRule>} matchedRules
* @param {?Array.<!WebInspector.CSSStyleModel.InheritedMatches>} inherited
* @param {?Array.<!WebInspector.CSSStyleModel.PseudoElementMatches>} pseudoElements
*/
-WebInspector.CSSStyleModel.MatchedStyleResult = function(matchedRules, inherited, pseudoElements)
+WebInspector.CSSStyleModel.MatchedStyleResult = function(inlineStyle, attributesStyle, matchedRules, inherited, pseudoElements)
{
+ this.inlineStyle = inlineStyle;
+ this.attributesStyle = attributesStyle;
this.matchedCSSRules = matchedRules;
this.inherited = inherited;
this.pseudoElements = pseudoElements;
« no previous file with comments | « Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698