Bug 968118. Make nsCSSProps keyword tables be int16_t instead of int32_t for a small space win. r=heycam

--HG--
extra : rebase_source : 94cf09d0d96dd3c8e2a9528f5d242e36e85fcf75
This commit is contained in:
Robert O'Callahan 2014-02-06 00:10:44 +13:00
parent b275242936
commit 1b8d891c71
8 changed files with 323 additions and 302 deletions

View File

@ -488,7 +488,8 @@ static void GetKeywordsForProperty(const nsCSSProperty aProperty,
// Shorthand props have no keywords.
return;
}
const int32_t *keywordTable = nsCSSProps::kKeywordTableTable[aProperty];
const nsCSSProps::KTableValue *keywordTable =
nsCSSProps::kKeywordTableTable[aProperty];
if (keywordTable && keywordTable != nsCSSProps::kBoxPropSourceKTable) {
size_t i = 0;
while (nsCSSKeyword(keywordTable[i]) != eCSSKeyword_UNKNOWN) {

View File

@ -48,6 +48,8 @@
using namespace mozilla;
typedef nsCSSProps::KTableValue KTableValue;
const uint32_t
nsCSSProps::kParserVariantTable[eCSSProperty_COUNT_no_shorthands] = {
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \
@ -624,7 +626,8 @@ protected:
bool ParseFontSynthesis(nsCSSValue& aValue);
bool ParseSingleAlternate(int32_t& aWhichFeature, nsCSSValue& aValue);
bool ParseFontVariantAlternates(nsCSSValue& aValue);
bool ParseBitmaskValues(nsCSSValue& aValue, const int32_t aKeywordTable[],
bool ParseBitmaskValues(nsCSSValue& aValue,
const KTableValue aKeywordTable[],
const int32_t aMasks[]);
bool ParseFontVariantEastAsian(nsCSSValue& aValue);
bool ParseFontVariantLigatures(nsCSSValue& aValue);
@ -645,7 +648,8 @@ protected:
bool ParsePadding();
bool ParseQuotes();
bool ParseSize();
bool ParseTextAlign(nsCSSValue& aValue, const int32_t aTable[]);
bool ParseTextAlign(nsCSSValue& aValue,
const KTableValue aTable[]);
bool ParseTextAlign(nsCSSValue& aValue);
bool ParseTextAlignLast(nsCSSValue& aValue);
bool ParseTextDecoration();
@ -751,16 +755,17 @@ protected:
// after the opacity
bool ParseColorOpacity(uint8_t& aOpacity);
bool ParseColorOpacity(float& aOpacity);
bool ParseEnum(nsCSSValue& aValue, const int32_t aKeywordTable[]);
bool ParseEnum(nsCSSValue& aValue,
const KTableValue aKeywordTable[]);
bool ParseVariant(nsCSSValue& aValue,
int32_t aVariantMask,
const int32_t aKeywordTable[]);
int32_t aVariantMask,
const KTableValue aKeywordTable[]);
bool ParseNonNegativeVariant(nsCSSValue& aValue,
int32_t aVariantMask,
const int32_t aKeywordTable[]);
int32_t aVariantMask,
const KTableValue aKeywordTable[]);
bool ParseOneOrLargerVariant(nsCSSValue& aValue,
int32_t aVariantMask,
const int32_t aKeywordTable[]);
int32_t aVariantMask,
const KTableValue aKeywordTable[]);
bool ParseCounter(nsCSSValue& aValue);
bool ParseAttr(nsCSSValue& aValue);
bool SetValueToURL(nsCSSValue& aValue, const nsString& aURL);
@ -5871,7 +5876,7 @@ static const nsCSSProperty kColumnRuleIDs[] = {
bool
CSSParserImpl::ParseEnum(nsCSSValue& aValue,
const int32_t aKeywordTable[])
const KTableValue aKeywordTable[])
{
nsSubstring* ident = NextIdent();
if (nullptr == ident) {
@ -6020,7 +6025,7 @@ CSSParserImpl::TranslateDimension(nsCSSValue& aValue,
bool
CSSParserImpl::ParseNonNegativeVariant(nsCSSValue& aValue,
int32_t aVariantMask,
const int32_t aKeywordTable[])
const KTableValue aKeywordTable[])
{
// The variant mask must only contain non-numeric variants or the ones
// that we specifically handle.
@ -6062,7 +6067,7 @@ CSSParserImpl::ParseNonNegativeVariant(nsCSSValue& aValue,
bool
CSSParserImpl::ParseOneOrLargerVariant(nsCSSValue& aValue,
int32_t aVariantMask,
const int32_t aKeywordTable[])
const KTableValue aKeywordTable[])
{
// The variant mask must only contain non-numeric variants or the ones
// that we specifically handle.
@ -6092,7 +6097,7 @@ CSSParserImpl::ParseOneOrLargerVariant(nsCSSValue& aValue,
bool
CSSParserImpl::ParseVariant(nsCSSValue& aValue,
int32_t aVariantMask,
const int32_t aKeywordTable[])
const KTableValue aKeywordTable[])
{
NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) ||
!(aVariantMask & VARIANT_NUMBER),
@ -7947,7 +7952,7 @@ CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue,
aPropID == eCSSProperty_math_display))
return false;
const int32_t *kwtable = nsCSSProps::kKeywordTableTable[aPropID];
const KTableValue *kwtable = nsCSSProps::kKeywordTableTable[aPropID];
switch (nsCSSProps::ValueRestrictions(aPropID)) {
default:
NS_ABORT_IF_FALSE(false, "should not be reached");
@ -9714,7 +9719,7 @@ CSSParserImpl::ParseContent()
{
// We need to divide the 'content' keywords into two classes for
// ParseVariant's sake, so we can't just use nsCSSProps::kContentKTable.
static const int32_t kContentListKWs[] = {
static const KTableValue kContentListKWs[] = {
eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE,
eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
@ -9722,7 +9727,7 @@ CSSParserImpl::ParseContent()
eCSSKeyword_UNKNOWN,-1
};
static const int32_t kContentSolitaryKWs[] = {
static const KTableValue kContentSolitaryKWs[] = {
eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT,
eCSSKeyword_UNKNOWN,-1
};
@ -10164,7 +10169,7 @@ CSSParserImpl::ParseFontVariantAlternates(nsCSSValue& aValue)
bool
CSSParserImpl::ParseBitmaskValues(nsCSSValue& aValue,
const int32_t aKeywordTable[],
const KTableValue aKeywordTable[],
const int32_t aMasks[])
{
if (!ParseVariant(aValue, VARIANT_HMK, aKeywordTable)) {
@ -10927,7 +10932,7 @@ CSSParserImpl::ParseTextDecoration()
eDecorationBlink | eDecorationPrefAnchors),
"text decoration constants need to be bitmasks");
static const int32_t kTextDecorationKTable[] = {
static const KTableValue kTextDecorationKTable[] = {
eCSSKeyword_none, eDecorationNone,
eCSSKeyword_underline, eDecorationUnderline,
eCSSKeyword_overline, eDecorationOverline,
@ -10991,7 +10996,7 @@ CSSParserImpl::ParseTextDecoration()
}
bool
CSSParserImpl::ParseTextAlign(nsCSSValue& aValue, const int32_t aTable[])
CSSParserImpl::ParseTextAlign(nsCSSValue& aValue, const KTableValue aTable[])
{
if (ParseVariant(aValue, VARIANT_INHERIT, nullptr)) {
// 'inherit', 'initial' and 'unset' must be alone
@ -12389,7 +12394,7 @@ CSSParserImpl::ParsePaintOrder()
((1 << NS_STYLE_PAINT_ORDER_BITWIDTH) > NS_STYLE_PAINT_ORDER_LAST_VALUE,
"bitfield width insufficient for paint-order constants");
static const int32_t kPaintOrderKTable[] = {
static const KTableValue kPaintOrderKTable[] = {
eCSSKeyword_normal, NS_STYLE_PAINT_ORDER_NORMAL,
eCSSKeyword_fill, NS_STYLE_PAINT_ORDER_FILL,
eCSSKeyword_stroke, NS_STYLE_PAINT_ORDER_STROKE,

File diff suppressed because it is too large Load Diff

View File

@ -243,6 +243,8 @@ enum nsStyleAnimType {
class nsCSSProps {
public:
typedef int16_t KTableValue;
static void AddRefTable(void);
static void ReleaseTable(void);
@ -298,19 +300,23 @@ public:
// Returns the index of |aKeyword| in |aTable|, if it exists there;
// otherwise, returns -1.
// NOTE: Generally, clients should call FindKeyword() instead of this method.
static int32_t FindIndexOfKeyword(nsCSSKeyword aKeyword, const int32_t aTable[]);
static int32_t FindIndexOfKeyword(nsCSSKeyword aKeyword,
const KTableValue aTable[]);
// Find |aKeyword| in |aTable|, if found set |aValue| to its corresponding value.
// If not found, return false and do not set |aValue|.
static bool FindKeyword(nsCSSKeyword aKeyword, const int32_t aTable[], int32_t& aValue);
static bool FindKeyword(nsCSSKeyword aKeyword, const KTableValue aTable[],
int32_t& aValue);
// Return the first keyword in |aTable| that has the corresponding value |aValue|.
// Return |eCSSKeyword_UNKNOWN| if not found.
static nsCSSKeyword ValueToKeywordEnum(int32_t aValue, const int32_t aTable[]);
static nsCSSKeyword ValueToKeywordEnum(int32_t aValue,
const KTableValue aTable[]);
// Ditto but as a string, return "" when not found.
static const nsAFlatCString& ValueToKeyword(int32_t aValue, const int32_t aTable[]);
static const nsAFlatCString& ValueToKeyword(int32_t aValue,
const KTableValue aTable[]);
static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];
static const int32_t* const kKeywordTableTable[eCSSProperty_COUNT_no_shorthands];
static const KTableValue* const kKeywordTableTable[eCSSProperty_COUNT_no_shorthands];
static const nsStyleAnimType kAnimTypeTable[eCSSProperty_COUNT_no_shorthands];
static const ptrdiff_t
kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands];
@ -438,145 +444,145 @@ public:
if (nsCSSProps::IsEnabled(*iter_))
// Keyword/Enum value tables
static const int32_t kAnimationDirectionKTable[];
static const int32_t kAnimationFillModeKTable[];
static const int32_t kAnimationIterationCountKTable[];
static const int32_t kAnimationPlayStateKTable[];
static const int32_t kAnimationTimingFunctionKTable[];
static const int32_t kAppearanceKTable[];
static const int32_t kAzimuthKTable[];
static const int32_t kBackfaceVisibilityKTable[];
static const int32_t kTransformStyleKTable[];
static const int32_t kBackgroundAttachmentKTable[];
static const int32_t kBackgroundInlinePolicyKTable[];
static const int32_t kBackgroundOriginKTable[];
static const int32_t kBackgroundPositionKTable[];
static const int32_t kBackgroundRepeatKTable[];
static const int32_t kBackgroundRepeatPartKTable[];
static const int32_t kBackgroundSizeKTable[];
static const int32_t kBlendModeKTable[];
static const int32_t kBorderCollapseKTable[];
static const int32_t kBorderColorKTable[];
static const int32_t kBorderImageRepeatKTable[];
static const int32_t kBorderImageSliceKTable[];
static const int32_t kBorderStyleKTable[];
static const int32_t kBorderWidthKTable[];
static const int32_t kBoxAlignKTable[];
static const int32_t kBoxDirectionKTable[];
static const int32_t kBoxOrientKTable[];
static const int32_t kBoxPackKTable[];
static const int32_t kDominantBaselineKTable[];
static const int32_t kFillRuleKTable[];
static const int32_t kFilterFunctionKTable[];
static const int32_t kImageRenderingKTable[];
static const int32_t kShapeRenderingKTable[];
static const int32_t kStrokeLinecapKTable[];
static const int32_t kStrokeLinejoinKTable[];
static const int32_t kStrokeContextValueKTable[];
static const int32_t kVectorEffectKTable[];
static const int32_t kTextAnchorKTable[];
static const int32_t kTextRenderingKTable[];
static const int32_t kColorInterpolationKTable[];
static const int32_t kColumnFillKTable[];
static const int32_t kBoxPropSourceKTable[];
static const int32_t kBoxShadowTypeKTable[];
static const int32_t kBoxSizingKTable[];
static const int32_t kCaptionSideKTable[];
static const int32_t kClearKTable[];
static const int32_t kColorKTable[];
static const int32_t kContentKTable[];
static const int32_t kCursorKTable[];
static const int32_t kDirectionKTable[];
static const int32_t kDisplayKTable[];
static const int32_t kElevationKTable[];
static const int32_t kEmptyCellsKTable[];
static const int32_t kAlignContentKTable[];
static const int32_t kAlignItemsKTable[];
static const int32_t kAlignSelfKTable[];
static const int32_t kFlexDirectionKTable[];
static const int32_t kFlexWrapKTable[];
static const int32_t kJustifyContentKTable[];
static const int32_t kFloatKTable[];
static const int32_t kFloatEdgeKTable[];
static const int32_t kFontKTable[];
static const int32_t kFontKerningKTable[];
static const int32_t kFontSizeKTable[];
static const int32_t kFontSmoothingKTable[];
static const int32_t kFontStretchKTable[];
static const int32_t kFontStyleKTable[];
static const int32_t kFontSynthesisKTable[];
static const int32_t kFontVariantKTable[];
static const int32_t kFontVariantAlternatesKTable[];
static const int32_t kFontVariantAlternatesFuncsKTable[];
static const int32_t kFontVariantCapsKTable[];
static const int32_t kFontVariantEastAsianKTable[];
static const int32_t kFontVariantLigaturesKTable[];
static const int32_t kFontVariantNumericKTable[];
static const int32_t kFontVariantPositionKTable[];
static const int32_t kFontWeightKTable[];
static const int32_t kImageOrientationKTable[];
static const int32_t kImageOrientationFlipKTable[];
static const int32_t kIMEModeKTable[];
static const int32_t kLineHeightKTable[];
static const int32_t kListStylePositionKTable[];
static const int32_t kListStyleKTable[];
static const int32_t kMaskTypeKTable[];
static const int32_t kMathVariantKTable[];
static const int32_t kMathDisplayKTable[];
static const int32_t kContextOpacityKTable[];
static const int32_t kContextPatternKTable[];
static const int32_t kOrientKTable[];
static const int32_t kOutlineStyleKTable[];
static const int32_t kOutlineColorKTable[];
static const int32_t kOverflowKTable[];
static const int32_t kOverflowSubKTable[];
static const int32_t kPageBreakKTable[];
static const int32_t kPageBreakInsideKTable[];
static const int32_t kPageMarksKTable[];
static const int32_t kPageSizeKTable[];
static const int32_t kPitchKTable[];
static const int32_t kPointerEventsKTable[];
static const KTableValue kAnimationDirectionKTable[];
static const KTableValue kAnimationFillModeKTable[];
static const KTableValue kAnimationIterationCountKTable[];
static const KTableValue kAnimationPlayStateKTable[];
static const KTableValue kAnimationTimingFunctionKTable[];
static const KTableValue kAppearanceKTable[];
static const KTableValue kAzimuthKTable[];
static const KTableValue kBackfaceVisibilityKTable[];
static const KTableValue kTransformStyleKTable[];
static const KTableValue kBackgroundAttachmentKTable[];
static const KTableValue kBackgroundInlinePolicyKTable[];
static const KTableValue kBackgroundOriginKTable[];
static const KTableValue kBackgroundPositionKTable[];
static const KTableValue kBackgroundRepeatKTable[];
static const KTableValue kBackgroundRepeatPartKTable[];
static const KTableValue kBackgroundSizeKTable[];
static const KTableValue kBlendModeKTable[];
static const KTableValue kBorderCollapseKTable[];
static const KTableValue kBorderColorKTable[];
static const KTableValue kBorderImageRepeatKTable[];
static const KTableValue kBorderImageSliceKTable[];
static const KTableValue kBorderStyleKTable[];
static const KTableValue kBorderWidthKTable[];
static const KTableValue kBoxAlignKTable[];
static const KTableValue kBoxDirectionKTable[];
static const KTableValue kBoxOrientKTable[];
static const KTableValue kBoxPackKTable[];
static const KTableValue kDominantBaselineKTable[];
static const KTableValue kFillRuleKTable[];
static const KTableValue kFilterFunctionKTable[];
static const KTableValue kImageRenderingKTable[];
static const KTableValue kShapeRenderingKTable[];
static const KTableValue kStrokeLinecapKTable[];
static const KTableValue kStrokeLinejoinKTable[];
static const KTableValue kStrokeContextValueKTable[];
static const KTableValue kVectorEffectKTable[];
static const KTableValue kTextAnchorKTable[];
static const KTableValue kTextRenderingKTable[];
static const KTableValue kColorInterpolationKTable[];
static const KTableValue kColumnFillKTable[];
static const KTableValue kBoxPropSourceKTable[];
static const KTableValue kBoxShadowTypeKTable[];
static const KTableValue kBoxSizingKTable[];
static const KTableValue kCaptionSideKTable[];
static const KTableValue kClearKTable[];
static const KTableValue kColorKTable[];
static const KTableValue kContentKTable[];
static const KTableValue kCursorKTable[];
static const KTableValue kDirectionKTable[];
static const KTableValue kDisplayKTable[];
static const KTableValue kElevationKTable[];
static const KTableValue kEmptyCellsKTable[];
static const KTableValue kAlignContentKTable[];
static const KTableValue kAlignItemsKTable[];
static const KTableValue kAlignSelfKTable[];
static const KTableValue kFlexDirectionKTable[];
static const KTableValue kFlexWrapKTable[];
static const KTableValue kJustifyContentKTable[];
static const KTableValue kFloatKTable[];
static const KTableValue kFloatEdgeKTable[];
static const KTableValue kFontKTable[];
static const KTableValue kFontKerningKTable[];
static const KTableValue kFontSizeKTable[];
static const KTableValue kFontSmoothingKTable[];
static const KTableValue kFontStretchKTable[];
static const KTableValue kFontStyleKTable[];
static const KTableValue kFontSynthesisKTable[];
static const KTableValue kFontVariantKTable[];
static const KTableValue kFontVariantAlternatesKTable[];
static const KTableValue kFontVariantAlternatesFuncsKTable[];
static const KTableValue kFontVariantCapsKTable[];
static const KTableValue kFontVariantEastAsianKTable[];
static const KTableValue kFontVariantLigaturesKTable[];
static const KTableValue kFontVariantNumericKTable[];
static const KTableValue kFontVariantPositionKTable[];
static const KTableValue kFontWeightKTable[];
static const KTableValue kImageOrientationKTable[];
static const KTableValue kImageOrientationFlipKTable[];
static const KTableValue kIMEModeKTable[];
static const KTableValue kLineHeightKTable[];
static const KTableValue kListStylePositionKTable[];
static const KTableValue kListStyleKTable[];
static const KTableValue kMaskTypeKTable[];
static const KTableValue kMathVariantKTable[];
static const KTableValue kMathDisplayKTable[];
static const KTableValue kContextOpacityKTable[];
static const KTableValue kContextPatternKTable[];
static const KTableValue kOrientKTable[];
static const KTableValue kOutlineStyleKTable[];
static const KTableValue kOutlineColorKTable[];
static const KTableValue kOverflowKTable[];
static const KTableValue kOverflowSubKTable[];
static const KTableValue kPageBreakKTable[];
static const KTableValue kPageBreakInsideKTable[];
static const KTableValue kPageMarksKTable[];
static const KTableValue kPageSizeKTable[];
static const KTableValue kPitchKTable[];
static const KTableValue kPointerEventsKTable[];
// Not const because we modify its entries when the pref
// "layout.css.sticky.enabled" changes:
static int32_t kPositionKTable[];
static const int32_t kRadialGradientShapeKTable[];
static const int32_t kRadialGradientSizeKTable[];
static const int32_t kRadialGradientLegacySizeKTable[];
static const int32_t kResizeKTable[];
static const int32_t kSpeakKTable[];
static const int32_t kSpeakHeaderKTable[];
static const int32_t kSpeakNumeralKTable[];
static const int32_t kSpeakPunctuationKTable[];
static const int32_t kSpeechRateKTable[];
static const int32_t kStackSizingKTable[];
static const int32_t kTableLayoutKTable[];
static KTableValue kPositionKTable[];
static const KTableValue kRadialGradientShapeKTable[];
static const KTableValue kRadialGradientSizeKTable[];
static const KTableValue kRadialGradientLegacySizeKTable[];
static const KTableValue kResizeKTable[];
static const KTableValue kSpeakKTable[];
static const KTableValue kSpeakHeaderKTable[];
static const KTableValue kSpeakNumeralKTable[];
static const KTableValue kSpeakPunctuationKTable[];
static const KTableValue kSpeechRateKTable[];
static const KTableValue kStackSizingKTable[];
static const KTableValue kTableLayoutKTable[];
// Not const because we modify its entries when the pref
// "layout.css.text-align-true-value.enabled" changes:
static int32_t kTextAlignKTable[];
static int32_t kTextAlignLastKTable[];
static const int32_t kTextCombineHorizontalKTable[];
static const int32_t kTextDecorationLineKTable[];
static const int32_t kTextDecorationStyleKTable[];
static const int32_t kTextOrientationKTable[];
static const int32_t kTextOverflowKTable[];
static const int32_t kTextTransformKTable[];
static const int32_t kTouchActionKTable[];
static const int32_t kTransitionTimingFunctionKTable[];
static const int32_t kUnicodeBidiKTable[];
static const int32_t kUserFocusKTable[];
static const int32_t kUserInputKTable[];
static const int32_t kUserModifyKTable[];
static const int32_t kUserSelectKTable[];
static const int32_t kVerticalAlignKTable[];
static const int32_t kVisibilityKTable[];
static const int32_t kVolumeKTable[];
static const int32_t kWhitespaceKTable[];
static const int32_t kWidthKTable[]; // also min-width, max-width
static const int32_t kWindowShadowKTable[];
static const int32_t kWordBreakKTable[];
static const int32_t kWordWrapKTable[];
static const int32_t kWritingModeKTable[];
static const int32_t kHyphensKTable[];
static KTableValue kTextAlignKTable[];
static KTableValue kTextAlignLastKTable[];
static const KTableValue kTextCombineHorizontalKTable[];
static const KTableValue kTextDecorationLineKTable[];
static const KTableValue kTextDecorationStyleKTable[];
static const KTableValue kTextOrientationKTable[];
static const KTableValue kTextOverflowKTable[];
static const KTableValue kTextTransformKTable[];
static const KTableValue kTouchActionKTable[];
static const KTableValue kTransitionTimingFunctionKTable[];
static const KTableValue kUnicodeBidiKTable[];
static const KTableValue kUserFocusKTable[];
static const KTableValue kUserInputKTable[];
static const KTableValue kUserModifyKTable[];
static const KTableValue kUserSelectKTable[];
static const KTableValue kVerticalAlignKTable[];
static const KTableValue kVisibilityKTable[];
static const KTableValue kVolumeKTable[];
static const KTableValue kWhitespaceKTable[];
static const KTableValue kWidthKTable[]; // also min-width, max-width
static const KTableValue kWindowShadowKTable[];
static const KTableValue kWordBreakKTable[];
static const KTableValue kWordWrapKTable[];
static const KTableValue kWritingModeKTable[];
static const KTableValue kHyphensKTable[];
};
#endif /* nsCSSProps_h___ */

View File

@ -1740,7 +1740,7 @@ nsComputedDOMStyle::DoGetFontVariantPosition()
CSSValue*
nsComputedDOMStyle::GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember,
uint32_t nsStyleBackground::* aCount,
const int32_t aTable[])
const KTableValue aTable[])
{
const nsStyleBackground* bg = StyleBackground();
@ -2847,7 +2847,7 @@ nsComputedDOMStyle::DoGetVerticalAlign()
CSSValue*
nsComputedDOMStyle::CreateTextAlignValue(uint8_t aAlign, bool aAlignTrue,
const int32_t aTable[])
const KTableValue aTable[])
{
nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
val->SetIdent(nsCSSProps::ValueToKeywordEnum(aAlign, aTable));
@ -4301,7 +4301,7 @@ nsComputedDOMStyle::SetValueToCoord(nsROCSSPrimitiveValue* aValue,
const nsStyleCoord& aCoord,
bool aClampNegativeCalc,
PercentageBaseGetter aPercentageBaseGetter,
const int32_t aTable[],
const KTableValue aTable[],
nscoord aMinAppUnits,
nscoord aMaxAppUnits)
{

View File

@ -68,6 +68,8 @@ class gfx3DMatrix;
class nsComputedDOMStyle MOZ_FINAL : public nsDOMCSSDeclaration
{
public:
typedef nsCSSProps::KTableValue KTableValue;
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsComputedDOMStyle,
nsICSSDeclaration)
@ -143,7 +145,7 @@ private:
// Helper method for DoGetTextAlign[Last].
mozilla::dom::CSSValue* CreateTextAlignValue(uint8_t aAlign,
bool aAlignTrue,
const int32_t aTable[]);
const KTableValue aTable[]);
// This indicates error by leaving mStyleContextHolder null.
void UpdateCurrentStyleSources(bool aNeedsLayoutFlush);
void ClearCurrentStyleSources();
@ -195,7 +197,7 @@ private:
mozilla::dom::CSSValue* GetBackgroundList(uint8_t nsStyleBackground::Layer::* aMember,
uint32_t nsStyleBackground::* aCount,
const int32_t aTable[]);
const KTableValue aTable[]);
void GetCSSGradientString(const nsStyleGradient* aGradient,
nsAString& aString);
@ -528,7 +530,7 @@ private:
const nsStyleCoord& aCoord,
bool aClampNegativeCalc,
PercentageBaseGetter aPercentageBaseGetter = nullptr,
const int32_t aTable[] = nullptr,
const KTableValue aTable[] = nullptr,
nscoord aMinAppUnits = nscoord_MIN,
nscoord aMaxAppUnits = nscoord_MAX);

View File

@ -20,13 +20,13 @@
using namespace mozilla;
static const int32_t kOrientationKeywords[] = {
static const nsCSSProps::KTableValue kOrientationKeywords[] = {
eCSSKeyword_portrait, NS_STYLE_ORIENTATION_PORTRAIT,
eCSSKeyword_landscape, NS_STYLE_ORIENTATION_LANDSCAPE,
eCSSKeyword_UNKNOWN, -1
};
static const int32_t kScanKeywords[] = {
static const nsCSSProps::KTableValue kScanKeywords[] = {
eCSSKeyword_progressive, NS_STYLE_SCAN_PROGRESSIVE,
eCSSKeyword_interlace, NS_STYLE_SCAN_INTERLACE,
eCSSKeyword_UNKNOWN, -1

View File

@ -9,6 +9,7 @@
#define nsMediaFeatures_h_
#include "nsError.h"
#include "nsCSSProps.h"
class nsIAtom;
class nsPresContext;
@ -53,7 +54,7 @@ struct nsMediaFeature {
const void* mInitializer_;
// If mValueType == eEnumerated: const int32_t*: keyword table in
// the same format as the keyword tables in nsCSSProps.
const int32_t* mKeywordTable;
const nsCSSProps::KTableValue* mKeywordTable;
// If mGetter == GetSystemMetric (which implies mValueType ==
// eBoolInteger): nsIAtom * const *, for the system metric.
nsIAtom * const * mMetric;