1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is TableBackgroundPainter implementation.
17 * The Initial Developer of the Original Code is
18 * Elika J. Etemad ("fantasai") <fantasai@inkedblade.net>.
19 * Portions created by the Initial Developer are Copyright (C) 2004
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsTableFrame.h"
39 #include "nsTableRowGroupFrame.h"
40 #include "nsTableRowFrame.h"
41 #include "nsTableColGroupFrame.h"
42 #include "nsTableColFrame.h"
43 #include "nsTableCellFrame.h"
44 #include "nsTablePainter.h"
45 #include "nsCSSRendering.h"
46 #include "nsDisplayList.h"
48 /* ~*~ Table Background Painting ~*~
50 Mozilla's Table Background painting follows CSS2.1:17.5.1
51 That section does not, however, describe the effect of
52 borders on background image positioning. What we do is:
54 - in separate borders, the borders are passed in so that
55 their width figures in image positioning, even for rows/cols, which
56 don't have visible borders. This is done to allow authors
57 to position row backgrounds by, for example, aligning the
58 top left corner with the top left padding corner of the
59 top left table cell in the row in cases where all cells
60 have consistent border widths. If we didn't honor these
61 invisible borders, there would be no way to align
62 backgrounds with the padding edges, and designs would be
63 lost underneath the border.
65 - in collapsing borders, because the borders collapse, we
66 use the -continuous border- width to synthesize a border
67 style and pass that in instead of using the element's
68 assigned style directly.
70 The continuous border on a given edge of an element is
71 the collapse of all borders guaranteed to be continuous
72 along that edge. Cell borders are ignored (because, for
73 example, setting a thick border on the leftmost cell
74 should not shift the row background over; this way a
75 striped background set on <tr> will line up across rows
76 even if the cells are assigned arbitrary border widths.
78 For example, the continuous border on the top edge of a
79 row group is the collapse of any row group, row, and
80 table borders involved. (The first row group's top would
81 be [table-top + row group top + first row top]. It's bottom
82 would be [row group bottom + last row bottom + next row
83 top + next row group top].)
84 The top edge of a column group likewise includes the
85 table top, row group top, and first row top borders. However,
86 it *also* includes its own top border, since that is guaranteed
87 to be continuous. It does not include column borders because
88 those are not guaranteed to be continuous: there may be two
89 columns with different borders in a single column group.
91 An alternative would be to define the continuous border as
92 [table? + row group + row] for horizontal
93 [table? + col group + col] for vertical
94 This makes it easier to line up backgrounds across elements
95 despite varying border widths, but it does not give much
96 flexibility in aligning /to/ those border widths.
100 /* ~*~ TableBackgroundPainter ~*~
102 The TableBackgroundPainter is created and destroyed in one painting call.
103 Its principal function is PaintTable, which paints all table element
104 backgrounds. The initial code in that method sets up an array of column
105 data that caches the background styles and the border sizes for the
106 columns and colgroups in TableBackgroundData structs in mCols. Data for
107 BC borders are calculated and stashed in a synthesized border style struct
108 in the data struct since collapsed borders aren't the same width as style-
109 assigned borders. The data struct optimizes by only doing this if there's
110 an image background; otherwise we don't care. //XXX should also check background-origin
111 The class then loops through the row groups, rows, and cells. It uses
112 the mRowGroup and mRow TableBackgroundData structs to cache data for
113 the current frame in the loop. At the cell level, it paints the backgrounds,
114 one over the other, inside the cell rect.
116 The exception to this pattern is when a table element creates a (pseudo)
117 stacking context. Elements with stacking contexts (e.g., 'opacity' applied)
118 are <dfn>passed through</dfn>, which means their data (and their
119 descendants' data) are not cached. The full loop is still executed, however,
120 so that underlying layers can get painted at the cell level.
122 The TableBackgroundPainter is then destroyed.
124 Elements with stacking contexts set up their own painter to finish the
125 painting process, since they were skipped. They call the appropriate
126 sub-part of the loop (e.g. PaintRow) which will paint the frame and
127 descendants. Note that it is permissible according to CSS2.1 to ignore'
128 'position:relative' (and implicitly, 'opacity') on table parts so that
129 table parts can never create stacking contexts; if we want to, we can
130 implement that, and then we won't have to deal with TableBackgroundPainter
131 being used anywhere but from the nsTableFrame.
136 TableBackgroundPainter::TableBackgroundData::TableBackgroundData()
142 MOZ_COUNT_CTOR(TableBackgroundData
);
145 TableBackgroundPainter::TableBackgroundData::~TableBackgroundData()
147 NS_ASSERTION(!mSynthBorder
, "must call Destroy before dtor");
148 MOZ_COUNT_DTOR(TableBackgroundData
);
152 TableBackgroundPainter::TableBackgroundData::Destroy(nsPresContext
* aPresContext
)
154 NS_PRECONDITION(aPresContext
, "null prescontext");
156 mSynthBorder
->Destroy(aPresContext
);
157 mSynthBorder
= nsnull
;
162 TableBackgroundPainter::TableBackgroundData::Clear()
167 mBackground
= nsnull
;
171 TableBackgroundPainter::TableBackgroundData::SetFrame(nsIFrame
* aFrame
)
173 NS_PRECONDITION(aFrame
, "null frame");
175 mRect
= aFrame
->GetRect();
179 TableBackgroundPainter::TableBackgroundData::SetData()
181 NS_PRECONDITION(mFrame
, "null frame");
182 if (mFrame
->IsVisibleForPainting()) {
183 mBackground
= mFrame
->GetStyleBackground();
184 mBorder
= mFrame
->GetStyleBorder();
189 TableBackgroundPainter::TableBackgroundData::SetFull(nsIFrame
* aFrame
)
191 NS_PRECONDITION(aFrame
, "null frame");
197 TableBackgroundPainter::TableBackgroundData::ShouldSetBCBorder()
199 /* we only need accurate border data when positioning background images*/
200 return mBackground
&& !(mBackground
->mBackgroundFlags
& NS_STYLE_BG_IMAGE_NONE
);
204 TableBackgroundPainter::TableBackgroundData::SetBCBorder(nsMargin
& aBorder
,
205 TableBackgroundPainter
* aPainter
)
207 NS_PRECONDITION(aPainter
, "null painter");
209 mSynthBorder
= new (aPainter
->mPresContext
)
210 nsStyleBorder(aPainter
->mZeroBorder
);
211 if (!mSynthBorder
) return NS_ERROR_OUT_OF_MEMORY
;
214 NS_FOR_CSS_SIDES(side
) {
215 mSynthBorder
->SetBorderWidth(side
, aBorder
.side(side
));
218 mBorder
= mSynthBorder
;
222 TableBackgroundPainter::TableBackgroundPainter(nsTableFrame
* aTableFrame
,
224 nsPresContext
* aPresContext
,
225 nsIRenderingContext
& aRenderingContext
,
226 const nsRect
& aDirtyRect
,
227 const nsPoint
& aRenderPt
)
228 : mPresContext(aPresContext
),
229 mRenderingContext(aRenderingContext
),
230 mRenderPt(aRenderPt
),
231 mDirtyRect(aDirtyRect
),
234 mZeroBorder(aPresContext
)
236 MOZ_COUNT_CTOR(TableBackgroundPainter
);
238 NS_FOR_CSS_SIDES(side
) {
239 mZeroBorder
.SetBorderStyle(side
, NS_STYLE_BORDER_STYLE_SOLID
);
240 mZeroBorder
.SetBorderWidth(side
, 0);
243 mIsBorderCollapse
= aTableFrame
->IsBorderCollapse();
245 mCompatMode
= mPresContext
->CompatibilityMode();
247 mNumCols
= aTableFrame
->GetColCount();
250 TableBackgroundPainter::~TableBackgroundPainter()
253 TableBackgroundData
* lastColGroup
= nsnull
;
254 for (PRUint32 i
= 0; i
< mNumCols
; i
++) {
255 if (mCols
[i
].mColGroup
!= lastColGroup
) {
256 lastColGroup
= mCols
[i
].mColGroup
;
257 NS_ASSERTION(mCols
[i
].mColGroup
, "colgroup data should not be null - bug 237421");
258 // we need to wallpaper a over zero pointer deref, bug 237421 will have the real fix
260 lastColGroup
->Destroy(mPresContext
);
263 mCols
[i
].mColGroup
= nsnull
;
264 mCols
[i
].mCol
.Destroy(mPresContext
);
268 mRowGroup
.Destroy(mPresContext
);
269 mRow
.Destroy(mPresContext
);
270 MOZ_COUNT_DTOR(TableBackgroundPainter
);
274 TableBackgroundPainter::PaintTableFrame(nsTableFrame
* aTableFrame
,
275 nsTableRowGroupFrame
* aFirstRowGroup
,
276 nsTableRowGroupFrame
* aLastRowGroup
,
279 NS_PRECONDITION(aTableFrame
, "null frame");
280 TableBackgroundData tableData
;
281 tableData
.SetFull(aTableFrame
);
282 tableData
.mRect
.MoveTo(0,0); //using table's coords
284 tableData
.mRect
.Deflate(*aDeflate
);
286 if (mIsBorderCollapse
&& tableData
.ShouldSetBCBorder()) {
287 if (aFirstRowGroup
&& aLastRowGroup
&& mNumCols
> 0) {
288 //only handle non-degenerate tables; we need a more robust BC model
289 //to make degenerate tables' borders reasonable to deal with
290 nsMargin border
, tempBorder
;
291 nsTableColFrame
* colFrame
= aTableFrame
->GetColFrame(mNumCols
- 1);
293 colFrame
->GetContinuousBCBorderWidth(tempBorder
);
295 border
.right
= tempBorder
.right
;
297 aLastRowGroup
->GetContinuousBCBorderWidth(tempBorder
);
298 border
.bottom
= tempBorder
.bottom
;
300 nsTableRowFrame
* rowFrame
= aFirstRowGroup
->GetFirstRow();
302 rowFrame
->GetContinuousBCBorderWidth(tempBorder
);
303 border
.top
= tempBorder
.top
;
306 border
.left
= aTableFrame
->GetContinuousLeftBCBorderWidth();
308 nsresult rv
= tableData
.SetBCBorder(border
, this);
310 tableData
.Destroy(mPresContext
);
315 if (tableData
.IsVisible()) {
316 nsCSSRendering::PaintBackgroundWithSC(mPresContext
, mRenderingContext
,
317 tableData
.mFrame
, mDirtyRect
,
318 tableData
.mRect
+ mRenderPt
,
319 *tableData
.mBackground
,
323 tableData
.Destroy(mPresContext
);
328 TableBackgroundPainter::TranslateContext(nscoord aDX
,
331 mRenderPt
+= nsPoint(aDX
, aDY
);
333 TableBackgroundData
* lastColGroup
= nsnull
;
334 for (PRUint32 i
= 0; i
< mNumCols
; i
++) {
335 mCols
[i
].mCol
.mRect
.MoveBy(-aDX
, -aDY
);
336 if (lastColGroup
!= mCols
[i
].mColGroup
) {
337 NS_ASSERTION(mCols
[i
].mColGroup
, "colgroup data should not be null - bug 237421");
338 // we need to wallpaper a over zero pointer deref, bug 237421 will have the real fix
339 if (!mCols
[i
].mColGroup
)
341 mCols
[i
].mColGroup
->mRect
.MoveBy(-aDX
, -aDY
);
342 lastColGroup
= mCols
[i
].mColGroup
;
349 TableBackgroundPainter::PaintTable(nsTableFrame
* aTableFrame
,
352 NS_PRECONDITION(aTableFrame
, "null table frame");
354 nsTableFrame::RowGroupArray rowGroups
;
355 aTableFrame
->OrderRowGroups(rowGroups
);
357 if (rowGroups
.Length() < 1) { //degenerate case
358 PaintTableFrame(aTableFrame
, nsnull
, nsnull
, nsnull
);
359 /* No cells; nothing else to paint */
363 PaintTableFrame(aTableFrame
, rowGroups
[0], rowGroups
[rowGroups
.Length() - 1],
366 /*Set up column background/border data*/
368 nsFrameList
& colGroupList
= aTableFrame
->GetColGroups();
369 NS_ASSERTION(colGroupList
.FirstChild(), "table should have at least one colgroup");
371 mCols
= new ColData
[mNumCols
];
372 if (!mCols
) return NS_ERROR_OUT_OF_MEMORY
;
374 TableBackgroundData
* cgData
= nsnull
;
376 /* BC left borders aren't stored on cols, but the previous column's
377 right border is the next one's left border.*/
378 //Start with table's left border.
379 nscoord lastLeftBorder
= aTableFrame
->GetContinuousLeftBCBorderWidth();
380 for (nsTableColGroupFrame
* cgFrame
= static_cast<nsTableColGroupFrame
*>(colGroupList
.FirstChild());
381 cgFrame
; cgFrame
= static_cast<nsTableColGroupFrame
*>(cgFrame
->GetNextSibling())) {
383 if (cgFrame
->GetColCount() < 1) {
384 //No columns, no cells, so no need for data
388 /*Create data struct for column group*/
389 cgData
= new TableBackgroundData
;
390 if (!cgData
) return NS_ERROR_OUT_OF_MEMORY
;
391 cgData
->SetFull(cgFrame
);
392 if (mIsBorderCollapse
&& cgData
->ShouldSetBCBorder()) {
393 border
.left
= lastLeftBorder
;
394 cgFrame
->GetContinuousBCBorderWidth(border
);
395 nsresult rv
= cgData
->SetBCBorder(border
, this);
397 cgData
->Destroy(mPresContext
);
403 // Boolean that indicates whether mCols took ownership of cgData
404 PRBool cgDataOwnershipTaken
= PR_FALSE
;
406 /*Loop over columns in this colgroup*/
407 for (nsTableColFrame
* col
= cgFrame
->GetFirstColumn(); col
;
408 col
= static_cast<nsTableColFrame
*>(col
->GetNextSibling())) {
409 /*Create data struct for column*/
410 PRUint32 colIndex
= col
->GetColIndex();
411 NS_ASSERTION(colIndex
< mNumCols
, "prevent array boundary violation");
412 if (mNumCols
<= colIndex
)
414 mCols
[colIndex
].mCol
.SetFull(col
);
415 //Bring column mRect into table's coord system
416 mCols
[colIndex
].mCol
.mRect
.MoveBy(cgData
->mRect
.x
, cgData
->mRect
.y
);
417 //link to parent colgroup's data
418 mCols
[colIndex
].mColGroup
= cgData
;
419 cgDataOwnershipTaken
= PR_TRUE
;
420 if (mIsBorderCollapse
) {
421 border
.left
= lastLeftBorder
;
422 lastLeftBorder
= col
->GetContinuousBCBorderWidth(border
);
423 if (mCols
[colIndex
].mCol
.ShouldSetBCBorder()) {
424 nsresult rv
= mCols
[colIndex
].mCol
.SetBCBorder(border
, this);
425 if (NS_FAILED(rv
)) return rv
;
430 if (!cgDataOwnershipTaken
) {
431 cgData
->Destroy(mPresContext
);
437 for (PRUint32 i
= 0; i
< rowGroups
.Length(); i
++) {
438 nsTableRowGroupFrame
* rg
= rowGroups
[i
];
439 mRowGroup
.SetFrame(rg
);
440 // Need to compute the right rect via GetOffsetTo, since the row
441 // group may not be a child of the table.
442 mRowGroup
.mRect
.MoveTo(rg
->GetOffsetTo(aTableFrame
));
443 if (mRowGroup
.mRect
.Intersects(mDirtyRect
- mRenderPt
)) {
444 nsresult rv
= PaintRowGroup(rg
,
445 rg
->IsPseudoStackingContextFromStyle() || rg
->IsScrolled());
446 if (NS_FAILED(rv
)) return rv
;
453 TableBackgroundPainter::PaintRowGroup(nsTableRowGroupFrame
* aFrame
,
456 NS_PRECONDITION(aFrame
, "null frame");
458 if (!mRowGroup
.mFrame
) {
459 mRowGroup
.SetFrame(aFrame
);
462 nsTableRowFrame
* firstRow
= aFrame
->GetFirstRow();
464 /* Load row group data */
467 if (mIsBorderCollapse
&& mRowGroup
.ShouldSetBCBorder()) {
470 //pick up first row's top border (= rg top border)
471 firstRow
->GetContinuousBCBorderWidth(border
);
472 /* (row group doesn't store its top border) */
474 //overwrite sides+bottom borders with rg's own
475 aFrame
->GetContinuousBCBorderWidth(border
);
476 nsresult res
= mRowGroup
.SetBCBorder(border
, this);
477 if (!NS_SUCCEEDED(res
)) {
481 aPassThrough
= !mRowGroup
.IsVisible();
484 /* translate everything into row group coord system*/
485 if (eOrigin_TableRowGroup
!= mOrigin
) {
486 TranslateContext(mRowGroup
.mRect
.x
, mRowGroup
.mRect
.y
);
488 nsRect rgRect
= mRowGroup
.mRect
;
489 mRowGroup
.mRect
.MoveTo(0, 0);
491 /* Find the right row to start with */
492 nscoord ignored
; // We don't care about overflow above, since what we really
493 // care about are backgrounds and overflow above doesn't
494 // correspond to backgrounds, since cells can't span up from
495 // their originating row. We do care about overflow below,
496 // however, since that can be due to rowspans.
498 // Note that mDirtyRect - mRenderPt is guaranteed to be in the row
499 // group's coordinate system here, so passing its .y to
500 // GetFirstRowContaining is ok.
501 nsIFrame
* cursor
= aFrame
->GetFirstRowContaining(mDirtyRect
.y
- mRenderPt
.y
, &ignored
);
503 // Sadly, it seems like there may be non-row frames in there... or something?
504 // There are certainly null-checks in GetFirstRow() and GetNextRow(). :(
505 while (cursor
&& cursor
->GetType() != nsGkAtoms::tableRowFrame
) {
506 cursor
= cursor
->GetNextSibling();
509 // It's OK if cursor is null here.
510 nsTableRowFrame
* row
= static_cast<nsTableRowFrame
*>(cursor
);
512 // No useful cursor; just start at the top. Don't bother to set up a
513 // cursor; if we've gotten this far then we've already built the display
514 // list for the rowgroup, so not having a cursor means that there's some
515 // good reason we don't have a cursor and we shouldn't create one here.
520 for (; row
; row
= row
->GetNextRow()) {
522 if (mDirtyRect
.YMost() - mRenderPt
.y
< mRow
.mRect
.y
) { // Intersect wouldn't handle
525 // All done; cells originating in later rows can't intersect mDirtyRect.
529 nsresult rv
= PaintRow(row
, aPassThrough
|| row
->IsPseudoStackingContextFromStyle());
530 if (NS_FAILED(rv
)) return rv
;
533 /* translate back into table coord system */
534 if (eOrigin_TableRowGroup
!= mOrigin
) {
535 TranslateContext(-rgRect
.x
, -rgRect
.y
);
545 TableBackgroundPainter::PaintRow(nsTableRowFrame
* aFrame
,
548 NS_PRECONDITION(aFrame
, "null frame");
551 mRow
.SetFrame(aFrame
);
557 if (mIsBorderCollapse
&& mRow
.ShouldSetBCBorder()) {
559 nsTableRowFrame
* nextRow
= aFrame
->GetNextRow();
560 if (nextRow
) { //outer top below us is inner bottom for us
561 border
.bottom
= nextRow
->GetOuterTopContBCBorderWidth();
563 else { //acquire rg's bottom border
564 nsTableRowGroupFrame
* rowGroup
= static_cast<nsTableRowGroupFrame
*>(aFrame
->GetParent());
565 rowGroup
->GetContinuousBCBorderWidth(border
);
567 //get the rest of the borders; will overwrite all but bottom
568 aFrame
->GetContinuousBCBorderWidth(border
);
570 nsresult res
= mRow
.SetBCBorder(border
, this);
571 if (!NS_SUCCEEDED(res
)) {
575 aPassThrough
= !mRow
.IsVisible();
579 if (eOrigin_TableRow
== mOrigin
) {
580 /* If we originate from the row, then make the row the origin. */
581 mRow
.mRect
.MoveTo(0, 0);
583 //else: Use row group's coord system -> no translation necessary
585 for (nsTableCellFrame
* cell
= aFrame
->GetFirstCell(); cell
; cell
= cell
->GetNextCell()) {
586 //Translate to use the same coord system as mRow.
587 mCellRect
= cell
->GetRect() + mRow
.mRect
.TopLeft() + mRenderPt
;
588 if (mCellRect
.Intersects(mDirtyRect
)) {
589 nsresult rv
= PaintCell(cell
, aPassThrough
|| cell
->IsPseudoStackingContextFromStyle());
590 if (NS_FAILED(rv
)) return rv
;
594 /* Unload row data */
600 TableBackgroundPainter::PaintCell(nsTableCellFrame
* aCell
,
603 NS_PRECONDITION(aCell
, "null frame");
605 const nsStyleTableBorder
* cellTableStyle
;
606 cellTableStyle
= aCell
->GetStyleTableBorder();
607 if (!(NS_STYLE_TABLE_EMPTY_CELLS_SHOW
== cellTableStyle
->mEmptyCells
||
608 NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND
== cellTableStyle
->mEmptyCells
)
609 && aCell
->GetContentEmpty() && !mIsBorderCollapse
) {
614 aCell
->GetColIndex(colIndex
);
615 NS_ASSERTION(colIndex
< mNumCols
, "prevent array boundary violation");
616 if (mNumCols
<= colIndex
)
619 //Paint column group background
620 if (mCols
&& mCols
[colIndex
].mColGroup
&& mCols
[colIndex
].mColGroup
->IsVisible()) {
621 nsCSSRendering::PaintBackgroundWithSC(mPresContext
, mRenderingContext
,
622 mCols
[colIndex
].mColGroup
->mFrame
, mDirtyRect
,
623 mCols
[colIndex
].mColGroup
->mRect
+ mRenderPt
,
624 *mCols
[colIndex
].mColGroup
->mBackground
,
625 *mCols
[colIndex
].mColGroup
->mBorder
,
626 PR_TRUE
, &mCellRect
);
629 //Paint column background
630 if (mCols
&& mCols
[colIndex
].mCol
.IsVisible()) {
631 nsCSSRendering::PaintBackgroundWithSC(mPresContext
, mRenderingContext
,
632 mCols
[colIndex
].mCol
.mFrame
, mDirtyRect
,
633 mCols
[colIndex
].mCol
.mRect
+ mRenderPt
,
634 *mCols
[colIndex
].mCol
.mBackground
,
635 *mCols
[colIndex
].mCol
.mBorder
,
636 PR_TRUE
, &mCellRect
);
639 //Paint row group background
640 if (mRowGroup
.IsVisible()) {
641 nsCSSRendering::PaintBackgroundWithSC(mPresContext
, mRenderingContext
,
642 mRowGroup
.mFrame
, mDirtyRect
,
643 mRowGroup
.mRect
+ mRenderPt
,
644 *mRowGroup
.mBackground
, *mRowGroup
.mBorder
,
645 PR_TRUE
, &mCellRect
);
648 //Paint row background
649 if (mRow
.IsVisible()) {
650 nsCSSRendering::PaintBackgroundWithSC(mPresContext
, mRenderingContext
,
651 mRow
.mFrame
, mDirtyRect
,
652 mRow
.mRect
+ mRenderPt
,
653 *mRow
.mBackground
, *mRow
.mBorder
,
654 PR_TRUE
, &mCellRect
);
657 //Paint cell background in border-collapse unless we're just passing
658 if (mIsBorderCollapse
&& !aPassSelf
) {
659 aCell
->PaintCellBackground(mRenderingContext
, mDirtyRect
,
660 mCellRect
.TopLeft());