1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Pass null to optional doctype in creating document clone

This commit is contained in:
fchasen 2014-09-18 23:40:06 -04:00
parent 7e4f57882f
commit 519c0f26d3
14 changed files with 25 additions and 22 deletions

File diff suppressed because one or more lines are too long

View file

@ -3622,13 +3622,13 @@ EPUBJS.Chapter.prototype.unload = function(store){
EPUBJS.Chapter.prototype.setDocument = function(_document){
var uri = _document.namespaceURI;
// var doctype = _document.doctype;
var doctype = _document.doctype;
// Creates an empty document
this.document = _document.implementation.createDocument(
uri,
null,
_document.doctype
null
);
this.contents = this.document.importNode(
_document.documentElement, //node to import
@ -3656,6 +3656,7 @@ EPUBJS.Chapter.prototype.cfiFromRange = function(_range) {
startXpath = EPUBJS.core.getElementXPath(_range.startContainer);
// console.log(startContainer)
endXpath = EPUBJS.core.getElementXPath(_range.endContainer);
startContainer = this.document.evaluate(startXpath, this.document, EPUBJS.core.nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if(!_range.collapsed) {

File diff suppressed because one or more lines are too long