Make sure to reflow the caption if it gets inserted into our table before another caption. Bug 389924, r=bernd, sr+a=dbaron

This commit is contained in:
bzbarsky@mit.edu 2007-08-02 14:34:58 -07:00
Родитель 331a767fbd
Коммит 725f9f32fc
4 изменённых файлов: 54 добавлений и 0 удалений

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

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<body>
<table id="table"><caption>THIS SHOULD BE VISIBLE</caption><tbody></tbody></table>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var table = document.getElementById("table");
var newCaption = document.createElement('caption');
newCaption.appendChild(document.createTextNode("THIS SHOULD BE VISIBLE"));
table.insertBefore(newCaption, table.firstChild);
}
</script>
</head>
<body onload="boom();">
<table id="table"><tbody></tbody></table>
</body>
</html>

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

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var table = document.getElementById("table");
var newCaption = document.createElement('caption');
newCaption.appendChild(document.createTextNode("THIS SHOULD BE VISIBLE"));
table.appendChild(newCaption);
table.appendChild(document.createElement("tbody"));
}
</script>
</head>
<body onload="boom();">
<table id="table"></table>
</body>
</html>

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

@ -325,6 +325,12 @@ nsTableOuterFrame::InsertFrames(nsIAtom* aListName,
"inserting non-caption frame into captionList");
mCaptionFrames.InsertFrames(nsnull, aPrevFrame, aFrameList);
mCaptionFrame = mCaptionFrames.FirstChild();
// Reflow the new caption frame. It's already marked dirty, so
// just tell the pres shell.
PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eTreeChange,
NS_FRAME_HAS_DIRTY_CHILDREN);
return NS_OK;
}
else {