Bug 1338764 part 1 - Use const rather than enum for context flags of nsStyleSVG. r?manishearth draft
authorXidorn Quan <me@upsuper.org>
Mon, 17 Jul 2017 15:10:50 +1000
changeset 619395 44417fa03a511c3e315d246e2e1508801718a784
parent 618703 b101ad3afcdb609a40ee84bcc2e5a0d60dd5662b
child 619396 9cc5bad6285ac28ca7a144322b7930034a2d8920
push id71669
push userxquan@mozilla.com
push dateWed, 02 Aug 2017 00:16:11 +0000
reviewersmanishearth
bugs1338764
milestone56.0a1
Bug 1338764 part 1 - Use const rather than enum for context flags of nsStyleSVG. r?manishearth MozReview-Commit-ID: KzORnfVXgLJ
layout/style/nsStyleStruct.h
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -3601,25 +3601,29 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   bool HasFill() const {
     return mFill.Type() != eStyleSVGPaintType_None && mFillOpacity > 0;
   }
 
 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]
 };
 
 struct nsStyleFilter
 {
   nsStyleFilter();
   nsStyleFilter(const nsStyleFilter& aSource);