From 0e98738d78b9fbda4906840eb3612856c07b4bd2 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 17 Jul 2017 15:10:50 +1000 Subject: [PATCH] Bug 1338764 part 1 - Use const rather than enum for context flags of nsStyleSVG. r=manishearth MozReview-Commit-ID: KzORnfVXgLJ --HG-- extra : rebase_source : 365842d6e6fda4b35a5932272773a3d88bfc04c6 --- layout/style/nsStyleStruct.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 59833e37f3bb..eccc02380f7e 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -3603,15 +3603,19 @@ private: // Flags to represent the use of context-fill and context-stroke // for fill-opacity or stroke-opacity, and context-value for stroke-dasharray, // stroke-dashoffset and stroke-width. - enum { - FILL_OPACITY_SOURCE_MASK = 0x03, // fill-opacity: context-{fill,stroke} - STROKE_OPACITY_SOURCE_MASK = 0x0C, // stroke-opacity: context-{fill,stroke} - STROKE_DASHARRAY_CONTEXT = 0x10, // stroke-dasharray: context-value - STROKE_DASHOFFSET_CONTEXT = 0x20, // stroke-dashoffset: context-value - STROKE_WIDTH_CONTEXT = 0x40, // stroke-width: context-value - FILL_OPACITY_SOURCE_SHIFT = 0, - STROKE_OPACITY_SOURCE_SHIFT = 2, - }; + + // fill-opacity: context-{fill,stroke} + static const uint8_t FILL_OPACITY_SOURCE_MASK = 0x03; + // stroke-opacity: context-{fill,stroke} + static const uint8_t STROKE_OPACITY_SOURCE_MASK = 0x0C; + // stroke-dasharray: context-value + static const uint8_t STROKE_DASHARRAY_CONTEXT = 0x10; + // stroke-dashoffset: context-value + static const uint8_t STROKE_DASHOFFSET_CONTEXT = 0x20; + // stroke-width: context-value + static const uint8_t STROKE_WIDTH_CONTEXT = 0x40; + static const uint8_t FILL_OPACITY_SOURCE_SHIFT = 0; + static const uint8_t STROKE_OPACITY_SOURCE_SHIFT = 2; uint8_t mContextFlags; // [inherited] };