Bug 685012 - Implement page-break-inside:avoid in layout. r=fantasai,sr=roc

This commit is contained in:
Mats Palmgren 2012-11-08 17:09:38 +01:00
Родитель 25ea524bba
Коммит ddad154fe9
76 изменённых файлов: 1702 добавлений и 59 удалений

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

@ -3058,9 +3058,13 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
// constrained height to turn into an unconstrained one.
aState.mY = startingY;
aState.mPrevBottomMargin = incomingMargin;
PushLines(aState, aLine.prev());
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
*aKeepReflowGoing = false;
if (ShouldAvoidBreakInside(aState.mReflowState)) {
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
} else {
PushLines(aState, aLine.prev());
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
}
return NS_OK;
}
@ -3120,9 +3124,13 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) {
// None of the child block fits.
PushLines(aState, aLine.prev());
*aKeepReflowGoing = false;
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
if (ShouldAvoidBreakInside(aState.mReflowState)) {
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
} else {
PushLines(aState, aLine.prev());
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
}
}
else {
// Note: line-break-after a block is a nop
@ -3141,6 +3149,11 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
collapsedBottomMargin,
aLine->mBounds, overflowAreas,
frameReflowStatus);
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
ShouldAvoidBreakInside(aState.mReflowState)) {
*aKeepReflowGoing = false;
}
if (aLine->SetCarriedOutBottomMargin(collapsedBottomMargin)) {
line_iterator nextLine = aLine;
++nextLine;
@ -3281,16 +3294,14 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
brc.GetCarriedOutBottomMargin(), collapsedBottomMargin.get(),
aState.mPrevBottomMargin);
#endif
}
else {
// None of the block fits. Determine the correct reflow status.
if (aLine == mLines.front() && !GetPrevInFlow()) {
// If it's our very first line then we need to be pushed to
// our parents next-in-flow. Therefore, return break-before
// status for our reflow status.
} else {
if ((aLine == mLines.front() && !GetPrevInFlow()) ||
ShouldAvoidBreakInside(aState.mReflowState)) {
// If it's our very first line *or* we're not at the top of the page
// and we have page-break-inside:avoid, then we need to be pushed to
// our parent's next-in-flow.
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
}
else {
} else {
// Push the line that didn't fit and any lines that follow it
// to our next-in-flow.
PushLines(aState, aLine.prev());
@ -3399,12 +3410,10 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
void
nsBlockFrame::PushTruncatedLine(nsBlockReflowState& aState,
line_iterator aLine,
bool& aKeepReflowGoing)
bool* aKeepReflowGoing)
{
line_iterator prevLine = aLine;
--prevLine;
PushLines(aState, prevLine);
aKeepReflowGoing = false;
PushLines(aState, aLine.prev());
*aKeepReflowGoing = false;
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
}
@ -3625,8 +3634,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
// it to the next page/column where its contents can fit not
// next to a float.
lineReflowStatus = LINE_REFLOW_TRUNCATED;
// Push the line that didn't fit
PushTruncatedLine(aState, aLine, *aKeepReflowGoing);
PushTruncatedLine(aState, aLine, aKeepReflowGoing);
}
}
@ -4191,21 +4199,25 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
newY = aState.mY + dy;
}
// See if the line fit. If it doesn't we need to push it. Our first
// line will always fit.
if (!NS_FRAME_IS_FULLY_COMPLETE(aState.mReflowStatus) &&
ShouldAvoidBreakInside(aState.mReflowState)) {
aLine->AppendFloats(aState.mCurrentLineFloats);
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
return true;
}
// See if the line fit (our first line always does).
if (mLines.front() != aLine &&
newY > aState.mBottomEdge &&
aState.mBottomEdge != NS_UNCONSTRAINEDSIZE) {
// Push this line and all of its children and anything else that
// follows to our next-in-flow
NS_ASSERTION((aState.mCurrentLine == aLine), "oops");
PushLines(aState, aLine.prev());
// Stop reflow and whack the reflow status if reflow hasn't
// already been stopped.
if (*aKeepReflowGoing) {
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
*aKeepReflowGoing = false;
NS_ASSERTION(aState.mCurrentLine == aLine, "oops");
if (ShouldAvoidBreakInside(aState.mReflowState)) {
// All our content doesn't fit, start on the next page.
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
} else {
// Push aLine and all of its children and anything else that
// follows to our next-in-flow.
PushTruncatedLine(aState, aLine, aKeepReflowGoing);
}
return true;
}
@ -5755,11 +5767,15 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
aReflowStatus, aState);
} while (NS_SUCCEEDED(rv) && clearanceFrame);
// An incomplete reflow status means we should split the float
// if the height is constrained (bug 145305).
if (NS_FRAME_IS_NOT_COMPLETE(aReflowStatus) &&
(NS_UNCONSTRAINEDSIZE == aAdjustedAvailableSpace.height))
if (!NS_FRAME_IS_FULLY_COMPLETE(aReflowStatus) &&
ShouldAvoidBreakInside(floatRS)) {
aReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
} else if (NS_FRAME_IS_NOT_COMPLETE(aReflowStatus) &&
(NS_UNCONSTRAINEDSIZE == aAdjustedAvailableSpace.height)) {
// An incomplete reflow status means we should split the float
// if the height is constrained (bug 145305).
aReflowStatus = NS_FRAME_COMPLETE;
}
if (aReflowStatus & NS_FRAME_REFLOW_NEXTINFLOW) {
aState.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;

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

@ -631,11 +631,14 @@ protected:
nsIFrame* aFrame,
bool& aMadeNewFrame);
// Push aLine, which cannot be placed on this page/column but should
// fit on a future one. Set aKeepReflowGoing to false.
/**
* Push aLine (and any after it), since it cannot be placed on this
* page/column. Set aKeepReflowGoing to false and set
* flag aState.mReflowStatus as incomplete.
*/
void PushTruncatedLine(nsBlockReflowState& aState,
line_iterator aLine,
bool& aKeepReflowGoing);
bool* aKeepReflowGoing);
nsresult SplitLine(nsBlockReflowState& aState,
nsLineLayout& aLineLayout,

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

@ -760,15 +760,28 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
// (This code is only for DISABLE_FLOAT_BREAKING_IN_COLUMNS .)
//
// Likewise, if none of the float fit, and it needs to be pushed in
// its entirety to the next page (NS_FRAME_IS_TRUNCATED), we need to
// do the same.
// its entirety to the next page (NS_FRAME_IS_TRUNCATED or
// NS_INLINE_IS_BREAK_BEFORE), we need to do the same.
if ((mContentArea.height != NS_UNCONSTRAINEDSIZE &&
adjustedAvailableSpace.height == NS_UNCONSTRAINEDSIZE &&
!mustPlaceFloat &&
aFloat->GetSize().height + floatMargin.TopBottom() >
mContentArea.YMost() - floatY) ||
NS_FRAME_IS_TRUNCATED(reflowStatus)) {
NS_FRAME_IS_TRUNCATED(reflowStatus) ||
NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
PushFloatPastBreak(aFloat);
return false;
}
// We can't use aFloat->ShouldAvoidBreakInside(mReflowState) here since
// its mIsTopOfPage may be true even though the float isn't at the
// top when floatY > 0.
if (!mustPlaceFloat && (!mReflowState.mFlags.mIsTopOfPage || floatY > 0) &&
NS_STYLE_PAGE_BREAK_AVOID == aFloat->GetStyleDisplay()->mBreakInside &&
(!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus) ||
aFloat->GetSize().height + floatMargin.TopBottom() >
mContentArea.YMost() - floatY) &&
!aFloat->GetPrevInFlow()) {
PushFloatPastBreak(aFloat);
return false;
}

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

