зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1213465 - Combine DrawResults correctly in nsTablePainter. r=tn
This commit is contained in:
Родитель
0cbfd90dd3
Коммит
7a15424022
|
@ -189,15 +189,6 @@ TableBackgroundPainter::~TableBackgroundPainter()
|
|||
MOZ_COUNT_DTOR(TableBackgroundPainter);
|
||||
}
|
||||
|
||||
static void
|
||||
UpdateDrawResult(DrawResult* aCurrentResult, DrawResult aNewResult)
|
||||
{
|
||||
MOZ_ASSERT(aCurrentResult);
|
||||
if (*aCurrentResult == DrawResult::SUCCESS) {
|
||||
*aCurrentResult = aNewResult;
|
||||
}
|
||||
}
|
||||
|
||||
DrawResult
|
||||
TableBackgroundPainter::PaintTableFrame(nsTableFrame* aTableFrame,
|
||||
nsTableRowGroupFrame* aFirstRowGroup,
|
||||
|
@ -367,9 +358,8 @@ TableBackgroundPainter::PaintTable(nsTableFrame* aTableFrame,
|
|||
nsRect rgNormalRect = rgVisualOverflow + rg->GetNormalPosition();
|
||||
|
||||
if (rgOverflowRect.Union(rgNormalRect).Intersects(mDirtyRect - mRenderPt)) {
|
||||
DrawResult rowGroupResult =
|
||||
result &=
|
||||
PaintRowGroup(rg, rowGroupBGData, rg->IsPseudoStackingContextFromStyle());
|
||||
UpdateDrawResult(&result, rowGroupResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -458,11 +448,9 @@ TableBackgroundPainter::PaintRowGroup(nsTableRowGroupFrame* aFrame,
|
|||
break;
|
||||
}
|
||||
|
||||
DrawResult rowResult =
|
||||
result &=
|
||||
PaintRow(row, aRowGroupBGData, rowBackgroundData,
|
||||
aPassThrough || row->IsPseudoStackingContextFromStyle());
|
||||
|
||||
UpdateDrawResult(&result, rowResult);
|
||||
}
|
||||
|
||||
/* translate back into table coord system */
|
||||
|
@ -533,11 +521,9 @@ TableBackgroundPainter::PaintRow(nsTableRowFrame* aFrame,
|
|||
|
||||
if (combinedRect.Intersects(mDirtyRect)) {
|
||||
bool passCell = aPassThrough || cell->IsPseudoStackingContextFromStyle();
|
||||
DrawResult cellResult =
|
||||
PaintCell(cell, aRowGroupBGData, aRowBGData,
|
||||
cellBGRect, rowBGRect, rowGroupBGRect, colBGRect, passCell);
|
||||
|
||||
UpdateDrawResult(&result, cellResult);
|
||||
result &=
|
||||
PaintCell(cell, aRowGroupBGData, aRowBGData, cellBGRect, rowBGRect,
|
||||
rowGroupBGRect, colBGRect, passCell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -580,58 +566,53 @@ TableBackgroundPainter::PaintCell(nsTableCellFrame* aCell,
|
|||
|
||||
//Paint column group background
|
||||
if (haveColumns && mCols[colIndex].mColGroup.IsVisible()) {
|
||||
DrawResult colGroupResult =
|
||||
result &=
|
||||
nsCSSRendering::PaintBackgroundWithSC(mPresContext, mRenderingContext,
|
||||
mCols[colIndex].mColGroup.mFrame, mDirtyRect,
|
||||
mCols[colIndex].mColGroup.mRect + mRenderPt,
|
||||
mCols[colIndex].mColGroup.mFrame->StyleContext(),
|
||||
mCols[colIndex].mColGroup.StyleBorder(mZeroBorder),
|
||||
mBGPaintFlags, &aColBGRect);
|
||||
UpdateDrawResult(&result, colGroupResult);
|
||||
}
|
||||
|
||||
//Paint column background
|
||||
if (haveColumns && mCols[colIndex].mCol.IsVisible()) {
|
||||
DrawResult colResult =
|
||||
result &=
|
||||
nsCSSRendering::PaintBackgroundWithSC(mPresContext, mRenderingContext,
|
||||
mCols[colIndex].mCol.mFrame, mDirtyRect,
|
||||
mCols[colIndex].mCol.mRect + mRenderPt,
|
||||
mCols[colIndex].mCol.mFrame->StyleContext(),
|
||||
mCols[colIndex].mCol.StyleBorder(mZeroBorder),
|
||||
mBGPaintFlags, &aColBGRect);
|
||||
UpdateDrawResult(&result, colResult);
|
||||
}
|
||||
|
||||
//Paint row group background
|
||||
if (aRowGroupBGData.IsVisible()) {
|
||||
DrawResult rowGroupResult =
|
||||
result &=
|
||||
nsCSSRendering::PaintBackgroundWithSC(mPresContext, mRenderingContext,
|
||||
aRowGroupBGData.mFrame, mDirtyRect,
|
||||
aRowGroupBGData.mRect + mRenderPt,
|
||||
aRowGroupBGData.mFrame->StyleContext(),
|
||||
aRowGroupBGData.StyleBorder(mZeroBorder),
|
||||
mBGPaintFlags, &aRowGroupBGRect);
|
||||
UpdateDrawResult(&result, rowGroupResult);
|
||||
}
|
||||
|
||||
//Paint row background
|
||||
if (aRowBGData.IsVisible()) {
|
||||
DrawResult rowResult =
|
||||
result &=
|
||||
nsCSSRendering::PaintBackgroundWithSC(mPresContext, mRenderingContext,
|
||||
aRowBGData.mFrame, mDirtyRect,
|
||||
aRowBGData.mRect + mRenderPt,
|
||||
aRowBGData.mFrame->StyleContext(),
|
||||
aRowBGData.StyleBorder(mZeroBorder),
|
||||
mBGPaintFlags, &aRowBGRect);
|
||||
UpdateDrawResult(&result, rowResult);
|
||||
}
|
||||
|
||||
//Paint cell background in border-collapse unless we're just passing
|
||||
if (mIsBorderCollapse && !aPassSelf) {
|
||||
DrawResult cellResult =
|
||||
result &=
|
||||
aCell->PaintCellBackground(mRenderingContext, mDirtyRect,
|
||||
aCellBGRect.TopLeft(), mBGPaintFlags);
|
||||
UpdateDrawResult(&result, cellResult);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Загрузка…
Ссылка в новой задаче