From 544a1f7855ab53fafb3f14b62b82349bb014d31b Mon Sep 17 00:00:00 2001 From: Emily McDonough Date: Mon, 30 Oct 2023 21:45:48 +0000 Subject: [PATCH] Bug 1859830 Part 1 - Apply resolved page style for :first @page, even if it has no specified page name r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D191767 --- layout/generic/nsPageContentFrame.cpp | 5 +---- testing/web-platform/meta/css/printing/page-size-004-print.html.ini | 2 +- testing/web-platform/meta/css/printing/page-size-005-print.html.ini | 2 +- testing/web-platform/meta/css/printing/page-size-006-print.html.ini | 5 +---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp index 503b6aee4aa4..260373151c5e 100644 --- a/layout/generic/nsPageContentFrame.cpp +++ b/layout/generic/nsPageContentFrame.cpp @@ -414,10 +414,7 @@ void nsPageContentFrame::EnsurePageName() { mPageName = ComputePageValue(); MOZ_ASSERT(mPageName, "Page name should never be null"); - // We don't need to resolve any further styling if the page name is empty. - if (mPageName == nsGkAtoms::_empty) { - return; - } + // Resolve the computed style given this page-name and the :first pseudo. RefPtr pageContentPseudoStyle = PresShell()->StyleSet()->ResolvePageContentStyle( mPageName, StylePagePseudoClassFlags::FIRST); diff --git a/testing/web-platform/meta/css/printing/page-size-004-print.html.ini b/testing/web-platform/meta/css/printing/page-size-004-print.html.ini index 123c609324aa..fed49a59b232 100644 --- a/testing/web-platform/meta/css/printing/page-size-004-print.html.ini +++ b/testing/web-platform/meta/css/printing/page-size-004-print.html.ini @@ -1,2 +1,2 @@ [page-size-004-print.html] - expected: FAIL + prefs: [layout.css.allow-mixed-page-sizes:true] diff --git a/testing/web-platform/meta/css/printing/page-size-005-print.html.ini b/testing/web-platform/meta/css/printing/page-size-005-print.html.ini index f1c5dffc3c80..75fa19c24703 100644 --- a/testing/web-platform/meta/css/printing/page-size-005-print.html.ini +++ b/testing/web-platform/meta/css/printing/page-size-005-print.html.ini @@ -1,2 +1,2 @@ [page-size-005-print.html] - expected: FAIL + prefs: [layout.css.allow-mixed-page-sizes:true] diff --git a/testing/web-platform/meta/css/printing/page-size-006-print.html.ini b/testing/web-platform/meta/css/printing/page-size-006-print.html.ini index c942b08a5ba8..a6f45db06e73 100644 --- a/testing/web-platform/meta/css/printing/page-size-006-print.html.ini +++ b/testing/web-platform/meta/css/printing/page-size-006-print.html.ini @@ -1,5 +1,2 @@ -prefs: [layout.css.page-orientation.enabled:true] [page-size-006-print.html] - expected: - if os == "mac": PASS - FAIL + prefs: [layout.css.page-orientation.enabled:true] -- 2.11.4.GIT