@ -408,6 +408,15 @@ public:
virtual const void* GetStyleDataExternal(nsStyleStructID aSID) const;
/**
* @return true if we should avoid a page/column break in this frame.
*/
bool ShouldAvoidBreakInside(const nsHTMLReflowState& aReflowState) const {
return !aReflowState.mFlags.mIsTopOfPage &&
NS_STYLE_PAGE_BREAK_AVOID == GetStyleDisplay()->mBreakInside &&
!GetPrevInFlow();
}
#ifdef DEBUG
/**
* Tracing method that writes a method enter/exit routine to the

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

@ -0,0 +1,48 @@
<html class="reftest-wait">
<head>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<meta charset="utf-8">
<title>Balancing Overflow, page-break-inside:avoid</title>
<style>
/* Sets of heights that trigger crash:
100px/50px/51+px
100px/30px/74+px
Get only an assert unless you set ".d { position: absolute; }".
Trigger hang (separate issue, absolute not needed):
10px/10px/9999px
10px/10px/999999px --> "bad height" notreached
*/
/* Note: The -moz-column-gap and the backgrounds
are just added here for easier visualization */
#colset { width: 200px;
padding: 2px;
-moz-column-count: 3;
-moz-column-gap: 2px; }
#a { height: 100px; background: lightblue;}
#b { height: 50px; background: lightblue;}
#c { height: 51px; background: orange;}
</style>
<script>
function boom() {
document.getElementById('colset').offsetHeight;
document.getElementById('a').style.height = 'auto';
document.documentElement.className = ''
}
</script>
</head>
<!-- Removing whitespace in body for simpler frame trees -->
<body onload="boom()"
><div id="colset"
><div
><div id="a"></div
><div id="b"
><div id="c"></div
><div id="d"></div
></div
></div
></div
></body>
</html>

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

