Bug 1717703 Part 2 - Add test for printing with down-scaled page-size. r=dholbert

This test couldn't succeed without the fix for the clipping issue.

Differential Revision: https://phabricator.services.mozilla.com/D119460
This commit is contained in:
Emily McDonough 2021-07-16 19:47:49 +00:00
Родитель 2844167a17
Коммит 6e2a97de80
4 изменённых файлов: 78 добавлений и 0 удалений

Просмотреть файл

@ -58,6 +58,8 @@ support-files =
print_page_size2_ref.html
print_page_size3.html
print_page_size3_ref.html
print_page_size4.html
print_page_size4_ref.html
color_adjust.html
color_adjust_ref.html
test_document_adopted_styles.html

Просмотреть файл

@ -0,0 +1,31 @@
<!DOCTYPE html>
<style>
@page {
size: 10in;
margin: 0;
}
div {
position: absolute;
background: blue;
width: 1in;
height: 1in;
}
.upper {
top: 0;
}
.lower{
bottom: 0;
}
.left{
left: 0;
}
.right{
right: 0;
}
</style>
<body>
<div class="upper left"></div>
<div class="upper right"></div>
<div class="lower left"></div>
<div class="lower right"></div>
</body>

Просмотреть файл

@ -0,0 +1,31 @@
<!DOCTYPE html>
<style>
@page {
size: 20in;
margin: 0;
}
div {
position: absolute;
background: blue;
width: 2in;
height: 2in;
}
.upper {
top: 0;
}
.lower{
bottom: 0;
}
.left{
left: 0;
}
.right{
right: 0;
}
</style>
<body>
<div class="upper left"></div>
<div class="upper right"></div>
<div class="lower left"></div>
<div class="lower right"></div>
</body>

Просмотреть файл

@ -1255,6 +1255,20 @@ async function runTest44() {
let test = "print_page_size3.html";
let ref = "print_page_size3_ref.html";
await compareFiles(test, ref, fuzz);
requestAnimationFrame(() => setTimeout(runTest45));
}
// Test that @page{ size: ... } results in scaling down the contents to fit on
// a smaller paper size.
// This depends on Firefox's current behavior of scaling oversized pages down
// to fit onto the paper size.
async function runTest45() {
if (navigator.platform.includes("Mac")) {
var fuzz = { maxDifferent: 15, maxDifference: 8 };
}
let test = "print_page_size4.html";
let ref = "print_page_size4_ref.html";
await compareFiles(test, ref, fuzz);
finish();
}