blob: 1efce0f5e7808b52e5cc91e77e532e0968ea4e2b [file] [log] [blame]
var initialize_SyntaxHighlight = function() {
InspectorTest.dumpSyntaxHighlight = function(str, mimeType)
{
var node = document.createElement("span");
node.textContent = str;
var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(mimeType);
return javascriptSyntaxHighlighter.syntaxHighlightNode(node).then(dumpSyntax);
function dumpSyntax()
{
var node_parts = [];
for (var i = 0; i < node.childNodes.length; i++) {
if (node.childNodes[i].getAttribute) {
node_parts.push(node.childNodes[i].getAttribute("class"));
} else {
node_parts.push("*");
}
}
InspectorTest.addResult(str + ": " + node_parts.join(", "));
}
};
};