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

Unified Diff: Source/devtools/front_end/audits/AuditRules.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
Index: Source/devtools/front_end/audits/AuditRules.js
diff --git a/Source/devtools/front_end/audits/AuditRules.js b/Source/devtools/front_end/audits/AuditRules.js
index 2d92316effac8da9201e0876a6ed3b6ed4b7f323..bf7067cce18e7290a3aedcffde3083034354b476 100644
--- a/Source/devtools/front_end/audits/AuditRules.js
+++ b/Source/devtools/front_end/audits/AuditRules.js
@@ -941,23 +941,15 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
var targetResult = {};
/**
- * @param {?WebInspector.CSSStyleModel.InlineStyleResult} inlineStyleResult
- */
- function inlineCallback(inlineStyleResult)
- {
- if (!inlineStyleResult)
- return;
- targetResult.inlineStyle = inlineStyleResult.inlineStyle;
- targetResult.attributesStyle = inlineStyleResult.attributesStyle;
- }
-
- /**
* @param {?WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyleResult
*/
function matchedCallback(matchedStyleResult)
{
- if (matchedStyleResult)
- targetResult.matchedCSSRules = matchedStyleResult.matchedCSSRules;
+ if (!matchedStyleResult)
+ return;
+ targetResult.matchedCSSRules = matchedStyleResult.matchedCSSRules;
+ targetResult.inlineStyle = matchedStyleResult.inlineStyle;
+ targetResult.attributesStyle = matchedStyleResult.attributesStyle;
}
/**
@@ -975,7 +967,6 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
for (var i = 0; nodeIds && i < nodeIds.length; ++i) {
var stylePromises = [
cssModel.matchedStylesPromise(nodeIds[i]).then(matchedCallback),
- cssModel.inlineStylesPromise(nodeIds[i]).then(inlineCallback),
cssModel.computedStylePromise(nodeIds[i]).then(computedCallback)
];
var nodePromise = Promise.all(stylePromises).then(imageStylesReady.bind(null, nodeIds[i], targetResult));
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/devtools/front_end/elements/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698