commit d3c46899735d00e4f9cee43fd1af566add5c59d8
parent 1c087270e38ec983cf87b7166b7d185f0f5900da
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 27 Aug 2015 18:00:16 +0100
Add a couple comments
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/connector/translate_item.js b/chrome/content/zotero/xpcom/connector/translate_item.js
@@ -468,10 +468,13 @@ Zotero.Translate.ItemSaver.prototype = {
doc = (new DOMParser()).parseFromString(result, "text/html");
} catch(e) {}
- // If DOMParser fails, use document.implementation.createHTMLDocument
+ // If DOMParser fails, use document.implementation.createHTMLDocument,
+ // as documented at https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
if(!doc) {
doc = document.implementation.createHTMLDocument("");
var docEl = doc.documentElement;
+ // AMO reviewer: This code is not run in Firefox, and the document
+ // is never rendered anyway
docEl.innerHTML = result;
if(docEl.children.length === 1 && docEl.firstElementChild === "html") {
doc.replaceChild(docEl.firstElementChild, docEl);
diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js
@@ -233,6 +233,8 @@ Zotero.QuickCopy = new function() {
for (var i=0; i<notes.length; i++) {
var div = doc.createElement("div");
div.className = "zotero-note";
+ // AMO reviewer: This documented is never rendered (and the inserted markup
+ // is sanitized anyway)
div.insertAdjacentHTML('afterbegin', notes[i].getNote());
container.appendChild(div);
textContainer.appendChild(textDoc.importNode(div, true));