@ -0,0 +1,49 @@
<html class="reftest-wait">
<head>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<meta charset="utf-8">
<title>Balancing Overflow, page-break-inside:avoid</title>
<style>
/* Sets of heights that trigger crash:
100px/50px/51+px
100px/30px/74+px
Get only an assert unless you set ".d { position: absolute; }".
Trigger hang (separate issue, absolute not needed):
10px/10px/9999px
10px/10px/999999px --> "bad height" notreached
*/
/* Note: The -moz-column-gap and the backgrounds
are just added here for easier visualization */
#colset { width: 200px;
padding: 2px;
-moz-column-count: 3;
-moz-column-gap: 2px; }
#a { height: 100px; background: lightblue;}
#b { height: 50px; background: lightblue;}
#c { height: 51px; background: orange;}
div {page-break-inside:avoid; }
</style>
<script>
function boom() {
document.getElementById('colset').offsetHeight;
document.getElementById('a').style.height = 'auto';
document.documentElement.className = ''
}
</script>
</head>
<!-- Removing whitespace in body for simpler frame trees -->
<body onload="boom()"
><div id="colset"
><div
><div id="a"></div
><div id="b"
><div id="c"></div
><div id="d"></div
></div
></div
></div
></body>
</html>

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

@ -1,3 +1,5 @@
# For more pagination tests, see layout/reftests/w3c-css/submitted/css21/pagination/
# and layout/reftests/w3c-css/submitted/multicol3/
# Pagination tests
== abspos-breaking-000.xhtml abspos-breaking-000.ref.xhtml
== abspos-breaking-001.xhtml abspos-breaking-000.ref.xhtml
@ -57,3 +59,4 @@ fails == float-continuations-000.html float-continuations-000.ref.html
# == table-caption-splitaftercaption-9.html blank.html # bug 672654
# == table-caption-splitaftercaption-10.html blank.html # bug 672654
# == table-caption-splitaftercaption-11.html blank.html # bug 672654
== column-balancing-break-inside-avoid-2.html column-balancing-break-inside-avoid-2-ref.html

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

