Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / syntax-highlight.js
blob1efce0f5e7808b52e5cc91e77e532e0968ea4e2b
1 var initialize_SyntaxHighlight = function() {
3 InspectorTest.dumpSyntaxHighlight = function(str, mimeType)
5     var node = document.createElement("span");
6     node.textContent = str;
7     var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(mimeType);
8     return javascriptSyntaxHighlighter.syntaxHighlightNode(node).then(dumpSyntax);
10     function dumpSyntax()
11     {
12         var node_parts = [];
13         for (var i = 0; i < node.childNodes.length; i++) {
14             if (node.childNodes[i].getAttribute) {
15                 node_parts.push(node.childNodes[i].getAttribute("class"));
16             } else {
17                 node_parts.push("*");
18             }
19         }
20         InspectorTest.addResult(str + ": " + node_parts.join(", "));
21     }