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

Removed 3rd argument of document.implementation.createDocument for iOS

This commit is contained in:
Fred Chasen 2014-07-25 09:05:45 -04:00
parent 1af6322367
commit 5700a10b54
9 changed files with 45 additions and 25 deletions

File diff suppressed because one or more lines are too long

15
reader/js/epub.min.js vendored
View file

@ -3540,6 +3540,7 @@ EPUBJS.Chapter.prototype.load = function(_store){
promise.then(function(xml){
this.setDocument(xml);
this.deferred.resolve(this);
}.bind(this));
return promise;
@ -3600,17 +3601,21 @@ EPUBJS.Chapter.prototype.unload = function(store){
};
EPUBJS.Chapter.prototype.setDocument = function(_document){
var uri = _document.namespaceURI;
// var doctype = _document.doctype;
// Creates an empty document
this.document = _document.implementation.createDocument(
_document.namespaceURI, //namespace to use
null, //empty document
_document.doctype //doctype (null for XML)
uri,
null
);
this.contents = this.document.importNode(
_document.documentElement, //node to import
true //clone its descendants
);
this.document.appendChild(this.contents);
this.deferred.resolve(this.contents);
// this.deferred.resolve(this.contents);
};
EPUBJS.Chapter.prototype.cfiFromRange = function(_range) {
@ -3727,7 +3732,7 @@ EPUBJS.Chapter.prototype.find = function(_query){
EPUBJS.Chapter.prototype.textSprint = function(root, func) {
var treeWalker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
acceptNode: function (node) {
if ( ! /^\s*$/.test(node.data) ) {
if (node.data && ! /^\s*$/.test(node.data) ) {
return NodeFilter.FILTER_ACCEPT;
} else {
return NodeFilter.FILTER_REJECT;