Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary call of canvas.remove() (which breaks IE compatibility) #2

Open
lutzhelm opened this issue Jun 26, 2018 · 0 comments
Open

Comments

@lutzhelm
Copy link
Contributor

The call of canvas.remove() in pdfDoc.prototype.reencodeImg breaks the Internet Explorer compatibility - element.remove() is not supported.

I think that it is not even necessary to call it at this point because the element has not been appended anywhere yet and is only held by a local variable, so it should be taken care of by any browser garbage collection mechanism. The Spec states that remove() doesn't even do anything if the calling element has no parent:
https://dom.spec.whatwg.org/#dom-childnode-remove

If you want to be on the save side, you can still use the following workaround:

if (canvas.parentNode != null) {
  canvas.parentNode.removeChild(canvas);
}

But I'm sure it will never be called.

lutzhelm added a commit to lutzhelm/iiif2pdf that referenced this issue Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant