The parent style context frame determination for an inner table should use theinner table's pseudo, not the outer table's. Bug 377603, r+sr=dbaron

This commit is contained in:
bzbarsky@mit.edu 2007-04-15 22:55:42 -07:00
Родитель 0e8f9f1d80
Коммит 47dbe616f7
4 изменённых файлов: 61 добавлений и 4 удалений

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

@ -5463,10 +5463,15 @@ GetCorrectedParent(nsPresContext* aPresContext, nsIFrame* aFrame,
if (!parent) {
*aSpecialParent = nsnull;
} else {
*aSpecialParent =
nsFrame::CorrectStyleParentFrame(parent,
aFrame->GetStyleContext()->
GetPseudoType());
nsIAtom* pseudo = aFrame->GetStyleContext()->GetPseudoType();
// Outer tables are always anon boxes; if we're in here for an outer
// table, that actually means its the _inner_ table that wants to
// know its parent. So get the pseudo of the inner in that case.
if (pseudo == nsCSSAnonBoxes::tableOuter) {
pseudo =
aFrame->GetFirstChild(nsnull)->GetStyleContext()->GetPseudoType();
}
*aSpecialParent = nsFrame::CorrectStyleParentFrame(parent, pseudo);
}
return NS_OK;

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<head>
<style>
table table
{ border-collapse: collapse; border-style: solid; border-width: 10px;
border-color: green }
</style>
</head>
</head>
<body>
<table><tr>
<td>
<table>
<tr><td></td></tr>
</table>
<table>
<tr><td></td></tr>
</table>
</td>
</tr></table>
</body>
</html>

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

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<head>
<style>
table table
{ border-collapse: collapse; border-style: solid; border-width: 10px }
</style>
</head>
</head>
<body>
<table><tr>
<td style="border: 0px solid green; color: red">
<table style="border-color: inherit">
<tr><td></td></tr>
</table>
<table id="test">
<tr><td></td></tr>
</table>
<script>
document.body.offsetWidth;
document.getElementById("test").style.borderColor = "inherit";
</script>
</td>
</tr></table>
</body>
</html>

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

@ -216,3 +216,4 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 372037-1.html 372037-1-ref.html # bug 3
== 374038-2.xul 374038-2-ref.xul
== 374193-1.xhtml about:blank
fails == 376484-1.html 376484-1-ref.html
== 377603-1.html 377603-1-ref.html