@ -1,2 +1,3 @@
== bug785684-x.html bug785684-ref.html
== bug785684-y.html bug785684-ref.html
== table-row-pagination.html table-row-pagination-ref.html

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

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html class="reftest-print"><head>
<meta charset="utf-8">
<title>Testing row split</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
div { height:160%; }
p { height: 50%; margin:0; }
</style>
</head>
<body>
<div>
<p></p>
<p>1</p>
</div>
</body>
</html>

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

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html class="reftest-print"><head>
<meta charset="utf-8">
<title>Testing row split</title>
<style type="text/css">
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
table { height:160%; width:100%; }
td { height:50%; width:100%; }
</style>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td></td></tr>
<tr><td valign="top">1</td></tr>
</table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; page-break-before:always; }
</style>
</head>
<body>
<p>1</p>
<div class="test"><p>2</p><p>3</p></div>
</body>
</html>

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

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<p>1</p>
<div class="test"><div style="page-break-inside:auto"><p>2</p><p>3</p></div></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<p>1</p>
<div class="test"><table cellpadding="0" cellspacing="0"><tr><td><p>2</p><p>3</p></td></tr></table></div>
</body>
</html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test">
<p>1</p>
<div class="test"><p>2</p><p>3</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
Text
<div class="test">
<p>1</p>
<div class="test"><p>2</p><p>3</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test"><p>2</p><p>3</p></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test"><div><div><div><p>2</p><p>3</p></div></div></div></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div><div><div class="test"><p>2</p><p>3</p></div></div></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test"><div class="test"><div class="test"><p>2</p><p>3</p></div></div></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; overflow:hidden; }
</style>
</head>
<body>
<p>1</p>
<div class="test"><p>2</p><p>3</p></div>
</body>
</html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; overflow:hidden; }
</style>
</head>
<body>
<div class="test">
<p>1</p>
<div class="test"><p>2</p><p>3</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
</style>
</head>
<body>
Text
<div>
<p style="page-break-before:always">1</p>
<div style="page-break-before:always"><p>2</p><p>3</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; overflow:hidden; }
</style>
</head>
<body>
Text
<div class="test">
<p>1</p>
<div class="test"><p>2</p><p>3</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test">
<p>1</p>
<div style="page-break-before:always"><p>2</p><p>3</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-after:always; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<p>2</p><p>3</p>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; float:left; }
</style>
</head>
<body>
<p>1</p>
<table class="test"><tr><td><p>2</p><p>3</p></td></tr></table>
</body>
</html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { float:left; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test"><p>2</p><p>3</p></div>
<div class="test" style="page-break-before:always;clear:both"><p>4</p></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { float:left; page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test"><p>2</p><p>3</p><p>4</p></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { float:left; page-break-inside:avoid; }
</style>
</head>
<body>
<div style="clear:both"><p>1</p></div>
<div class="test"><p>2</p><p>3</p></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { float:left; page-break-inside:avoid; }
</style>
</head>
<body>
<div style="clear:both"><p>1</p></div>
<div class="test"><div class="test"><p>2</p><p>3</p></div></div>
</body>
</html>

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

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0;
}
p { height: 0.5in; width: 1in; margin:0; background-color:blue; float:left; }
.test { float:left; clear:left; width:3.3in; }
</style>
</head>
<body>
<br style="clear:both">
<div class="test">
<p>1</p><p>2</p><p>3</p>
<p>4</p><p>5</p><p>6</p>
</div>
<div class="test" style="page-break-before:always">
<p>1</p><p>2</p><p>3</p>
<p>4</p><p>5</p><p>6</p>
</div>
<div class="test">
<p>1</p><p>2</p><p>3</p>
<p>4</p><p>5</p><p>6</p>
</div>
</body>
</html>

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

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0;
}
p { height: 0.5in; width: 1in; margin:0; background-color:blue; float:left; }
.test { float:left; clear:left; page-break-inside:avoid; width:3.3in; }
</style>
</head>
<body>
<br style="clear:both">
<div class="test">
<p>1</p><p>2</p><p>3</p>
<p>4</p><p>5</p><p>6</p>
</div>
<div class="test">
<p>1</p><p>2</p><p>3</p>
<p>4</p><p>5</p><p>6</p>
</div>
<div class="test">
<p>1</p><p>2</p><p>3</p>
<p>4</p><p>5</p><p>6</p>
</div>
</body>
</html>

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
p { height:60%; width:90%; margin:0; background-color:blue; border:1px solid black; }
.test { page-break-before:always; float:left; }
</style>
</head>
<body><p>1</p><p class="test">2</p></body>
</html>

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
p { height:60%; width:90%; margin:0; background-color:blue; border:1px solid black; }
.test { page-break-inside:avoid; float:left; }
</style>
</head>
<body><p>1</p><p class="test">2</p></body>
</html>

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

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged"><style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
.test {
height:60%;
float:left;
clear:left;
background-color:blue;
}
</style>
</head>
<body>
<br style="clear:both">
<div class="test">1</div>X
<div class="test" style="page-break-before:always">2</div>
</body>
</html>

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

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged"><style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
.test {
page-break-inside:avoid;
height:60%;
float:left;
clear:left;
background-color:blue;
}
</style>
</head>
<body>
<br style="clear:both">
<div class="test">1</div>
<div class="test">2</div>X
</body>
</html>

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

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged"><style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
.test {
height:60%;
float:left;
clear:left;
background-color:blue;
}
</style>
</head>
<body>
<br style="clear:both">
<div class="test">1</div>
<div style="clear:both;">X<br>Y</div>
<div class="test" style="page-break-before:always">2</div>
</body>
</html>

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

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged"><style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
.test {
page-break-inside:avoid;
height:60%;
float:left;
clear:left;
background-color:blue;
}
</style>
</head>
<body>
<br style="clear:both">
<div class="test">1</div>
<div style="height:60%;clear:both;"><div class="test" style="height:100%;">2</div>X<br>Y</div>
</body>
</html>

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

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged"><style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
.test {
height:60%;
float:left;
clear:left;
background-color:blue;
}
.ib {
display:inline-block;
height:100%;
width:1px;
}
</style>
</head>
<body>
<br style="clear:both">
<div class="test" style="page-break-after:always">1</div>
<div style="height:60%;clear:both;">A<div class="test" style="height:100%;">2</div><span>X<span class="ib"></span><br>Y</span></div>
</body>
</html>

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

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged"><style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
}
.test {
page-break-inside:avoid;
height:60%;
float:left;
clear:left;
background-color:blue;
}
.ib {
display:inline-block;
height:100%;
width:1px;
}
</style>
</head>
<body>
<br style="clear:both">
<div class="test">1</div>
<div style="height:60%;clear:both;">A<div class="test" style="height:100%;">2</div><span>X<span class="ib"></span><br>Y</span></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test" style="display:inline"><p>2</p><p>3</p></div>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<div class="test"><p>1</p></div>
<div class="test" style="display:inline"><p>2</p><p>3</p></div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<table border="1">
<thead><tr><td><p>1</p></td></tr></thead>
<tbody><tr class="test"><td><p>2</p><p>3</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<table border="1">
<tbody>
<tr><td><p>1</p></td></tr>
<tr class="test"><td><p>2</p><p>3</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<p>1</p>
<table><thead class="test"><tr><td><p>2</p><p>3</p></td></tr></thead></table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<p>1</p>
<table><tbody class="test"><tr><td><p>2</p><p>3</p></td></tr></tbody></table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<p>1</p>
<table><tfoot class="test"><tr><td><p>2</p><p>3</p></td></tr></tfoot></table>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
</style>
</head>
<body>
<table border="1">
<tfoot><tr><td><p>3</p></td></tr></tfoot>
<thead><tr><td><p>1</p></td></tr></thead>
<tbody style="page-break-before:always"><tr><td><p>2</p><p>2</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<table border="1">
<tfoot><tr><td><p>3</p></td></tr></tfoot>
<thead><tr><td><p>1</p></td></tr></thead>
<tbody class="test"><tr><td><p>2</p><p>2</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
thead { page-break-after:always; }
</style>
</head>
<body>
<table border="1">
<thead><tr><td><p>1</p></td></tr></thead>
<tbody><tr><td><p>2</p><p>3</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<table border="1">
<thead><tr><td><p>1</p></td></tr></thead>
<tbody class="test"><tr><td><p>2</p><p>3</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
.bb { page-break-before:always; }
</style>
</head>
<body>
<table border="1">
<thead><tr><td><p>1</p></td></tr></thead>
<tbody class="test"><tr class="bb"><td><p>2</p><p>3</p></td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.bb { page-break-before:always; }
</style>
</head>
<body>
1
<table border="1" class="bb">
<tbody>
<tr><td><p>2</p></td></tr>
<tr><td><p>2</p><p>3</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
1
<table border="1">
<tbody class="test">
<tr><td><p>2</p></td></tr>
<tr><td><p>2</p><p>3</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.bb { page-break-before:always; }
</style>
</head>
<body>
1
<table border="1">
<tbody>
<tr><td><p>1</p></td></tr>
<tr class="bb"><td><p>2</p><p>2</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
.bb { page-break-before:always; }
</style>
</head>
<body>
1
<table border="1">
<tbody class="test">
<tr><td><p>1</p></td></tr>
<tr class="bb"><td><p>2</p><p>2</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<p>1</p>
<table class="test"><tr><td><p>2</p><p>3</p></td></tr></table>
</body>
</html>

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

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
</style>
</head>
<body>
<table border="1">
<tbody>
<tr><td><p>1</p></td></tr>
</tbody>
</table>
<div style= "page-break-after: always"></div>
<table border="1">
<tbody></tbody>
<tbody>
<tr><td><p>2</p><p>3</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
</style>
</head>
<body>
<table border="1">
<tbody>
<tr><td><p>1</p></td></tr>
</tbody>
</table>
<div style= "page-break-after: always"></div>
<table border="1" class="test">
<tbody></tbody>
<tbody>
<tr><td><p>2</p><p>3</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
table { display:inline-table; }
</style>
</head>
<body>
<table border="1">
<tbody>
<tr><td><p>1</p></td></tr>
</tbody>
</table>
<div style= "page-break-after: always"></div>
<table border="1">
<tbody></tbody>
<tbody>
<tr><td><p>2</p><p>3</p><p>4</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
table { display:inline-table; }
</style>
</head>
<body>
<table border="1">
<tbody>
<tr><td><p>1</p></td></tr>
</tbody>
</table>
<div style="page-break-after: always"></div>
<table border="1" class="test">
<tbody></tbody>
<tbody>
<tr><td><p>2</p><p>3</p><p>4</p></td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
table { display:inline-table; }
</style>
</head>
<body>
<p style="page-break-after:always">1</p>
text<table class="test"><tr><td><p>2</p><p>3</p><p>4</p></td></tr></table>
</body>
</html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
table { display:inline-table; }
</style>
</head>
<body>
<p>1</p>
text<table class="test"><tr><td><p>2</p><p>3</p><p>4</p></td></tr></table>
</body>
</html>

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
tr,table { page-break-before:always; }
</style>
</head>
<body>
<p>1</p>
<table class="test" border="1">
<tr><td>I have page-break-after: always</td></tr>
<tr><td>I have page-break-after: always</td></tr>
<tr><td>I have page-break-after: always</td></tr>
</table>
</body>
</html>

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
.test { page-break-inside:avoid; }
tr { page-break-before:always; }
</style>
</head>
<body>
<p>1</p>
<table class="test" border="1">
<tr><td>I have page-break-after: always</td></tr>
<tr><td>I have page-break-after: always</td></tr>
<tr><td>I have page-break-after: always</td></tr>
</table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US" class="reftest-print">
<head>
<title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<style type="text/css">
@page { size:5in 3in; margin:0; }
p { height: 1in; width: 1in; margin:0; background-color:blue; }
</style>
</head>
<body>
<p style="page-break-after:always">1</p>
<table><tr><td><p>2</p><p>3</p></td></tr></table>
</body>
</html>

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

