bug 105268 - set NS_FRAME_OUTSIDE_CHILDREN on row when cells have rowspan>1 so that painting will not clip to row. sr=attinasi, r=alexsavulov

This commit is contained in:
karnaze%netscape.com 2001-10-22 22:21:19 +00:00
Родитель 8151ac9885
Коммит 4d391277b8
4 изменённых файлов: 60 добавлений и 0 удалений

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

@ -169,6 +169,27 @@ nsTableRowFrame::Init(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsTableRowFrame::SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
// see if the row has a cell with a row span > 1
for (nsIFrame* kidFrame = mFrames.FirstChild();
kidFrame && !(mState & NS_FRAME_OUTSIDE_CHILDREN);
kidFrame->GetNextSibling(&kidFrame)) {
nsCOMPtr<nsIAtom> frameType;
kidFrame->GetFrameType(getter_AddRefs(frameType));
if (nsLayoutAtoms::tableCellFrame == frameType.get()) {
if (((nsTableCellFrame*)kidFrame)->GetRowSpan() > 1) {
mState |= NS_FRAME_OUTSIDE_CHILDREN;
}
}
}
return rv;
}
NS_IMETHODIMP
nsTableRowFrame::AppendFrames(nsIPresContext* aPresContext,
nsIPresShell& aPresShell,
@ -189,6 +210,9 @@ nsTableRowFrame::AppendFrames(nsIPresContext* aPresContext,
tableFrame->AppendCell(*aPresContext, (nsTableCellFrame&)*childFrame, GetRowIndex());
// XXX this could be optimized with some effort
tableFrame->SetNeedStrategyInit(PR_TRUE);
if (!(mState & NS_FRAME_OUTSIDE_CHILDREN) && (((nsTableCellFrame*)childFrame)->GetRowSpan() > 1)) {
mState |= NS_FRAME_OUTSIDE_CHILDREN;
}
}
}
@ -221,6 +245,9 @@ nsTableRowFrame::InsertFrames(nsIPresContext* aPresContext,
cellChildren.AppendElement(childFrame);
// XXX this could be optimized with some effort
tableFrame->SetNeedStrategyInit(PR_TRUE);
if (!(mState & NS_FRAME_OUTSIDE_CHILDREN) && (((nsTableCellFrame*)childFrame)->GetRowSpan() > 1)) {
mState |= NS_FRAME_OUTSIDE_CHILDREN;
}
}
}
// insert the cells into the cell map

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

@ -72,6 +72,9 @@ public:
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,

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

@ -169,6 +169,27 @@ nsTableRowFrame::Init(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsTableRowFrame::SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
// see if the row has a cell with a row span > 1
for (nsIFrame* kidFrame = mFrames.FirstChild();
kidFrame && !(mState & NS_FRAME_OUTSIDE_CHILDREN);
kidFrame->GetNextSibling(&kidFrame)) {
nsCOMPtr<nsIAtom> frameType;
kidFrame->GetFrameType(getter_AddRefs(frameType));
if (nsLayoutAtoms::tableCellFrame == frameType.get()) {
if (((nsTableCellFrame*)kidFrame)->GetRowSpan() > 1) {
mState |= NS_FRAME_OUTSIDE_CHILDREN;
}
}
}
return rv;
}
NS_IMETHODIMP
nsTableRowFrame::AppendFrames(nsIPresContext* aPresContext,
nsIPresShell& aPresShell,
@ -189,6 +210,9 @@ nsTableRowFrame::AppendFrames(nsIPresContext* aPresContext,
tableFrame->AppendCell(*aPresContext, (nsTableCellFrame&)*childFrame, GetRowIndex());
// XXX this could be optimized with some effort
tableFrame->SetNeedStrategyInit(PR_TRUE);
if (!(mState & NS_FRAME_OUTSIDE_CHILDREN) && (((nsTableCellFrame*)childFrame)->GetRowSpan() > 1)) {
mState |= NS_FRAME_OUTSIDE_CHILDREN;
}
}
}
@ -221,6 +245,9 @@ nsTableRowFrame::InsertFrames(nsIPresContext* aPresContext,
cellChildren.AppendElement(childFrame);
// XXX this could be optimized with some effort
tableFrame->SetNeedStrategyInit(PR_TRUE);
if (!(mState & NS_FRAME_OUTSIDE_CHILDREN) && (((nsTableCellFrame*)childFrame)->GetRowSpan() > 1)) {
mState |= NS_FRAME_OUTSIDE_CHILDREN;
}
}
}
// insert the cells into the cell map

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

@ -72,6 +72,9 @@ public:
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
nsIPresShell& aPresShell,
nsIAtom* aListName,