1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 23:58:07 +02:00

Enable the mozilla/avoid-removeChild ESLint rule globally

This rule is available from https://www.npmjs.com/package/eslint-plugin-mozilla, and is enforced in mozilla-central. Note that we have a polyfill for `ChildNode.remove()` and that most cases have already been fixed, see PRs 8056 and 8138.
This commit is contained in:
Jonas Jenwald 2018-02-10 16:19:45 +01:00
parent 9767b8a9f1
commit 2eb29409bc
5 changed files with 12 additions and 5 deletions

View file

@ -43,7 +43,7 @@ function download(blobUrl, filename) {
// (otherwise .click() is ignored)
(document.body || document.documentElement).appendChild(a);
a.click();
a.parentNode.removeChild(a);
a.remove();
} else {
if (window.top === window &&
blobUrl.split('#')[0] === window.location.href.split('#')[0]) {

View file

@ -111,8 +111,8 @@ PDFPrintService.prototype = {
return;
}
this.printContainer.textContent = '';
if (this.pageStyleSheet && this.pageStyleSheet.parentNode) {
this.pageStyleSheet.parentNode.removeChild(this.pageStyleSheet);
if (this.pageStyleSheet) {
this.pageStyleSheet.remove();
this.pageStyleSheet = null;
}
this.scratchCanvas.width = this.scratchCanvas.height = 0;