Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/aardvark.js

Issue 29361130: Issue 4588 - "View source" command doesn't show text nodes (Closed) Base URL: https://hg.adblockplus.org/elemhidehelper
Patch Set: Created Oct. 31, 2016, 9:39 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/aardvark.js
===================================================================
--- a/lib/aardvark.js
+++ b/lib/aardvark.js
@@ -733,39 +733,39 @@ let Aardvark = exports.Aardvark =
switch (node.nodeType)
{
case node.ELEMENT_NODE:
var box = this.window.document.createElement("vbox");
box.className = "elementBox";
var startTag = this.window.document.createElement("hbox");
startTag.className = "elementStartTag";
- if (!node.firstElementChild)
+ if (!node.firstChild)
startTag.className += " elementEndTag";
this.appendDescription(startTag, "<", null);
this.appendDescription(startTag, node.tagName, "tagName");
for (var i = 0; i < node.attributes.length; i++)
{
var attr = node.attributes[i];
this.appendDescription(startTag, attr.name, "attrName");
if (attr.value != "")
{
this.appendDescription(startTag, "=", null);
this.appendDescription(startTag, '"' + attr.value.replace(/"/, "&quot;") + '"', "attrValue");
}
}
- this.appendDescription(startTag, node.firstElementChild ? ">" : " />", null);
+ this.appendDescription(startTag, node.firstChild ? ">" : " />", null);
box.appendChild(startTag);
- if (node.firstElementChild)
+ if (node.firstChild)
{
- for (var child = node.firstElementChild; child; child = child.nextElementSibling)
+ for (var child = node.firstChild; child; child = child.nextSibling)
this.getOuterHtmlFormatted(child, box);
var endTag = this.window.document.createElement("hbox");
endTag.className = "elementEndTag";
this.appendDescription(endTag, "<", null);
this.appendDescription(endTag, "/" + node.tagName, "tagName");
this.appendDescription(endTag, ">", null);
box.appendChild(endTag);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld