Bug 1338764 part 1 - Use const rather than enum for context flags of nsStyleSVG. r?manishearth
MozReview-Commit-ID: KzORnfVXgLJ
--- 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);