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

Unified Diff: LayoutTests/inspector-protocol/css/css-protocol-test.js

Issue 441873010: DevTools: [SSP] Implement adding new rule in user stylesheet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix compilation error Created 6 years, 4 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: LayoutTests/inspector-protocol/css/css-protocol-test.js
diff --git a/LayoutTests/inspector-protocol/css/css-protocol-test.js b/LayoutTests/inspector-protocol/css/css-protocol-test.js
index f51624dfaa0be388f5b3027d0bb078cc15224a39..de8d5dd44b749af8d62a6a57613698a3f2399537 100644
--- a/LayoutTests/inspector-protocol/css/css-protocol-test.js
+++ b/LayoutTests/inspector-protocol/css/css-protocol-test.js
@@ -39,6 +39,7 @@ function updateStyleSheetRange(command, styleSheetId, expectError, options, call
InspectorTest.setPropertyText = updateStyleSheetRange.bind(null, "CSS.setPropertyText");
InspectorTest.setRuleSelector = updateStyleSheetRange.bind(null, "CSS.setRuleSelector");
+InspectorTest.addRule = updateStyleSheetRange.bind(null, "CSS.addRule");
InspectorTest.requestMainFrameId = function(callback)
{
@@ -85,6 +86,15 @@ InspectorTest.dumpRuleMatch = function(ruleMatch)
var rule = ruleMatch.rule;
var matchingSelectors = ruleMatch.matchingSelectors;
+ var media = rule.media || [];
+ var mediaLine = "";
+ for (var i = 0; i < media.length; ++i)
+ mediaLine += (i > 0 ? " " : "") + media[i].text;
+ var baseIndent = 0;
+ if (mediaLine.length) {
+ log(baseIndent, "@media " + mediaLine);
+ baseIndent += 4;
+ }
var selectorLine = "";
var selectors = rule.selectorList.selectors;
for (var i = 0; i < selectors.length; ++i) {
@@ -99,15 +109,15 @@ InspectorTest.dumpRuleMatch = function(ruleMatch)
}
selectorLine += " {";
selectorLine += " " + rule.origin;
- log(0, selectorLine);
+ log(baseIndent, selectorLine);
var style = rule.style;
var cssProperties = style.cssProperties;
for (var i = 0; i < cssProperties.length; ++i) {
var cssProperty = cssProperties[i];
var propertyLine = cssProperty.name + ": " + cssProperty.value + ";";
- log(4, propertyLine);
+ log(baseIndent + 4, propertyLine);
}
- log(0, "}");
+ log(baseIndent, "}");
};
InspectorTest.displayName = function(url)

Powered by Google App Engine
This is Rietveld 408576698