Merge pull request #10959 from Snuffleupagus/rm-PrintService-body-attribute
Remove the `data-pdfjsprinting` attribute on the `<body>` when destroying `FirefoxPrintService`/`PDFPrintService` instances (issue 10948)
This commit is contained in:
commit
6e594a89da
@ -77,18 +77,21 @@ function FirefoxPrintService(pdfDocument, pagesOverview, printContainer) {
|
||||
|
||||
FirefoxPrintService.prototype = {
|
||||
layout() {
|
||||
let pdfDocument = this.pdfDocument;
|
||||
let printContainer = this.printContainer;
|
||||
let body = document.querySelector('body');
|
||||
const { pdfDocument, pagesOverview, printContainer, } = this;
|
||||
|
||||
const body = document.querySelector('body');
|
||||
body.setAttribute('data-pdfjsprinting', true);
|
||||
|
||||
for (let i = 0, ii = this.pagesOverview.length; i < ii; ++i) {
|
||||
composePage(pdfDocument, i + 1, this.pagesOverview[i], printContainer);
|
||||
for (let i = 0, ii = pagesOverview.length; i < ii; ++i) {
|
||||
composePage(pdfDocument, i + 1, pagesOverview[i], printContainer);
|
||||
}
|
||||
},
|
||||
|
||||
destroy() {
|
||||
this.printContainer.textContent = '';
|
||||
|
||||
const body = document.querySelector('body');
|
||||
body.removeAttribute('data-pdfjsprinting');
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -74,7 +74,7 @@ PDFPrintService.prototype = {
|
||||
layout() {
|
||||
this.throwIfInactive();
|
||||
|
||||
let body = document.querySelector('body');
|
||||
const body = document.querySelector('body');
|
||||
body.setAttribute('data-pdfjsprinting', true);
|
||||
|
||||
let hasEqualPageSizes = this.pagesOverview.every(function(size) {
|
||||
@ -114,6 +114,10 @@ PDFPrintService.prototype = {
|
||||
return;
|
||||
}
|
||||
this.printContainer.textContent = '';
|
||||
|
||||
const body = document.querySelector('body');
|
||||
body.removeAttribute('data-pdfjsprinting');
|
||||
|
||||
if (this.pageStyleSheet) {
|
||||
this.pageStyleSheet.remove();
|
||||
this.pageStyleSheet = null;
|
||||
|
Loading…
Reference in New Issue
Block a user