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

Unified Diff: third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables.html

Issue 1521323002: Show custom properties in the computed style pane of the inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables.html
diff --git a/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables.html b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables.html
new file mode 100644
index 0000000000000000000000000000000000000000..9fd1b1c48bf3285e7957ec3993c692e2acb7a4cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/elements/styles-3/styles-variables.html
@@ -0,0 +1,61 @@
+<html>
+<head>
+<style>
+body {
+ --a: red;
+}
+
+#id1 {
+ --b: 44px;
+}
+
+#id2 {
+ --a: green;
+}
+
+</style>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/elements-test.js"></script>
+<script>
+
+function test()
+{
+ InspectorTest.selectNodeAndWaitForStylesWithComputed("id1", step1);
+ function step1(node)
+ {
+ InspectorTest.addResult("==== Computed style for ID1 ====");
+ InspectorTest.dumpSelectedElementStyles(false, true);
+ InspectorTest.cssModel.computedStylePromise(node.id).then(
+ function(style) {
+ InspectorTest.addResult("value of --a: " + style.get("--a"));
+ InspectorTest.selectNodeAndWaitForStylesWithComputed("id2", step2);
+ });
+ }
+
+ function step2(node)
+ {
+ InspectorTest.addResult("==== Computed style for ID2 ====");
+ InspectorTest.dumpSelectedElementStyles(false, true);
+ InspectorTest.cssModel.computedStylePromise(node.id).then(
+ function(style) {
+ InspectorTest.addResult("value of --b: " + style.get("--b"));
+ InspectorTest.completeTest();
+ });
+ }
+
+}
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that computed styles expand and allow tracing to style rules.
+</p>
+
+<div id="id1">
+<div id="id2">
+</div>
+</div>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698