summaryrefslogtreecommitdiffstats
path: root/toolkit/components/reader/JSDOMParser.js
diff options
context:
space:
mode:
authorAscrod <32915892+Ascrod@users.noreply.github.com>2018-05-07 19:45:46 -0400
committerAscrod <32915892+Ascrod@users.noreply.github.com>2018-05-15 21:06:41 -0500
commitb70d884598e1e14b99190e1e5c349553ff59849b (patch)
treeb66af009469ec85d52bf2655afdf8e08dd881abb /toolkit/components/reader/JSDOMParser.js
parent000ac0cc833c415169ed7aa8c5e3493d0d4525fd (diff)
downloadUXP-b70d884598e1e14b99190e1e5c349553ff59849b.tar
UXP-b70d884598e1e14b99190e1e5c349553ff59849b.tar.gz
UXP-b70d884598e1e14b99190e1e5c349553ff59849b.tar.lz
UXP-b70d884598e1e14b99190e1e5c349553ff59849b.tar.xz
UXP-b70d884598e1e14b99190e1e5c349553ff59849b.zip
Initial updates for Reader View.
Diffstat (limited to 'toolkit/components/reader/JSDOMParser.js')
-rw-r--r--toolkit/components/reader/JSDOMParser.js46
1 files changed, 1 insertions, 45 deletions
diff --git a/toolkit/components/reader/JSDOMParser.js b/toolkit/components/reader/JSDOMParser.js
index 853649775..38f59c4ea 100644
--- a/toolkit/components/reader/JSDOMParser.js
+++ b/toolkit/components/reader/JSDOMParser.js
@@ -1017,46 +1017,6 @@
}
},
- readScript: function (node) {
- while (this.currentChar < this.html.length) {
- var c = this.nextChar();
- var nextC = this.peekNext();
- if (c === "<") {
- if (nextC === "!" || nextC === "?") {
- // We're still before the ! or ? that is starting this comment:
- this.currentChar++;
- node.appendChild(this.discardNextComment());
- continue;
- }
- if (nextC === "/" && this.html.substr(this.currentChar, 8 /*"/script>".length */).toLowerCase() == "/script>") {
- // Go back before the '<' so we find the end tag.
- this.currentChar--;
- // Done with this script tag, the caller will close:
- return;
- }
- }
- // Either c wasn't a '<' or it was but we couldn't find either a comment
- // or a closing script tag, so we should just parse as text until the next one
- // comes along:
-
- var haveTextNode = node.lastChild && node.lastChild.nodeType === Node.TEXT_NODE;
- var textNode = haveTextNode ? node.lastChild : new Text();
- var n = this.html.indexOf("<", this.currentChar);
- // Decrement this to include the current character *afterwards* so we don't get stuck
- // looking for the same < all the time.
- this.currentChar--;
- if (n === -1) {
- textNode.innerHTML += this.html.substring(this.currentChar, this.html.length);
- this.currentChar = this.html.length;
- } else {
- textNode.innerHTML += this.html.substring(this.currentChar, n);
- this.currentChar = n;
- }
- if (!haveTextNode)
- node.appendChild(textNode);
- }
- },
-
discardNextComment: function() {
if (this.match("--")) {
this.discardTo("-->");
@@ -1131,11 +1091,7 @@
// If this isn't a void Element, read its child nodes
if (!closed) {
- if (localName == "script") {
- this.readScript(node);
- } else {
- this.readChildren(node);
- }
+ this.readChildren(node);
var closingTag = "</" + localName + ">";
if (!this.match(closingTag)) {
this.error("expected '" + closingTag + "' and got " + this.html.substr(this.currentChar, closingTag.length));