зеркало из https://github.com/mozilla/pjs.git
Fix regression in sizing of tables with scrollable rowgroups. Bug 387344,
r=bernd, sr=roc
This commit is contained in:
Родитель
2ae9a7619b
Коммит
baf912fed6
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<tbody style="height: 100px; overflow: scroll; font-size: 20px">
|
||||||
|
<tr><td>Test 1</td></tr>
|
||||||
|
<tr><td>Test 2</td></tr>
|
||||||
|
<tr><td>Test 3</td></tr>
|
||||||
|
<tr><td>Test 4</td></tr>
|
||||||
|
<tr><td>Test 5</td></tr>
|
||||||
|
<tr><td>Test 6</td></tr>
|
||||||
|
<tr><td>Test 7</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
This text should be right up against the table.
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<tbody style="height: 100px; overflow: scroll; font-size: 20px">
|
||||||
|
<tr><td>Test 1</td></tr>
|
||||||
|
<tr><td>Test 2</td></tr>
|
||||||
|
<tr><td>Test 3</td></tr>
|
||||||
|
<tr><td>Test 4</td></tr>
|
||||||
|
<tr><td>Test 5</td></tr>
|
||||||
|
<tr><td>Test 6</td></tr>
|
||||||
|
<tr><td>Test 7</td></tr>
|
||||||
|
<tr><td>Test 8</td></tr>
|
||||||
|
<tr><td>Test 9</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
This text should be right up against the table.
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -276,3 +276,4 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 379316-2.html 379316-2-ref.html # bug
|
||||||
== 382600-1.html 382600-1-ref.html
|
== 382600-1.html 382600-1-ref.html
|
||||||
== 383551-1.html 383551-1-ref.html
|
== 383551-1.html 383551-1-ref.html
|
||||||
== 384576-1.html 384576-1-ref.html
|
== 384576-1.html 384576-1-ref.html
|
||||||
|
== 387344-1.html 387344-1-ref.html
|
||||||
|
|
|
@ -3085,9 +3085,14 @@ nsTableFrame::CalcDesiredHeight(const nsHTMLReflowState& aReflowState, nsHTMLRef
|
||||||
nsMargin borderPadding = GetChildAreaOffset(&aReflowState);
|
nsMargin borderPadding = GetChildAreaOffset(&aReflowState);
|
||||||
|
|
||||||
// get the natural height based on the last child's (row group or scroll frame) rect
|
// get the natural height based on the last child's (row group or scroll frame) rect
|
||||||
RowGroupArray rowGroups;
|
FrameArray rowGroups;
|
||||||
OrderRowGroups(rowGroups);
|
PRUint32 numRowGroups;
|
||||||
if (rowGroups.Length() == 0) {
|
{
|
||||||
|
// Scope for the dummies so we don't use them by accident
|
||||||
|
nsTableRowGroupFrame *dummy1, *dummy2;
|
||||||
|
numRowGroups = OrderRowGroups(rowGroups, &dummy1, &dummy2);
|
||||||
|
}
|
||||||
|
if (numRowGroups == 0) {
|
||||||
// tables can be used as rectangular items without content
|
// tables can be used as rectangular items without content
|
||||||
nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aReflowState);
|
nscoord tableSpecifiedHeight = CalcBorderBoxHeight(aReflowState);
|
||||||
if ((NS_UNCONSTRAINEDSIZE != tableSpecifiedHeight) &&
|
if ((NS_UNCONSTRAINEDSIZE != tableSpecifiedHeight) &&
|
||||||
|
@ -3105,7 +3110,7 @@ nsTableFrame::CalcDesiredHeight(const nsHTMLReflowState& aReflowState, nsHTMLRef
|
||||||
nscoord desiredHeight = borderPadding.top + borderPadding.bottom;
|
nscoord desiredHeight = borderPadding.top + borderPadding.bottom;
|
||||||
if (rowCount > 0 && colCount > 0) {
|
if (rowCount > 0 && colCount > 0) {
|
||||||
desiredHeight += cellSpacingY;
|
desiredHeight += cellSpacingY;
|
||||||
for (PRUint32 rgX = 0; rgX < rowGroups.Length(); rgX++) {
|
for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) {
|
||||||
desiredHeight += rowGroups[rgX]->GetSize().height + cellSpacingY;
|
desiredHeight += rowGroups[rgX]->GetSize().height + cellSpacingY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче