Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: Source/core/xml/XMLViewer.js

Issue 23604028: [XML Viewer crash] Store the reference of pretty-print div as tree to be used during the processing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/xmlviewer/dumpAsText/xmlviewer-root-element-id-tree-appearing-blank-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « LayoutTests/http/tests/xmlviewer/dumpAsText/xmlviewer-root-element-id-tree-appearing-blank-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698