Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-2 / property-ui-location.html
blob88f2d56aa0afc25ea1a16db0bc1e9e99d0acd2e1
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <link rel="stylesheet" href="../styles/resources/empty-background-url.css">
7 <style>
8 #inspected {
9 color: blue;
11 </style>
12 <style>#inspected { margin: 10px; }
13 #inspected {
14 font-family: arial;
16 /*# sourceURL=source-url.css */
17 </style>
18 <script>
19 function test()
21 InspectorTest.waitForScriptSource("source-url.css", onUISourceCodeCreated);
23 function onUISourceCodeCreated()
25 InspectorTest.nodeWithId("inspected", onNodeFound);
28 function onNodeFound(node)
30 InspectorTest.cssModel.matchedStylesPromise(node.id, true, false).then(onMatchedStyles);
33 function onMatchedStyles(styles)
35 var rules = styles.matchedCSSRules;
36 for (var rule of rules) {
37 var properties = rule.style.allProperties;
38 for (var property of properties) {
39 if (!property.range)
40 continue;
41 var uiLocation = WebInspector.cssWorkspaceBinding.propertyUILocation(property, true);
42 InspectorTest.addResult(String.sprintf("%s -> %s:%d:%d", property.text, uiLocation.uiSourceCode.name(), uiLocation.lineNumber, uiLocation.columnNumber));
45 InspectorTest.completeTest();
48 </script>
49 </head>
50 <body onload="runTest()">
51 <p>Verifies WebInspector.cssWorkspaceBinding.propertyUILocation functionality</p>
52 <div id="inspected"></div>
53 </body>
54 </html>