@ -0,0 +1,38 @@
== moz-css21-block-page-break-inside-avoid-1.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-2.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-3.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-4.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-5.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-6.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-7.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-8.html moz-css21-block-page-break-inside-avoid-8-ref.html
== moz-css21-block-page-break-inside-avoid-9.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-10.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-11.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-12.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-block-page-break-inside-avoid-13.html moz-css21-block-page-break-inside-avoid-8-ref.html
== moz-css21-table-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-ref.html
== moz-css21-table-page-break-inside-avoid-2.html moz-css21-table-page-break-inside-avoid-2-ref.html
== moz-css21-table-page-break-inside-avoid-3.html moz-css21-table-page-break-inside-avoid-3-ref.html
== moz-css21-table-page-break-inside-avoid-4.html moz-css21-table-page-break-inside-avoid-4-ref.html
== moz-css21-table-page-break-inside-avoid-5.html moz-css21-table-page-break-inside-avoid-5-ref.html
== moz-css21-float-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-ref.html
== moz-css21-float-page-break-inside-avoid-2.html moz-css21-float-page-break-inside-avoid-2-ref.html
== moz-css21-float-page-break-inside-avoid-3.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-float-page-break-inside-avoid-4.html moz-css21-block-page-break-inside-avoid-ref.html
== moz-css21-float-page-break-inside-avoid-5.html moz-css21-float-page-break-inside-avoid-5-ref.html
== moz-css21-float-page-break-inside-avoid-6.html moz-css21-float-page-break-inside-avoid-6-ref.html
== moz-css21-float-page-break-inside-avoid-7.html moz-css21-float-page-break-inside-avoid-7-ref.html
== moz-css21-float-page-break-inside-avoid-8.html moz-css21-float-page-break-inside-avoid-8-ref.html
== moz-css21-float-page-break-inside-avoid-9.html moz-css21-float-page-break-inside-avoid-9-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-1.html moz-css21-table-page-break-inside-avoid-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-2.html moz-css21-table-page-break-inside-avoid-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-3.html moz-css21-table-page-break-inside-avoid-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-4.html moz-css21-rowgroup-page-break-inside-avoid-4-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-5.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-6.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-7.html moz-css21-rowgroup-page-break-inside-avoid-7-ref.html
== moz-css21-rowgroup-page-break-inside-avoid-8.html moz-css21-rowgroup-page-break-inside-avoid-8-ref.html
== moz-css21-row-page-break-inside-avoid-1.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
== moz-css21-row-page-break-inside-avoid-2.html moz-css21-rowgroup-page-break-inside-avoid-5-ref.html
== moz-css21-inline-page-break-inside-avoid-1.html moz-css21-inline-page-break-inside-avoid-1-ref.html

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

