Bug 1612146 - Converting empty-cells defines into enum class. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D61398

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Thomas Dolezal 2020-02-01 21:43:31 +00:00
parent 2770364f87
commit bfd4477a13
6 changed files with 10 additions and 7 deletions

View File

@ -149,6 +149,7 @@ rusty-enums = [
"mozilla::StyleIsolation",
"mozilla::StyleTextOrientation",
"mozilla::StyleTableLayout",
"mozilla::StyleEmptyCells",
"nsStyleImageType",
"nsINode_BooleanFlag",
"mozilla::PseudoStyleType",

View File

@ -624,8 +624,10 @@ enum class StyleTableLayout : uint8_t {
Fixed,
};
#define NS_STYLE_TABLE_EMPTY_CELLS_HIDE 0
#define NS_STYLE_TABLE_EMPTY_CELLS_SHOW 1
enum class StyleEmptyCells : uint8_t {
Hide,
Show,
};
// Constants for the caption-side property. Note that despite having "physical"
// names, these are actually interpreted according to the table's writing-mode:

View File

@ -1462,7 +1462,7 @@ nsStyleTableBorder::nsStyleTableBorder(const Document& aDocument)
mBorderSpacingRow(0),
mBorderCollapse(StyleBorderCollapse::Separate),
mCaptionSide(NS_STYLE_CAPTION_SIDE_TOP),
mEmptyCells(NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
mEmptyCells(StyleEmptyCells::Show) {
MOZ_COUNT_CTOR(nsStyleTableBorder);
}

View File

@ -1902,7 +1902,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder {
nscoord mBorderSpacingRow;
mozilla::StyleBorderCollapse mBorderCollapse;
uint8_t mCaptionSide;
uint8_t mEmptyCells;
mozilla::StyleEmptyCells mEmptyCells;
};
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent {

View File

@ -346,7 +346,7 @@ nsresult nsTableCellFrame::ProcessBorders(nsTableFrame* aFrame,
if (aFrame->IsBorderCollapse() || !borderStyle->HasBorder()) return NS_OK;
if (!GetContentEmpty() ||
StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
StyleTableBorder()->mEmptyCells == StyleEmptyCells::Show) {
aLists.BorderBackground()->AppendNewToTop<nsDisplayBorder>(aBuilder, this);
}
@ -431,7 +431,7 @@ bool nsTableCellFrame::ShouldPaintBordersAndBackgrounds() const {
return true;
}
return StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
return StyleTableBorder()->mEmptyCells == StyleEmptyCells::Show;
}
bool nsTableCellFrame::ShouldPaintBackground(nsDisplayListBuilder* aBuilder) {

View File

@ -20,7 +20,7 @@ ${helpers.single_keyword(
"empty-cells",
"show hide",
engines="gecko servo-2013",
gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS",
gecko_enum_prefix="StyleEmptyCells",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells",
servo_restyle_damage="rebuild_and_reflow",