Chromium Code Reviews| Index: Source/core/xml/XMLViewer.js |
| diff --git a/Source/core/xml/XMLViewer.js b/Source/core/xml/XMLViewer.js |
| index 049779b6343ac95fb67cf46841e624cd1b4461d8..afb79b6c0a35ff1f1505e3d0e8f40a0948645492 100644 |
| --- a/Source/core/xml/XMLViewer.js |
| +++ b/Source/core/xml/XMLViewer.js |
| @@ -72,6 +72,11 @@ 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 |
| + |
| + // Momentarily detach the sourceXML from the DOM in order to not clash with |
| + // any elements in the source XML having id="tree" attribute. |
| + sourceXML.parentNode.removeChild(sourceXML); |
| + |
| var root = document.getElementById('tree'); |
|
abarth-chromium
2013/09/04 02:02:40
Why not save off the |tree| reference instead of c
|
| for (var child = sourceXML.firstChild; child; child = child.nextSibling) |
| @@ -83,6 +88,9 @@ function sourceXMLLoaded() |
| drawArrows(); |
| initButtons(); |
| + // Processing of the XML document is complete. Now attach the sourceXML back into the body |
| + document.body.appendChild(sourceXML); |
| + |
| if (typeof(onAfterWebkitXMLViewerLoaded) == 'function') |
| onAfterWebkitXMLViewerLoaded(); |
| } |