@ -0,0 +1 @@
include pagination/reftest.list

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

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<html><head>
<title>CSS Test: Balancing Overflow, page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<meta charset="utf-8">
<style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0;
}
.colset {
-moz-column-count: 3;
-moz-column-gap: 0;
border: solid silver;
width: 9em;
}
p { margin: 0; }
.short { height: 5px; }
.short p { }
</style>
</head>
<body>
<div class="colset">
<p>one<br>&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>two three</p>
<p>four five</p>
</div>
<div class="colset">
<p>one two three four five</p>
</div>
<div class="colset">
one two three four five
</div>
<div class="colset">
<div class="short"><p>one two three four five</p></div>
</div>
</body>
</html>

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

@ -0,0 +1,49 @@
<!DOCTYPE HTML>
<html><head>
<title>CSS Test: Balancing Overflow, page-break-inside:avoid</title>
<link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
<meta name="flags" content="paged">
<meta charset="utf-8">
<style type="text/css">
@page { size:5in 3in; margin:0; }
html,body {
color:black; background-color:white; font-size:16px; padding:0; margin:0;
}
.colset {
-moz-column-count: 3;
-moz-column-gap: 0;
border: solid silver;
width: 9em;
}
p { margin: 0; page-break-inside:avoid; }
.short { height: 5px; page-break-inside:avoid; }
.short p { page-break-inside:auto; }
</style>
</head>
<body>
<div class="colset">
<p>one</p>
<p>two three</p>
<p>four five</p>
</div>
<div class="colset">
<p>one two three four five</p>
</div>
<div class="colset">
<p>one two</p>
<p>three four five</p>
</div>
<div class="colset">
<div class="short"><p>one two three four five</p></div>
</div>
</body>
</html>

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

