зеркало из https://github.com/mozilla/gecko-dev.git
Bug 542620. Need to paint the table background if columns or column-groups have backgrounds. r=dbaron
--HG-- extra : rebase_source : aebb3f9c4c83d2eecc779939e87dcf7195f5d103
This commit is contained in:
Родитель
67692a0491
Коммит
f69799234f
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<tr><td style="background:lime; width:100px; height:100px;"></td></tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr><td style="background:lime; width:100px; height:100px;"></td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<col style="background: lime"></col>
|
||||||
|
<tr><td style="width:100px; height:100px;"></td></tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<colgroup style="background: lime"></colgroup>
|
||||||
|
<tr><td style="width:100px; height:100px;"></td></tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1381,4 +1381,5 @@ fails HTTP(..) == 518172-2b.html 518172-b-ref.html # bug 518172
|
||||||
== 537471-1.html 537471-1-ref.html
|
== 537471-1.html 537471-1-ref.html
|
||||||
== 538935-1.html 538935-1-ref.html
|
== 538935-1.html 538935-1-ref.html
|
||||||
== 539226-1.html about:blank
|
== 539226-1.html about:blank
|
||||||
|
== 542620-1.html 542620-1-ref.html
|
||||||
== 541382-1.html 541382-1-ref.html
|
== 541382-1.html 541382-1-ref.html
|
||||||
|
|
|
@ -1273,28 +1273,23 @@ IsFrameAllowedInTable(nsIAtom* aType)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static PRBool
|
static PRBool
|
||||||
AnyTablePartHasBorderOrBackground(nsIFrame* aFrame)
|
AnyTablePartHasBorderOrBackground(const nsFrameList& aFrames)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(IsFrameAllowedInTable(aFrame->GetType()), "unexpected frame type");
|
for (nsFrameList::Enumerator e(aFrames); !e.AtEnd(); e.Next()) {
|
||||||
|
nsIFrame* f = e.get();
|
||||||
|
NS_ASSERTION(IsFrameAllowedInTable(f->GetType()), "unexpected frame type");
|
||||||
|
|
||||||
nsIScrollableFrame *scrollFrame = do_QueryFrame(aFrame);
|
if (f->GetStyleVisibility()->IsVisible() &&
|
||||||
if (scrollFrame) {
|
(!f->GetStyleBackground()->IsTransparent() ||
|
||||||
return AnyTablePartHasBorderOrBackground(scrollFrame->GetScrolledFrame());
|
f->GetStyleDisplay()->mAppearance ||
|
||||||
}
|
f->HasBorder()))
|
||||||
|
|
||||||
if (aFrame->GetStyleVisibility()->IsVisible() &&
|
|
||||||
(!aFrame->GetStyleBackground()->IsTransparent() ||
|
|
||||||
aFrame->GetStyleDisplay()->mAppearance ||
|
|
||||||
aFrame->HasBorder()))
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
||||||
nsTableCellFrame *cellFrame = do_QueryFrame(aFrame);
|
nsTableCellFrame *cellFrame = do_QueryFrame(f);
|
||||||
if (cellFrame)
|
if (cellFrame)
|
||||||
return PR_FALSE;
|
continue;
|
||||||
|
|
||||||
nsFrameList children = aFrame->GetChildList(nsnull);
|
if (AnyTablePartHasBorderOrBackground(f->GetChildList(nsnull)))
|
||||||
for (nsIFrame* f = children.FirstChild(); f; f = f->GetNextSibling()) {
|
|
||||||
if (AnyTablePartHasBorderOrBackground(f))
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1331,7 +1326,8 @@ nsTableFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
// Specific visibility decisions are delegated to the table background
|
// Specific visibility decisions are delegated to the table background
|
||||||
// painter, which handles borders and backgrounds for the table.
|
// painter, which handles borders and backgrounds for the table.
|
||||||
if (aBuilder->IsForEventDelivery() ||
|
if (aBuilder->IsForEventDelivery() ||
|
||||||
AnyTablePartHasBorderOrBackground(this)) {
|
AnyTablePartHasBorderOrBackground(nsFrameList(this, GetNextSibling())) ||
|
||||||
|
AnyTablePartHasBorderOrBackground(mColGroups)) {
|
||||||
item = new (aBuilder) nsDisplayTableBorderBackground(this);
|
item = new (aBuilder) nsDisplayTableBorderBackground(this);
|
||||||
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
|
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче