Fix bug 371925 -- we need to allow for the case when the prev sibling is at

index 0.  r=bernd, sr=roc
This commit is contained in:
bzbarsky%mit.edu 2007-02-28 22:42:20 +00:00
Родитель 5bc00870a9
Коммит 481c2affc3
5 изменённых файлов: 68 добавлений и 2 удалений

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

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<body>
<table id="theTable" border="1">
<thead id="thead">
<tr><th>Header</th></tr>
</thead>
<tbody><tr><td id="body">BODY</td></tr></tbody>
</table>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<body>
<table id="theTable" border="1"><thead id="thead">
<tr><th>Header</th></tr>
</thead>
<tfoot id="tfoot"><tr><th>Footer</th></tr></tfoot>
<tbody><tr><td id="body">BODY</td></tr></tbody>
</table>
<script>
var style = document.getElementById('tfoot').style;
style.display = "none";
document.body.offsetWidth;
style.display = "table-footer-group";
document.body.offsetWidth;
style.display = "none";
</script>
</body>
</html>

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

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<body>
<table id="theTable" border="1">
<thead id="thead">
<tr><th>Header</th></tr>
</thead>
<tfoot id="tfoot"><tr><th>Footer</th></tr></tfoot>
<tbody><tr><td id="body">BODY</td></tr></tbody>
</table>
<script>
var style = document.getElementById('tfoot').style;
style.display = "none";
document.body.offsetWidth;
style.display = "table-footer-group";
document.body.offsetWidth;
style.display = "none";
</script>
</body>
</html>

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

@ -157,3 +157,5 @@ fails == 368020-4.html 368020-4-ref.html # bug 368085
== 370629-1.html 370629-1-ref.html
== 370629-2.html 370629-2-ref.html
== 370692-1.xhtml 370692-1-ref.xhtml
== 371925-1a.html 371925-1-ref.html
== 371925-1b.html 371925-1-ref.html

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

@ -2284,8 +2284,12 @@ nsTableFrame::InsertFrames(nsIAtom* aListName,
const nsStyleDisplay* display = aFrameList->GetStyleDisplay();
if (aPrevFrame) {
const nsStyleDisplay* prevDisplay = aPrevFrame->GetStyleDisplay();
if (display->mDisplay != prevDisplay->mDisplay) {
// Make sure they belong on the same frame list
if ((display->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP) !=
(prevDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP)) {
// the previous frame is not valid, see comment at ::AppendFrames
// XXXbz Using content indices here means XBL will get screwed
// over... Oh, well.
nsIFrame* pseudoFrame = aFrameList;
nsIContent* parentContent = GetContent();
nsIContent* content;
@ -2305,7 +2309,8 @@ nsTableFrame::InsertFrames(nsIAtom* aListName,
else {
kidFrame = mFrames.FirstChild();
}
PRInt32 lastIndex = 0;
// Important: need to start at a value smaller than all valid indices
PRInt32 lastIndex = -1;
while (kidFrame) {
if (isColGroup) {
nsTableColGroupType groupType =