mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #1378 - Align the drawing of table cell backgrounds with the spec.
This commit is contained in:
parent
7fac86416c
commit
598fe2fa1f
3 changed files with 105 additions and 55 deletions
|
|
@ -450,19 +450,40 @@ PaintTableCellSelection(nsIFrame* aFrame, DrawTarget* aDrawTarget,
|
|||
aPt);
|
||||
}
|
||||
|
||||
bool
|
||||
nsTableCellFrame::ShouldPaintBordersAndBackgrounds() const
|
||||
{
|
||||
// If we're not visible, we don't paint.
|
||||
if (!StyleVisibility()->IsVisible()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Consider 'empty-cells', but only in separated borders mode.
|
||||
if (!GetContentEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsTableFrame* tableFrame = GetTableFrame();
|
||||
if (tableFrame->IsBorderCollapse()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
|
||||
}
|
||||
|
||||
bool
|
||||
nsTableCellFrame::ShouldPaintBackground(nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
return ShouldPaintBordersAndBackgrounds() && IsVisibleInSelection(aBuilder);
|
||||
}
|
||||
|
||||
void
|
||||
nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsTableCellFrame");
|
||||
nsTableFrame* tableFrame = GetTableFrame();
|
||||
int32_t emptyCellStyle = GetContentEmpty() && !tableFrame->IsBorderCollapse() ?
|
||||
StyleTableBorder()->mEmptyCells
|
||||
: NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
|
||||
// take account of 'empty-cells'
|
||||
if (StyleVisibility()->IsVisible() &&
|
||||
(NS_STYLE_TABLE_EMPTY_CELLS_HIDE != emptyCellStyle)) {
|
||||
if (ShouldPaintBordersAndBackgrounds()) {
|
||||
// display outset box-shadows if we need to.
|
||||
bool hasBoxShadow = !!StyleEffects()->mBoxShadow;
|
||||
if (hasBoxShadow) {
|
||||
|
|
@ -487,7 +508,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
// display borders if we need to
|
||||
ProcessBorders(tableFrame, aBuilder, aLists);
|
||||
ProcessBorders(GetTableFrame(), aBuilder, aLists);
|
||||
|
||||
// and display the selection border if we need to
|
||||
if (IsSelected()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue