print: Remove invalid @supports condition.
@supports() is not supposed to report support for page descriptors, this is depending on a Chromium bug, which doesn't treat as invalid: ``` <div style="size: 1pt 1pt"> ``` Even though it should. That is https://bugs.chromium.org/p/chromium/issues/detail?id=1079214 There's no need to use @supports for this. If the descriptor is not accepted it will just be ignored. That way, when Firefox implements @page { size }, which is in progress, it will get the right behavior.
This commit is contained in:
parent
7fef896a9f
commit
b932eaf6a7
@ -120,15 +120,7 @@ PDFPrintService.prototype = {
|
|||||||
this.pageStyleSheet = document.createElement("style");
|
this.pageStyleSheet = document.createElement("style");
|
||||||
const pageSize = this.pagesOverview[0];
|
const pageSize = this.pagesOverview[0];
|
||||||
this.pageStyleSheet.textContent =
|
this.pageStyleSheet.textContent =
|
||||||
// "size:<width> <height>" is what we need. But also add "A4" because
|
"@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}";
|
||||||
// Firefox incorrectly reports support for the other value.
|
|
||||||
"@supports ((size:A4) and (size:1pt 1pt)) {" +
|
|
||||||
"@page { size: " +
|
|
||||||
pageSize.width +
|
|
||||||
"pt " +
|
|
||||||
pageSize.height +
|
|
||||||
"pt;}" +
|
|
||||||
"}";
|
|
||||||
body.appendChild(this.pageStyleSheet);
|
body.appendChild(this.pageStyleSheet);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user