mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1848407 - Ensure that zero-height block frame lines will be placed on the next page when break-after: page is set. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D186061
This commit is contained in:
parent
995979d9d0
commit
dbc26c185f
@ -3761,6 +3761,18 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
|
||||
return;
|
||||
}
|
||||
|
||||
// If the previous frame was a page-break-frame, then preemptively push this
|
||||
// frame to the next page.
|
||||
// This is primarily important for the placeholders for abspos frames, which
|
||||
// measure as zero height and then would be placed on this page.
|
||||
if (aState.ContentBSize() != NS_UNCONSTRAINEDSIZE) {
|
||||
const nsIFrame* const prev = frame->GetPrevSibling();
|
||||
if (prev && prev->IsPageBreakFrame()) {
|
||||
PushTruncatedLine(aState, aLine, aKeepReflowGoing);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare the block reflow engine
|
||||
nsBlockReflowContext brc(aState.mPresContext, aState.mReflowInput);
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<title>Absolute position frame inside 'overflow: hidden' immediately after a forced page break</title>
|
||||
<link rel="author" title="Emily McDonough" href="mailto:emcdonough@mozilla.com"/>
|
||||
<style>
|
||||
.inner {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
.outer {
|
||||
break-after: page;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
html, body { margin: 0; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="outer">
|
||||
<div class="inner" style="border: 3px solid blue">111</div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div class="inner" style="border: 3px solid black">222</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<title>Absolute position frame inside 'overflow: hidden' immediately after a forced page break</title>
|
||||
<link rel="author" title="Emily McDonough" href="mailto:emcdonough@mozilla.com"/>
|
||||
<link rel="match" href="abspos-overflow-hidden-001-print-ref.html"/>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#page-break-values"/>
|
||||
<meta name="assert" content="An abspos box after a forced pagebreak and inside 'overflow:hidden' should be visible on the next page"/>
|
||||
<style>
|
||||
.inner {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
.outer {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
break-after: page;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
html, body { margin: 0; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="outer">
|
||||
<div class="inner" style="border: 3px solid blue">111</div>
|
||||
</div>
|
||||
<div class="outer">
|
||||
<div class="inner" style="border: 3px solid black">222</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<title>Zero height box immediately after a forced page-break</title>
|
||||
<link rel="author" title="Emily McDonough" href="mailto:emcdonough@mozilla.com"/>
|
||||
<body>
|
||||
<div style="break-after: page; height: 100%">Page 1</div>
|
||||
<div style="height: 1in"></div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<title>Zero height box immediately after a forced page-break</title>
|
||||
<link rel="author" title="Emily McDonough" href="mailto:emcdonough@mozilla.com"/>
|
||||
<link rel="match" href="zero-height-page-break-001-print-ref.html"/>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-break-3/#page-break-values"/>
|
||||
<meta name="assert" content="Ensures that a zero-height frame after a forced page-break appears on the following page."/>
|
||||
<!-- This will cause a failure of there is only one page, regardless of matching the ref -->
|
||||
<meta name="reftest-pages" content="1,2"/>
|
||||
<body>
|
||||
<div style="break-after: page; height: 100%">Page 1</div>
|
||||
<div></div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user