Index: Source/core/xml/XMLViewer.js |
diff --git a/Source/core/xml/XMLViewer.js b/Source/core/xml/XMLViewer.js |
index 049779b6343ac95fb67cf46841e624cd1b4461d8..25a39ef811f1520f82c37204cf40d2938c4d848b 100644 |
--- a/Source/core/xml/XMLViewer.js |
+++ b/Source/core/xml/XMLViewer.js |
@@ -30,6 +30,8 @@ var nodeParentPairs = []; |
// Script entry point. |
+var tree; |
+ |
function prepareWebKitXMLViewer(noStyleMessage) |
{ |
var html = createHTMLElement('html'); |
@@ -60,10 +62,9 @@ function prepareWebKitXMLViewer(noStyleMessage) |
headerSpan.textContent = noStyleMessage; |
header.appendChild(createHTMLElement('br')); |
- var tree = createHTMLElement('div'); |
+ tree = createHTMLElement('div'); |
body.appendChild(tree); |
tree.classList.add('pretty-print'); |
- tree.id = 'tree'; |
window.onload = sourceXMLLoaded; |
} |
@@ -72,10 +73,9 @@ function sourceXMLLoaded() |
var sourceXML = document.getElementById('webkit-xml-viewer-source-xml'); |
if (!sourceXML) |
return; // Stop if some XML tree extension is already processing this document |
- var root = document.getElementById('tree'); |
for (var child = sourceXML.firstChild; child; child = child.nextSibling) |
- nodeParentPairs.push({parentElement: root, node: child}); |
+ nodeParentPairs.push({parentElement: tree, node: child}); |
for (var i = 0; i < nodeParentPairs.length; i++) |
processNode(nodeParentPairs[i].parentElement, nodeParentPairs[i].node); |