From 2d71b994cff2569029646ac9fee8fe09ccffc4a1 Mon Sep 17 00:00:00 2001 From: Emily McDonough Date: Wed, 8 Mar 2023 21:42:19 +0000 Subject: [PATCH] Bug 1820892 - Enable layout.css.allow-mixed-page-sizes through early beta r=dholbert This also adds some basic tests to ensure we don't just crash in this situation. Differential Revision: https://phabricator.services.mozilla.com/D171919 --- layout/base/tests/chrome/chrome.ini | 2 ++ layout/base/tests/chrome/printpreview_helper.xhtml | 20 ++++++++++++++++++++ .../chrome/printpreview_mixed_page_size_001.html | 11 +++++++++++ .../chrome/printpreview_mixed_page_size_002.html | 15 +++++++++++++++ modules/libpref/init/StaticPrefList.yaml | 2 +- 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 layout/base/tests/chrome/printpreview_mixed_page_size_001.html create mode 100644 layout/base/tests/chrome/printpreview_mixed_page_size_002.html diff --git a/layout/base/tests/chrome/chrome.ini b/layout/base/tests/chrome/chrome.ini index 95844c49c171..13f65215c049 100644 --- a/layout/base/tests/chrome/chrome.ini +++ b/layout/base/tests/chrome/chrome.ini @@ -46,6 +46,8 @@ support-files = printpreview_images_sw.js printpreview_image_select.html printpreview_image_select_ref.html + printpreview_mixed_page_size_001.html + printpreview_mixed_page_size_002.html printpreview_pps_uw2.html printpreview_pps_uw2_ref.html printpreview_pps_uw2_no_margin_ref.html diff --git a/layout/base/tests/chrome/printpreview_helper.xhtml b/layout/base/tests/chrome/printpreview_helper.xhtml index 79bb4495599d..15c56d83c81d 100644 --- a/layout/base/tests/chrome/printpreview_helper.xhtml +++ b/layout/base/tests/chrome/printpreview_helper.xhtml @@ -1689,6 +1689,26 @@ async function runTest55() { async function runTest56() { await compareFiles("printpreview_image_select.html", "printpreview_image_select_ref.html"); + requestAnimationFrame(() => setTimeout(runTest57)); +} + +// Tests that printing with mixed page sizes doesn't crash. +// These tests can't actually compare any pages after the first, so this only +// verifies that we don't crash reflowing. +async function runTest57() { + let test = "printpreview_mixed_page_size_001.html"; + // The params are just to give the file unique URLs. + await compareFiles(test + "?test", test + "?ref"); + requestAnimationFrame(() => setTimeout(runTest58)); +} + +// As with runTest57, this is only testing for crashes. +// This includes fixed-position content, as this is the only way to get content +// within the same chain of continuations onto pages with different sizes. +async function runTest58() { + let test = "printpreview_mixed_page_size_002.html"; + // The params are just to give the file unique URLs. + await compareFiles(test + "?test", test + "?ref"); finish(); } diff --git a/layout/base/tests/chrome/printpreview_mixed_page_size_001.html b/layout/base/tests/chrome/printpreview_mixed_page_size_001.html new file mode 100644 index 000000000000..a611299527cb --- /dev/null +++ b/layout/base/tests/chrome/printpreview_mixed_page_size_001.html @@ -0,0 +1,11 @@ + + +
a
+
b
diff --git a/layout/base/tests/chrome/printpreview_mixed_page_size_002.html b/layout/base/tests/chrome/printpreview_mixed_page_size_002.html new file mode 100644 index 000000000000..f55efef3e6cd --- /dev/null +++ b/layout/base/tests/chrome/printpreview_mixed_page_size_002.html @@ -0,0 +1,15 @@ + + +
+
static 1
+
static 2
+
+
block a
+
block b
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 04b1ed5d1609..7102b111e44e 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -8711,7 +8711,7 @@ # Enables support for different CSS page sizes on each page when printing. - name: layout.css.allow-mixed-page-sizes type: RelaxedAtomicBool - value: false + value: @IS_EARLY_BETA_OR_EARLIER@ mirror: always # Dictates whether or not the prefers contrast media query will be -- 2.11.4.GIT