Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-4 / styles-source-offsets.html
blob1cb6012476ed212f98df376d6598e5cdf99784dd
1 <html>
2 <head>
4 <link rel="stylesheet" href="../styles/resources/styles-source-offsets.css">
6 <script src="../../../http/tests/inspector/inspector-test.js"></script>
7 <script src="../../../http/tests/inspector/elements-test.js"></script>
8 <script>
10 function test()
12 function dumpStyleData(ruleOrStyle)
14 var isRule = !!(ruleOrStyle.style);
15 var style;
16 var header = "";
17 if (isRule) {
18 if (ruleOrStyle.origin !== "regular")
19 return;
20 style = ruleOrStyle.style;
21 var selectorRanges = [];
22 var selectors = ruleOrStyle.selectorList.selectors;
23 var firstRange = selectors[0].range;
24 var lastRange = selectors[selectors.length - 1].range;
25 var range = { startLine: firstRange.startLine, startColumn: firstRange.startColumn, endLine: lastRange.endLine, endColumn: lastRange.endColumn };
26 header = ruleOrStyle.selectorList.text + ": " + (range ? InspectorTest.rangeText(range) : "");
27 } else {
28 style = ruleOrStyle;
29 header = "element.style:";
31 InspectorTest.addResult(header + " " + InspectorTest.rangeText(style.range));
32 var allProperties = style.cssProperties;
33 for (var i = 0; i < allProperties.length; ++i) {
34 var property = allProperties[i];
35 if (!property.range)
36 continue;
37 InspectorTest.addResult("['" + property.name + "':'" + property.value + "'" + (property.important ? " !important" : "") + (("parsedOk" in property) ? " non-parsed" : "") +"] @" + InspectorTest.rangeText(property.range));
41 InspectorTest.selectNodeWithId("mainBody", step1);
43 function step1(node)
45 InspectorTest.CSSAgent.getMatchedStylesForNode(node.id, onMatchedStyles)
48 function onMatchedStyles(error, inlineStyle, attributeStyle, matchedCSSRules)
50 for (var i = 0; i < matchedCSSRules.length; ++i)
51 dumpStyleData(matchedCSSRules[i].rule);
52 dumpStyleData(inlineStyle);
53 InspectorTest.completeTest();
57 </script>
59 <style>
61 body.mainpage {
62 text-decoration: none; /* at least one valid property is necessary for WebCore to match a rule */
63 badproperty: 1badvalue1;
66 </style>
67 </head>
69 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-weight: normal; width: 80%">
70 <p>
71 Tests that proper data and start/end offset positions are reported for CSS style declarations and properties.
72 </p>
74 </body>
75 </html>