@ -0,0 +1 @@
== moz-multicol3-column-balancing-break-inside-avoid-1.html moz-multicol3-column-balancing-break-inside-avoid-1-ref.html

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

@ -8,7 +8,7 @@
## CSS Snapshot 2007
# CSS2.1
# include css2.1/reftest.list
include css21/reftest.list
# Animations
# include animations/reftest.list
@ -28,8 +28,8 @@ skip-if(!prefs.getBoolPref("layout.css.supports-rule.enabled")) include conditio
# Media Queries Level 3
# include mediaqueries3/reftest.list
# Multi-column Layout
# include multicol/reftest.list
# Multi-column Layout 3
include multicol3/reftest.list
# Selectors Level 3
# include selectors3/reftest.list

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

@ -2797,10 +2797,9 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
// If this isn't the first row group, and the previous row group has a
// nonzero YMost, then we can't be at the top of the page.
// We ignore the head row group in this check, because a head row group
// may be automatically added at the top of *every* page. This prevents
// We ignore a repeated head row group in this check to avoid causing
// infinite loops in some circumstances - see bug 344883.
if (childX > (thead ? 1 : 0) &&
if (childX > ((thead && IsRepeatedFrame(thead)) ? 1 : 0) &&
(rowGroups[childX - 1]->GetRect().YMost() > 0)) {
kidReflowState.mFlags.mIsTopOfPage = false;
}
@ -2827,11 +2826,22 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
childX = rowGroups.Length();
}
}
if (isPaginated && !NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
ShouldAvoidBreakInside(aReflowState.reflowState)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
break;
}
// see if the rowgroup did not fit on this page might be pushed on
// the next page
if (NS_FRAME_IS_COMPLETE(aStatus) && isPaginated &&
(NS_UNCONSTRAINEDSIZE != kidReflowState.availableHeight) &&
kidReflowState.availableHeight < desiredSize.height) {
if (isPaginated &&
(NS_INLINE_IS_BREAK_BEFORE(aStatus) ||
(NS_FRAME_IS_COMPLETE(aStatus) &&
(NS_UNCONSTRAINEDSIZE != kidReflowState.availableHeight) &&
kidReflowState.availableHeight < desiredSize.height))) {
if (ShouldAvoidBreakInside(aReflowState.reflowState)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
break;
}
// if we are on top of the page place with dataloss
if (kidReflowState.mFlags.mIsTopOfPage) {
if (childX+1 < rowGroups.Length()) {

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

@ -1020,6 +1020,11 @@ nsTableRowFrame::Reflow(nsPresContext* aPresContext,
rv = ReflowChildren(aPresContext, aDesiredSize, aReflowState, *tableFrame,
aStatus);
if (aPresContext->IsPaginated() && !NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
ShouldAvoidBreakInside(aReflowState)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
}
// just set our width to what was available. The table will calculate the width and not use our value.
aDesiredSize.width = aReflowState.availableWidth;

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

@ -1017,7 +1017,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsTableFrame* aTableFrame,
nsReflowStatus& aStatus)
nsReflowStatus& aStatus,
bool aRowForcedPageBreak)
{
NS_PRECONDITION(aPresContext->IsPaginated(), "SplitRowGroup currently supports only paged media");
@ -1080,6 +1081,12 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
rowFrame->DidReflow(aPresContext, nullptr, NS_FRAME_REFLOW_FINISHED);
rowFrame->DidResize();
if (!aRowForcedPageBreak && !NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
ShouldAvoidBreakInside(aReflowState)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
break;
}
nsTableFrame::InvalidateTableFrame(rowFrame, oldRowRect,
oldRowVisualOverflow,
false);
@ -1110,7 +1117,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
// style than its content, or (3) it contains a rowspan >1 cell which hasn't been
// reflowed with a constrained height yet (we will find out when SplitSpanningCells is
// called below)
if (rowMetrics.height > availSize.height) {
if (rowMetrics.height > availSize.height ||
(NS_INLINE_IS_BREAK_BEFORE(aStatus) && !aRowForcedPageBreak)) {
// cases (1) and (2)
if (isTopOfPage) {
// We're on top of the page, so keep the row on this page. There will be data loss.
@ -1140,6 +1148,10 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
nscoord spanningRowBottom = availHeight;
if (!rowIsOnPage) {
NS_ASSERTION(!contRow, "We should not have created a continuation if none of this row fits");
if (!aRowForcedPageBreak && ShouldAvoidBreakInside(aReflowState)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
break;
}
if (prevRowFrame) {
spanningRowBottom = prevRowFrame->GetRect().YMost();
lastRowThisPage = prevRowFrame;
@ -1292,15 +1304,17 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
bool specialReflow = (bool)aReflowState.mFlags.mSpecialHeightReflow;
((nsHTMLReflowState::ReflowStateFlags&)aReflowState.mFlags).mSpecialHeightReflow = false;
SplitRowGroup(aPresContext, aDesiredSize, aReflowState, tableFrame, aStatus);
SplitRowGroup(aPresContext, aDesiredSize, aReflowState, tableFrame, aStatus,
splitDueToPageBreak);
((nsHTMLReflowState::ReflowStateFlags&)aReflowState.mFlags).mSpecialHeightReflow = specialReflow;
}
// If we have a next-in-flow, then we're not complete
// XXXldb This used to be done only for the incremental reflow codepath.
if (GetNextInFlow()) {
aStatus = NS_FRAME_NOT_COMPLETE;
// XXXmats The following is just bogus. We leave it here for now because
// ReflowChildren should pull up rows from our next-in-flow before returning
// a Complete status, but doesn't (bug 804888).
if (GetNextInFlow() && GetNextInFlow()->GetFirstPrincipalChild()) {
NS_FRAME_SET_INCOMPLETE(aStatus);
}
SetHasStyleHeight((NS_UNCONSTRAINEDSIZE != aReflowState.ComputedHeight()) &&

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

@ -373,7 +373,8 @@ protected:
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsTableFrame* aTableFrame,
nsReflowStatus& aStatus);
nsReflowStatus& aStatus,
bool aRowForcedPageBreak);
void SplitSpanningCells(nsPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,