| <html> |
| <head> |
| <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../../http/tests/inspector/elements-test.js"></script> |
| <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| <link rel="stylesheet" href="../styles/resources/empty-background-url.css"> |
| <style> |
| #inspected { |
| color: blue; |
| } |
| </style> |
| <style>#inspected { margin: 10px; } |
| #inspected { |
| font-family: arial; |
| /* font-size: 20px; */ |
| } |
| /*# sourceURL=source-url.css */ |
| </style> |
| <script> |
| function test() |
| { |
| InspectorTest.waitForScriptSource("source-url.css", onUISourceCodeCreated); |
| |
| function onUISourceCodeCreated() |
| { |
| InspectorTest.nodeWithId("inspected", onNodeFound); |
| } |
| |
| function onNodeFound(node) |
| { |
| InspectorTest.cssModel.matchedStylesPromise(node.id).then(onMatchedStyles); |
| } |
| |
| function onMatchedStyles(matchedResult) |
| { |
| var styles = matchedResult.nodeStyles(); |
| for (var style of styles) { |
| if (style.type !== SDK.CSSStyleDeclaration.Type.Regular) |
| continue; |
| var properties = style.allProperties(); |
| for (var property of properties) { |
| if (!property.range) |
| continue; |
| var uiLocation = Bindings.cssWorkspaceBinding.propertyUILocation(property, true); |
| InspectorTest.addResult(String.sprintf("%s -> %s:%d:%d", property.name, uiLocation.uiSourceCode.name(), uiLocation.lineNumber, uiLocation.columnNumber)); |
| var uiLocation = Bindings.cssWorkspaceBinding.propertyUILocation(property, false); |
| InspectorTest.addResult(String.sprintf("%s -> %s:%d:%d", property.value, uiLocation.uiSourceCode.name(), uiLocation.lineNumber, uiLocation.columnNumber)); |
| } |
| } |
| InspectorTest.completeTest(); |
| } |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Verifies Bindings.cssWorkspaceBinding.propertyUILocation functionality</p> |
| <div id="inspected"></div> |
| </body> |
| </html> |