Skip to content
Browse files

bug 531200 - always set the desiredHeight, also if SplitSpanningCells…

… does not split any cell r=dholbert
  • Loading branch information...
1 parent 6bcc8b1 commit c9d0698d6b4adbd48f037952cac76f8289a75c17 Bernd committed Dec 27, 2011
View
38 layout/reftests/bugs/531200-1-ref.html
@@ -0,0 +1,38 @@
+<html class="reftest-print">
+<head>
+<title>push rowspan on to next page if it can't be splitted</title>
+<style>
+img {
+ width: 10px;
+ height: 30px;
+}
+</style>
+</head>
+<body>
+ <div style="height: 110px"></div>
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td></td>
+ <td>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ </tr>
+ <tr style="page-break-after:always">
+ <td>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="2">
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ <td rowspan="2"></td>
+ </tr>
+ <tr>
+ <td>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ </tr>
+ </table>
+</body>
+</html>
View
38 layout/reftests/bugs/531200-1.html
@@ -0,0 +1,38 @@
+<html class="reftest-print">
+<head>
+<title>push rowspan on to next page if it can't be splitted</title>
+<style>
+img {
+ width: 10px;
+ height: 30px;
+}
+</style>
+</head>
+<body>
+ <div style="height: 110px"></div>
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td></td>
+ <td>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="2">
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ <td rowspan="2"></td>
+ </tr>
+ <tr>
+ <td>
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF/wAAAAAAQaMSAwAAABJJREFUeNpiYBgFo2AwAIAAAwACigABtnCV2AAAAABJRU5ErkJggg==">
+ </td>
+ </tr>
+ </table>
+</body>
+</html>
View
1 layout/reftests/bugs/reftest.list
@@ -1445,6 +1445,7 @@ random-if(d2d) == 523468-1.html 523468-1-ref.html
== 528096-1.html 528096-1-ref.html
== 530686-1.html 530686-1-ref.html
== 531098-1.html 531098-1-ref.html
+== 531200-1.html 531200-1-ref.html
== 531371-1.html 531371-1-ref.html
== 534526-1a.html 534526-1-ref.html
== 534526-1b.html 534526-1-ref.html
View
5 layout/tables/nsTableRowGroupFrame.cpp
@@ -955,6 +955,7 @@ nsTableRowGroupFrame::SplitSpanningCells(nsPresContext& aPresContext,
static_cast<nsTableFrame*>(aTable.GetFirstInFlow())->IsBorderCollapse();
PRInt32 lastRowIndex = aLastRow.GetRowIndex();
bool wasLast = false;
+ bool haveRowSpan = false;
// Iterate the rows between aFirstRow and aLastRow
for (nsTableRowFrame* row = &aFirstRow; !wasLast; row = row->GetNextRow()) {
wasLast = (row == &aLastRow);
@@ -966,6 +967,7 @@ nsTableRowGroupFrame::SplitSpanningCells(nsPresContext& aPresContext,
// Only reflow rowspan > 1 cells which span aLastRow. Those which don't span aLastRow
// were reflowed correctly during the unconstrained height reflow.
if ((rowSpan > 1) && (rowIndex + rowSpan > lastRowIndex)) {
+ haveRowSpan = true;
nsReflowStatus status;
// Ask the row to reflow the cell to the height of all the rows it spans up through aLastRow
// aAvailHeight is the space between the row group start and the end of the page
@@ -1021,6 +1023,9 @@ nsTableRowGroupFrame::SplitSpanningCells(nsPresContext& aPresContext,
}
}
}
+ if (!haveRowSpan) {
+ aDesiredHeight = aLastRow.GetRect().YMost();
+ }
}
// Remove the next-in-flow of the row, its cells and their cell blocks. This

0 comments on commit c9d0698

Please sign in to comment.
Something went wrong with that request. Please try again.