Bug 1516221 - changes to implement enum class for #define NS_STYLE_COLOR_ADJUST. r=emilio

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
sharath 2018-12-24 15:28:11 +00:00
parent 8fe38ebd36
commit ba62a9414a
6 changed files with 9 additions and 5 deletions

View File

@ -2334,7 +2334,7 @@ nscolor nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
const nsStyleVisibility* visibility = aComputedStyle->StyleVisibility();
if (visibility->mColorAdjust != NS_STYLE_COLOR_ADJUST_EXACT &&
if (visibility->mColorAdjust != StyleColorAdjust::Exact &&
aFrame->HonorPrintBackgroundSettings()) {
aDrawBackgroundImage = aPresContext->GetBackgroundImageDraw();
aDrawBackgroundColor = aPresContext->GetBackgroundColorDraw();

View File

@ -140,6 +140,7 @@ rusty-enums = [
"mozilla::StyleScrollbarWidth",
"mozilla::StyleWhiteSpace",
"mozilla::StyleTextRendering",
"mozilla::StyleColorAdjust",
"nsStyleImageType",
"nsStyleSVGPaintType",
"nsStyleSVGFallbackType",

View File

@ -934,8 +934,10 @@ enum class StyleTextRendering : uint8_t {
};
// color-adjust
#define NS_STYLE_COLOR_ADJUST_ECONOMY 0
#define NS_STYLE_COLOR_ADJUST_EXACT 1
enum class StyleColorAdjust : uint8_t {
Economy = 0,
Exact = 1,
};
// color-interpolation and color-interpolation-filters
#define NS_STYLE_COLOR_INTERPOLATION_AUTO 0

View File

@ -3486,7 +3486,7 @@ nsStyleVisibility::nsStyleVisibility(const nsPresContext* aContext)
mImageRendering(NS_STYLE_IMAGE_RENDERING_AUTO),
mWritingMode(NS_STYLE_WRITING_MODE_HORIZONTAL_TB),
mTextOrientation(NS_STYLE_TEXT_ORIENTATION_MIXED),
mColorAdjust(NS_STYLE_COLOR_ADJUST_ECONOMY) {
mColorAdjust(StyleColorAdjust::Economy) {
MOZ_COUNT_CTOR(nsStyleVisibility);
}

View File

@ -1603,7 +1603,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVisibility {
uint8_t mImageRendering; // NS_STYLE_IMAGE_RENDERING_*
uint8_t mWritingMode; // NS_STYLE_WRITING_MODE_*
uint8_t mTextOrientation; // NS_STYLE_TEXT_ORIENTATION_MIXED_*
uint8_t mColorAdjust; // NS_STYLE_COLOR_ADJUST_ECONOMY_*
mozilla::StyleColorAdjust mColorAdjust;
bool IsVisible() const { return (mVisible == NS_STYLE_VISIBILITY_VISIBLE); }

View File

@ -54,6 +54,7 @@ ${helpers.single_keyword(
${helpers.single_keyword(
"color-adjust",
"economy exact", products="gecko",
gecko_enum_prefix="StyleColorAdjust",
gecko_pref="layout.css.color-adjust.enabled",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-color/#propdef-color-adjust",