Bug 1819468 - Do not propagate page names from subclasses of block frames r=dholbert

Remove some related now-default pref setting in printing crashtests.list
while we're here.

Differential Revision: https://phabricator.services.mozilla.com/D172342
This commit is contained in:
Emily McDonough 2023-03-28 22:22:59 +00:00
parent efccf56a7a
commit c0c82e4fc5
4 changed files with 54 additions and 6 deletions

View file

@ -9516,10 +9516,17 @@ inline void nsCSSFrameConstructor::ConstructFramesFromItemList(
VerifyGridFlexContainerChildren(aParentFrame, aFrameList);
// Calculate and propagate page-name values for each frame in the frame list.
// This will be affected by https://bugzilla.mozilla.org/1782597
// We do not want to compute and propagate page-name values from frames that
// are children of any subclasses of block frames, but not actually a block
// frame. The page-name property does not apply to frames which cannot create
// class A breakpoints (currently no subclass of BlockFrame can). Because the
// property does not apply, those children also cannot propagate page-name
// values.
// This assumption helps avoid unnecessarily handling page-names for frames
// such as form controls, which also avoids bug 1819468.
if (aState.mPresContext->IsPaginated() &&
StaticPrefs::layout_css_named_pages_enabled() &&
aParentFrame->IsBlockFrameOrSubclass()) {
aParentFrame->IsBlockFrame()) {
// Set the start/end page values while iterating the frame list, to walk
// up the frame tree only once after iterating the frame list.
// This also avoids extra property lookups on these frames.
@ -9604,7 +9611,7 @@ inline void nsCSSFrameConstructor::ConstructFramesFromItemList(
// frame that is not a block frame.
for (nsContainerFrame* ancestorFrame = aParentFrame;
(startPageValue || endPageValue) && ancestorFrame &&
ancestorFrame->IsBlockFrameOrSubclass();
ancestorFrame->IsBlockFrame();
ancestorFrame = ancestorFrame->GetParent()) {
MOZ_ASSERT(!ancestorFrame->GetPrevInFlow(),
"Should not have fragmentation yet");

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<style>
.c {
break-after: page;
page: Rotated;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
b.insertAdjacentHTML("afterBegin", a.innerHTML)
SpecialPowers.wrap(window).printPreview()?.close()
})
</script>
<audio>
<optgroup id="a">
<option class="c">a</option>
</audio>
<menu style="max-height: 0em">
<menu id="b"></menu>
</menu>
<select class="c">

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<style>
.c {
break-after: page;
page: Rotated;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
SpecialPowers.wrap(window).printPreview()?.close()
})
</script>
<menu style="max-height: 0em">
<menu id="b">
<option class="c">a</option>
</menu>
</menu>
<select class="c">

View file

@ -7,6 +7,8 @@ skip-if(Android) load 1663722.html
skip-if(Android) load 1671503.html
load 1748277.html # Bug 1751260
load 1758199-1.html
pref(layout.css.named-pages.enabled,true) load 1804571.html
pref(layout.css.named-pages.enabled,true) load 1804798.html
pref(layout.css.named-pages.enabled,true) load 1804794.html
load 1804571.html
load 1804798.html
load 1804794.html
load 1819468-1.html
load 1819468-2.html