mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 05:45:33 +00:00
Bug 434733: Don't apply width on colgroups to columns that have their own width. r=dbaron
This commit is contained in:
parent
7fbb9db0a5
commit
63a9fda84f
12
layout/reftests/table-width/colgroup-vs-column-1-ref.html
Normal file
12
layout/reftests/table-width/colgroup-vs-column-1-ref.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Testcase for width attribute of colgroup element (bug 434733)</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table border="1">
|
||||||
|
<colgroup><col width="200"/><col width="400"/></colgroup>
|
||||||
|
<tr><td>width is 200</td><td>width is 400</td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
12
layout/reftests/table-width/colgroup-vs-column-1.html
Normal file
12
layout/reftests/table-width/colgroup-vs-column-1.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Testcase for width attribute of colgroup element (bug 434733)</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table border="1">
|
||||||
|
<colgroup width="400"><col width="200"/><col/></colgroup>
|
||||||
|
<tr><td>width is 200</td><td>width is 400</td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
12
layout/reftests/table-width/colgroup-vs-column-2-ref.html
Normal file
12
layout/reftests/table-width/colgroup-vs-column-2-ref.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Testcase for width attribute of colgroup element (bug 434733)</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table border="1" width="600">
|
||||||
|
<colgroup><col width="20%"/><col width="40%"/><col width="40%"/></colgroup>
|
||||||
|
<tr><td>width is 20%</td><td>width is 40%</td><td>width is 40%</td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
12
layout/reftests/table-width/colgroup-vs-column-2.html
Normal file
12
layout/reftests/table-width/colgroup-vs-column-2.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Testcase for width attribute of colgroup element (bug 434733)</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table border="1" width="600">
|
||||||
|
<colgroup width="40%"><col width="20%"/><col/><col/></colgroup>
|
||||||
|
<tr><td>width is 20%</td><td>width is 40%</td><td>width is 40%</td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -54,3 +54,5 @@ fails == default-box-sizing-collapse-quirks.html default-box-sizing-collapse-qui
|
|||||||
== spanning-cell-sort-2-large.html spanning-cell-sort-2-ref.html
|
== spanning-cell-sort-2-large.html spanning-cell-sort-2-ref.html
|
||||||
== spanning-cell-sort-2-small-fixed.html spanning-cell-sort-2-fixed-ref.html
|
== spanning-cell-sort-2-small-fixed.html spanning-cell-sort-2-fixed-ref.html
|
||||||
== spanning-cell-sort-2-large-fixed.html spanning-cell-sort-2-fixed-ref.html
|
== spanning-cell-sort-2-large-fixed.html spanning-cell-sort-2-fixed-ref.html
|
||||||
|
== colgroup-vs-column-1.html colgroup-vs-column-1-ref.html
|
||||||
|
== colgroup-vs-column-2.html colgroup-vs-column-2-ref.html
|
||||||
|
@ -273,14 +273,18 @@ BasicTableLayoutStrategy::ComputeColumnIntrinsicWidths(nsIRenderingContext* aRen
|
|||||||
// Consider the widths on the column-group. Note that we follow
|
// Consider the widths on the column-group. Note that we follow
|
||||||
// what the HTML spec says here, and make the width apply to
|
// what the HTML spec says here, and make the width apply to
|
||||||
// each column in the group, not the group as a whole.
|
// each column in the group, not the group as a whole.
|
||||||
// XXX Should we be doing this when we have widths on the column?
|
|
||||||
NS_ASSERTION(colFrame->GetParent()->GetType() ==
|
// If column has width, column-group doesn't override width.
|
||||||
nsGkAtoms::tableColGroupFrame,
|
if (colInfo.minCoord == 0 && colInfo.prefCoord == 0 &&
|
||||||
"expected a column-group");
|
colInfo.prefPercent == 0.0f) {
|
||||||
colInfo = GetColWidthInfo(aRenderingContext, colFrame->GetParent());
|
NS_ASSERTION(colFrame->GetParent()->GetType() ==
|
||||||
colFrame->AddCoords(colInfo.minCoord, colInfo.prefCoord,
|
nsGkAtoms::tableColGroupFrame,
|
||||||
colInfo.hasSpecifiedWidth);
|
"expected a column-group");
|
||||||
colFrame->AddPrefPercent(colInfo.prefPercent);
|
colInfo = GetColWidthInfo(aRenderingContext, colFrame->GetParent());
|
||||||
|
colFrame->AddCoords(colInfo.minCoord, colInfo.prefCoord,
|
||||||
|
colInfo.hasSpecifiedWidth);
|
||||||
|
colFrame->AddPrefPercent(colInfo.prefPercent);
|
||||||
|
}
|
||||||
|
|
||||||
// Consider the contents of and the widths on the cells without
|
// Consider the contents of and the widths on the cells without
|
||||||
// colspans.
|
// colspans.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user