commit cd6d528519b888d96ee1da322321098d7271a347
parent 0e2cf3146f3e6598f022b7b9550f261d2a1f4fee
Author: Simon Kornblith <simon@simonster.com>
Date: Sat, 4 Aug 2012 19:37:54 -0400
Be more resilient when IE DOMParser fails
Fixes JSTOR in IE
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js
@@ -970,6 +970,10 @@ Zotero.Utilities = {
var rootDoc = element.ownerDocument;
} else if(element.documentElement) {
var rootDoc = element;
+ } else if(Zotero.isIE && element.documentElement === null) {
+ // IE: documentElement may be null if there is a parse error. In this
+ // case, we don't match anything to mimic what would happen with DOMParser
+ continue;
} else {
throw new Error("First argument must be either element(s) or document(s) in Zotero.Utilities.xpath(elements, '"+xpath+"')");
}