Make window.setCursor() use CSS 'cursor' property values. b=260272 r+sr=dbaron

This commit is contained in:
mats.palmgren%bredband.net 2004-10-01 17:15:15 +00:00
Родитель 2aaba34f9f
Коммит 953c3e65ee
9 изменённых файлов: 461 добавлений и 477 удалений

Просмотреть файл

@ -295,7 +295,6 @@ protected:
// ParseColorOpacity will enforce that the color ends with a ')' after the opacity
PRBool ParseColorOpacity(nsresult& aErrorCode, PRUint8& aOpacity);
PRBool ParseEnum(nsresult& aErrorCode, nsCSSValue& aValue, const PRInt32 aKeywordTable[]);
PRInt32 SearchKeywordTable(nsCSSKeyword aKeyword, const PRInt32 aTable[]);
PRBool ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
PRInt32 aVariantMask,
const PRInt32 aKeywordTable[]);
@ -2759,9 +2758,9 @@ PRBool CSSParserImpl::ParseColor(nsresult& aErrorCode, nsCSSValue& aValue)
else {
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(tk->mIdent);
if (eCSSKeyword_UNKNOWN < keyword) { // known keyword
PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable);
if (0 < index) {
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
PRInt32 value;
if (nsCSSProps::FindKeyword(keyword, nsCSSProps::kColorKTable, value)) {
aValue.SetIntValue(value, eCSSUnit_Integer);
return PR_TRUE;
}
}
@ -3442,18 +3441,6 @@ static const nsCSSProperty kBorderLeftIDs[] = {
eCSSProperty_border_left_color
};
PRInt32 CSSParserImpl::SearchKeywordTable(nsCSSKeyword aKeyword, const PRInt32 aKeywordTable[])
{
PRInt32 index = 0;
while (0 <= aKeywordTable[index]) {
if (aKeyword == nsCSSKeyword(aKeywordTable[index++])) {
return index;
}
index++;
}
return -1;
}
PRBool CSSParserImpl::ParseEnum(nsresult& aErrorCode, nsCSSValue& aValue,
const PRInt32 aKeywordTable[])
{
@ -3463,9 +3450,9 @@ PRBool CSSParserImpl::ParseEnum(nsresult& aErrorCode, nsCSSValue& aValue,
}
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(*ident);
if (eCSSKeyword_UNKNOWN < keyword) {
PRInt32 index = SearchKeywordTable(keyword, aKeywordTable);
if (0 < index) {
aValue.SetIntValue(aKeywordTable[index], eCSSUnit_Enumerated);
PRInt32 value;
if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) {
aValue.SetIntValue(value, eCSSUnit_Enumerated);
return PR_TRUE;
}
}
@ -3605,9 +3592,9 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
}
}
if ((aVariantMask & VARIANT_KEYWORD) != 0) {
PRInt32 index = SearchKeywordTable(keyword, aKeywordTable);
if (0 < index) {
aValue.SetIntValue(aKeywordTable[index], eCSSUnit_Enumerated);
PRInt32 value;
if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) {
aValue.SetIntValue(value, eCSSUnit_Enumerated);
return PR_TRUE;
}
}
@ -3753,8 +3740,9 @@ PRBool CSSParserImpl::ParseCounter(nsresult& aErrorCode, nsCSSValue& aValue)
if (ExpectSymbol(aErrorCode, ',', PR_TRUE)) {
if (GetToken(aErrorCode, PR_TRUE) && (eCSSToken_Ident == mToken.mType)) {
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(mToken.mIdent);
PRInt32 dummy;
if ((eCSSKeyword_UNKNOWN < keyword) &&
(0 < SearchKeywordTable(keyword, nsCSSProps::kListStyleKTable))) {
nsCSSProps::FindKeyword(keyword, nsCSSProps::kListStyleKTable, dummy)) {
counter.Append(PRUnichar(','));
counter.Append(mToken.mIdent);
}

Просмотреть файл

@ -408,8 +408,8 @@ nsComputedDOMStyle::GetClear(nsIFrame *aFrame,
if (display && display->mBreakType != NS_STYLE_CLEAR_NONE) {
const nsAFlatCString& clear =
nsCSSProps::SearchKeywordTable(display->mBreakType,
nsCSSProps::kClearKTable);
nsCSSProps::ValueToKeyword(display->mBreakType,
nsCSSProps::kClearKTable);
val->SetIdent(clear);
} else {
val->SetIdent(nsLayoutAtoms::none);
@ -430,8 +430,8 @@ nsComputedDOMStyle::GetCssFloat(nsIFrame *aFrame,
if (display && display->mFloats != NS_STYLE_FLOAT_NONE) {
const nsAFlatCString& cssFloat =
nsCSSProps::SearchKeywordTable(display->mFloats,
nsCSSProps::kFloatKTable);
nsCSSProps::ValueToKeyword(display->mFloats,
nsCSSProps::kFloatKTable);
val->SetIdent(cssFloat);
} else {
val->SetIdent(nsLayoutAtoms::none);
@ -683,8 +683,8 @@ nsComputedDOMStyle::GetFontStyle(nsIFrame *aFrame,
if (font && font->mFont.style != NS_STYLE_FONT_STYLE_NORMAL) {
const nsAFlatCString& style=
nsCSSProps::SearchKeywordTable(font->mFont.style,
nsCSSProps::kFontStyleKTable);
nsCSSProps::ValueToKeyword(font->mFont.style,
nsCSSProps::kFontStyleKTable);
val->SetIdent(style);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -705,8 +705,8 @@ nsComputedDOMStyle::GetFontWeight(nsIFrame *aFrame,
if (font) {
const nsAFlatCString& str_weight=
nsCSSProps::SearchKeywordTable(font->mFont.weight,
nsCSSProps::kFontWeightKTable);
nsCSSProps::ValueToKeyword(font->mFont.weight,
nsCSSProps::kFontWeightKTable);
if (!str_weight.IsEmpty()) {
val->SetIdent(str_weight);
} else {
@ -729,8 +729,8 @@ nsComputedDOMStyle::GetFontVariant(nsIFrame *aFrame,
if (font && font->mFont.variant != NS_STYLE_FONT_VARIANT_NORMAL) {
const nsAFlatCString& variant=
nsCSSProps::SearchKeywordTable(font->mFont.variant,
nsCSSProps::kFontVariantKTable);
nsCSSProps::ValueToKeyword(font->mFont.variant,
nsCSSProps::kFontVariantKTable);
val->SetIdent(variant);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -752,8 +752,8 @@ nsComputedDOMStyle::GetBackgroundAttachment(nsIFrame *aFrame,
if (background) {
const nsAFlatCString& backgroundAttachment =
nsCSSProps::SearchKeywordTable(background->mBackgroundAttachment,
nsCSSProps::kBackgroundAttachmentKTable);
nsCSSProps::ValueToKeyword(background->mBackgroundAttachment,
nsCSSProps::kBackgroundAttachmentKTable);
val->SetIdent(backgroundAttachment);
}
@ -776,8 +776,8 @@ nsComputedDOMStyle::GetBackgroundClip(nsIFrame *aFrame,
}
const nsAFlatCString& backgroundClip =
nsCSSProps::SearchKeywordTable(clip,
nsCSSProps::kBackgroundClipKTable);
nsCSSProps::ValueToKeyword(clip,
nsCSSProps::kBackgroundClipKTable);
val->SetIdent(backgroundClip);
@ -797,8 +797,8 @@ nsComputedDOMStyle::GetBackgroundColor(nsIFrame *aFrame,
if (color) {
if (color->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) {
const nsAFlatCString& backgroundColor =
nsCSSProps::SearchKeywordTable(NS_STYLE_BG_COLOR_TRANSPARENT,
nsCSSProps::kBackgroundColorKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_BG_COLOR_TRANSPARENT,
nsCSSProps::kBackgroundColorKTable);
val->SetIdent(backgroundColor);
} else {
nsDOMCSSRGBColor *rgb = nsnull;
@ -857,8 +857,8 @@ nsComputedDOMStyle::GetBackgroundInlinePolicy(nsIFrame *aFrame,
}
const nsAFlatCString& backgroundPolicy =
nsCSSProps::SearchKeywordTable(policy,
nsCSSProps::kBackgroundInlinePolicyKTable);
nsCSSProps::ValueToKeyword(policy,
nsCSSProps::kBackgroundInlinePolicyKTable);
val->SetIdent(backgroundPolicy);
@ -881,8 +881,8 @@ nsComputedDOMStyle::GetBackgroundOrigin(nsIFrame *aFrame,
}
const nsAFlatCString& backgroundOrigin =
nsCSSProps::SearchKeywordTable(origin,
nsCSSProps::kBackgroundOriginKTable);
nsCSSProps::ValueToKeyword(origin,
nsCSSProps::kBackgroundOriginKTable);
val->SetIdent(backgroundOrigin);
@ -902,8 +902,8 @@ nsComputedDOMStyle::GetBackgroundRepeat(nsIFrame *aFrame,
if (background) {
const nsAFlatCString& backgroundRepeat =
nsCSSProps::SearchKeywordTable(background->mBackgroundRepeat,
nsCSSProps::kBackgroundRepeatKTable);
nsCSSProps::ValueToKeyword(background->mBackgroundRepeat,
nsCSSProps::kBackgroundRepeatKTable);
val->SetIdent(backgroundRepeat);
}
@ -960,8 +960,8 @@ nsComputedDOMStyle::GetBorderCollapse(nsIFrame *aFrame,
if (table) {
const nsAFlatCString& ident=
nsCSSProps::SearchKeywordTable(table->mBorderCollapse,
nsCSSProps::kBorderCollapseKTable);
nsCSSProps::ValueToKeyword(table->mBorderCollapse,
nsCSSProps::kBorderCollapseKTable);
val->SetIdent(ident);
}
@ -1021,8 +1021,8 @@ nsComputedDOMStyle::GetCaptionSide(nsIFrame *aFrame,
if (table) {
const nsAFlatCString& side =
nsCSSProps::SearchKeywordTable(table->mCaptionSide,
nsCSSProps::kCaptionSideKTable);
nsCSSProps::ValueToKeyword(table->mCaptionSide,
nsCSSProps::kCaptionSideKTable);
val->SetIdent(side);
}
@ -1041,8 +1041,8 @@ nsComputedDOMStyle::GetEmptyCells(nsIFrame *aFrame,
if (table) {
const nsAFlatCString& emptyCells =
nsCSSProps::SearchKeywordTable(table->mEmptyCells,
nsCSSProps::kEmptyCellsKTable);
nsCSSProps::ValueToKeyword(table->mEmptyCells,
nsCSSProps::kEmptyCellsKTable);
val->SetIdent(emptyCells);
}
@ -1061,8 +1061,8 @@ nsComputedDOMStyle::GetTableLayout(nsIFrame *aFrame,
if (table && table->mLayoutStrategy != NS_STYLE_TABLE_LAYOUT_AUTO) {
const nsAFlatCString& tableLayout =
nsCSSProps::SearchKeywordTable(table->mLayoutStrategy,
nsCSSProps::kTableLayoutKTable);
nsCSSProps::ValueToKeyword(table->mLayoutStrategy,
nsCSSProps::kTableLayoutKTable);
val->SetIdent(tableLayout);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -1332,8 +1332,8 @@ nsComputedDOMStyle::GetOutlineWidth(nsIFrame *aFrame,
case eStyleUnit_Chars:
{
const nsAFlatCString& width=
nsCSSProps::SearchKeywordTable(outline->mOutlineWidth.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
nsCSSProps::ValueToKeyword(outline->mOutlineWidth.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
val->SetIdent(width);
break;
}
@ -1363,8 +1363,8 @@ nsComputedDOMStyle::GetOutlineStyle(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::none);
} else {
const nsAFlatCString& style=
nsCSSProps::SearchKeywordTable(outlineStyle,
nsCSSProps::kBorderStyleKTable);
nsCSSProps::ValueToKeyword(outlineStyle,
nsCSSProps::kBorderStyleKTable);
val->SetIdent(style);
}
}
@ -1464,8 +1464,8 @@ nsComputedDOMStyle::GetListStylePosition(nsIFrame *aFrame,
if (list) {
const nsAFlatCString& style =
nsCSSProps::SearchKeywordTable(list->mListStylePosition,
nsCSSProps::kListStylePositionKTable);
nsCSSProps::ValueToKeyword(list->mListStylePosition,
nsCSSProps::kListStylePositionKTable);
val->SetIdent(style);
}
@ -1487,8 +1487,8 @@ nsComputedDOMStyle::GetListStyleType(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::none);
} else {
const nsAFlatCString& style =
nsCSSProps::SearchKeywordTable(list->mListStyleType,
nsCSSProps::kListStyleKTable);
nsCSSProps::ValueToKeyword(list->mListStyleType,
nsCSSProps::kListStyleKTable);
val->SetIdent(style);
}
}
@ -1605,8 +1605,8 @@ nsComputedDOMStyle::GetVerticalAlign(nsIFrame *aFrame,
case eStyleUnit_Enumerated:
{
const nsAFlatCString& align =
nsCSSProps::SearchKeywordTable(text->mVerticalAlign.GetIntValue(),
nsCSSProps::kVerticalAlignKTable);
nsCSSProps::ValueToKeyword(text->mVerticalAlign.GetIntValue(),
nsCSSProps::kVerticalAlignKTable);
val->SetIdent(align);
break;
}
@ -1648,8 +1648,8 @@ nsComputedDOMStyle::GetTextAlign(nsIFrame *aFrame,
if (text) {
const nsAFlatCString& align=
nsCSSProps::SearchKeywordTable(text->mTextAlign,
nsCSSProps::kTextAlignKTable);
nsCSSProps::ValueToKeyword(text->mTextAlign,
nsCSSProps::kTextAlignKTable);
val->SetIdent(align);
}
@ -1675,8 +1675,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
nsAutoString decorationString;
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_UNDERLINE) {
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_UNDERLINE,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_UNDERLINE,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_OVERLINE) {
@ -1684,8 +1684,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
decorationString.Append(PRUnichar(' '));
}
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_OVERLINE,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_OVERLINE,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_LINE_THROUGH) {
@ -1693,8 +1693,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
decorationString.Append(PRUnichar(' '));
}
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_BLINK) {
@ -1702,8 +1702,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
decorationString.Append(PRUnichar(' '));
}
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_BLINK,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_BLINK,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
val->SetString(decorationString);
@ -1763,8 +1763,8 @@ nsComputedDOMStyle::GetTextTransform(nsIFrame *aFrame,
if (text && text->mTextTransform != NS_STYLE_TEXT_TRANSFORM_NONE) {
const nsAFlatCString& textTransform =
nsCSSProps::SearchKeywordTable(text->mTextTransform,
nsCSSProps::kTextTransformKTable);
nsCSSProps::ValueToKeyword(text->mTextTransform,
nsCSSProps::kTextTransformKTable);
val->SetIdent(textTransform);
} else {
val->SetIdent(nsLayoutAtoms::none);
@ -1823,8 +1823,8 @@ nsComputedDOMStyle::GetWhiteSpace(nsIFrame *aFrame,
if (text && text->mWhiteSpace != NS_STYLE_WHITESPACE_NORMAL) {
const nsAFlatCString& whiteSpace =
nsCSSProps::SearchKeywordTable(text->mWhiteSpace,
nsCSSProps::kWhitespaceKTable);
nsCSSProps::ValueToKeyword(text->mWhiteSpace,
nsCSSProps::kWhitespaceKTable);
val->SetIdent(whiteSpace);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -1846,8 +1846,8 @@ nsComputedDOMStyle::GetVisibility(nsIFrame *aFrame,
if (visibility) {
const nsAFlatCString& value=
nsCSSProps::SearchKeywordTable(visibility->mVisible,
nsCSSProps::kVisibilityKTable);
nsCSSProps::ValueToKeyword(visibility->mVisible,
nsCSSProps::kVisibilityKTable);
val->SetIdent(value);
}
@ -1867,8 +1867,8 @@ nsComputedDOMStyle::GetDirection(nsIFrame *aFrame,
if (visibility) {
const nsAFlatCString & direction =
nsCSSProps::SearchKeywordTable(visibility->mDirection,
nsCSSProps::kDirectionKTable);
nsCSSProps::ValueToKeyword(visibility->mDirection,
nsCSSProps::kDirectionKTable);
val->SetIdent(direction);
}
@ -1887,8 +1887,8 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame,
if (text && text->mUnicodeBidi != NS_STYLE_UNICODE_BIDI_NORMAL) {
const nsAFlatCString& bidi =
nsCSSProps::SearchKeywordTable(text->mUnicodeBidi,
nsCSSProps::kUnicodeBidiKTable);
nsCSSProps::ValueToKeyword(text->mUnicodeBidi,
nsCSSProps::kUnicodeBidiKTable);
val->SetIdent(bidi);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -1912,8 +1912,8 @@ nsComputedDOMStyle::GetCursor(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::autoAtom);
} else {
const nsAFlatCString& cursor =
nsCSSProps::SearchKeywordTable(ui->mCursor,
nsCSSProps::kCursorKTable);
nsCSSProps::ValueToKeyword(ui->mCursor,
nsCSSProps::kCursorKTable);
val->SetIdent(cursor);
}
}
@ -1938,8 +1938,8 @@ nsComputedDOMStyle::GetAppearance(nsIFrame *aFrame,
}
const nsAFlatCString& appearanceIdent =
nsCSSProps::SearchKeywordTable(appearance,
nsCSSProps::kAppearanceKTable);
nsCSSProps::ValueToKeyword(appearance,
nsCSSProps::kAppearanceKTable);
val->SetIdent(appearanceIdent);
return CallQueryInterface(val, aValue);
@ -1962,8 +1962,8 @@ nsComputedDOMStyle::GetBoxAlign(nsIFrame *aFrame,
}
const nsAFlatCString& boxAlignIdent =
nsCSSProps::SearchKeywordTable(boxAlign,
nsCSSProps::kBoxAlignKTable);
nsCSSProps::ValueToKeyword(boxAlign,
nsCSSProps::kBoxAlignKTable);
val->SetIdent(boxAlignIdent);
return CallQueryInterface(val, aValue);
@ -1985,8 +1985,8 @@ nsComputedDOMStyle::GetBoxDirection(nsIFrame *aFrame,
}
const nsAFlatCString& boxDirectionIdent =
nsCSSProps::SearchKeywordTable(boxDirection,
nsCSSProps::kBoxDirectionKTable);
nsCSSProps::ValueToKeyword(boxDirection,
nsCSSProps::kBoxDirectionKTable);
val->SetIdent(boxDirectionIdent);
return CallQueryInterface(val, aValue);
@ -2048,8 +2048,8 @@ nsComputedDOMStyle::GetBoxOrient(nsIFrame *aFrame,
}
const nsAFlatCString& boxOrientIdent =
nsCSSProps::SearchKeywordTable(boxOrient,
nsCSSProps::kBoxOrientKTable);
nsCSSProps::ValueToKeyword(boxOrient,
nsCSSProps::kBoxOrientKTable);
val->SetIdent(boxOrientIdent);
return CallQueryInterface(val, aValue);
@ -2071,8 +2071,8 @@ nsComputedDOMStyle::GetBoxPack(nsIFrame *aFrame,
}
const nsAFlatCString& boxPackIdent =
nsCSSProps::SearchKeywordTable(boxPack,
nsCSSProps::kBoxPackKTable);
nsCSSProps::ValueToKeyword(boxPack,
nsCSSProps::kBoxPackKTable);
val->SetIdent(boxPackIdent);
return CallQueryInterface(val, aValue);
@ -2095,8 +2095,8 @@ nsComputedDOMStyle::GetBoxSizing(nsIFrame *aFrame,
}
const nsAFlatCString& boxSizingIdent =
nsCSSProps::SearchKeywordTable(boxSizing,
nsCSSProps::kBoxSizingKTable);
nsCSSProps::ValueToKeyword(boxSizing,
nsCSSProps::kBoxSizingKTable);
val->SetIdent(boxSizingIdent);
return CallQueryInterface(val, aValue);
@ -2118,8 +2118,8 @@ nsComputedDOMStyle::GetFloatEdge(nsIFrame *aFrame,
}
const nsAFlatCString& floatEdgeIdent =
nsCSSProps::SearchKeywordTable(floatEdge,
nsCSSProps::kFloatEdgeKTable);
nsCSSProps::ValueToKeyword(floatEdge,
nsCSSProps::kFloatEdgeKTable);
val->SetIdent(floatEdgeIdent);
return CallQueryInterface(val, aValue);
@ -2144,8 +2144,8 @@ nsComputedDOMStyle::GetUserFocus(nsIFrame *aFrame,
val->SetIdent(userFocusIdent);
} else {
const nsAFlatCString& userFocusIdent =
nsCSSProps::SearchKeywordTable(uiData->mUserFocus,
nsCSSProps::kUserFocusKTable);
nsCSSProps::ValueToKeyword(uiData->mUserFocus,
nsCSSProps::kUserFocusKTable);
val->SetIdent(userFocusIdent);
}
} else {
@ -2175,8 +2175,8 @@ nsComputedDOMStyle::GetUserInput(nsIFrame *aFrame,
val->SetIdent(userInputIdent);
} else {
const nsAFlatCString& userInputIdent =
nsCSSProps::SearchKeywordTable(uiData->mUserInput,
nsCSSProps::kUserInputKTable);
nsCSSProps::ValueToKeyword(uiData->mUserInput,
nsCSSProps::kUserInputKTable);
val->SetIdent(userInputIdent);
}
} else {
@ -2205,8 +2205,8 @@ nsComputedDOMStyle::GetUserModify(nsIFrame *aFrame,
}
const nsAFlatCString& userModifyIdent =
nsCSSProps::SearchKeywordTable(userModify,
nsCSSProps::kUserModifyKTable);
nsCSSProps::ValueToKeyword(userModify,
nsCSSProps::kUserModifyKTable);
val->SetIdent(userModifyIdent);
return CallQueryInterface(val, aValue);
@ -2229,8 +2229,8 @@ nsComputedDOMStyle::GetUserSelect(nsIFrame *aFrame,
val->SetIdent(userSelectIdent);
} else {
const nsAFlatCString& userSelectIdent =
nsCSSProps::SearchKeywordTable(uiData->mUserSelect,
nsCSSProps::kUserSelectKTable);
nsCSSProps::ValueToKeyword(uiData->mUserSelect,
nsCSSProps::kUserSelectKTable);
val->SetIdent(userSelectIdent);
}
} else {
@ -2258,8 +2258,8 @@ nsComputedDOMStyle::GetDisplay(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::none);
} else {
const nsAFlatCString& display =
nsCSSProps::SearchKeywordTable(displayData->mDisplay,
nsCSSProps::kDisplayKTable);
nsCSSProps::ValueToKeyword(displayData->mDisplay,
nsCSSProps::kDisplayKTable);
val->SetIdent(display);
}
}
@ -2280,8 +2280,8 @@ nsComputedDOMStyle::GetPosition(nsIFrame *aFrame,
if (display) {
const nsAFlatCString& position =
nsCSSProps::SearchKeywordTable(display->mPosition,
nsCSSProps::kPositionKTable);
nsCSSProps::ValueToKeyword(display->mPosition,
nsCSSProps::kPositionKTable);
val->SetIdent(position);
}
@ -2381,8 +2381,8 @@ nsComputedDOMStyle::GetOverflow(nsIFrame *aFrame,
if (display && display->mOverflowX == display->mOverflowY) {
if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowKTable);
nsCSSProps::ValueToKeyword(display->mOverflowX,
nsCSSProps::kOverflowKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -2404,8 +2404,8 @@ nsComputedDOMStyle::GetOverflowX(nsIFrame *aFrame,
if (display && display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::ValueToKeyword(display->mOverflowX,
nsCSSProps::kOverflowSubKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -2426,8 +2426,8 @@ nsComputedDOMStyle::GetOverflowY(nsIFrame *aFrame,
if (display && display->mOverflowY != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowY,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::ValueToKeyword(display->mOverflowY,
nsCSSProps::kOverflowSubKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -3387,8 +3387,8 @@ nsComputedDOMStyle::GetBorderWidthFor(PRUint8 aSide, nsIFrame *aFrame,
case eStyleUnit_Chars:
{
const nsAFlatCString& width=
nsCSSProps::SearchKeywordTable(coord.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
nsCSSProps::ValueToKeyword(coord.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
val->SetIdent(width);
break;
}
@ -3499,8 +3499,8 @@ nsComputedDOMStyle::GetBorderStyleFor(PRUint8 aSide, nsIFrame *aFrame,
if (borderStyle != NS_STYLE_BORDER_STYLE_NONE) {
const nsAFlatCString& style=
nsCSSProps::SearchKeywordTable(borderStyle,
nsCSSProps::kBorderStyleKTable);
nsCSSProps::ValueToKeyword(borderStyle,
nsCSSProps::kBorderStyleKTable);
val->SetIdent(style);
} else {
val->SetIdent(nsLayoutAtoms::none);

Просмотреть файл

@ -41,6 +41,7 @@
#include "nsChangeHint.h"
#include "nsCSSProperty.h"
#include "nsStyleStruct.h"
#include "nsCSSKeywords.h"
class nsCSSProps {
public:
@ -69,8 +70,14 @@ public:
// Sets the aStr param to the name of the propertyID
static PRBool GetColorName(PRInt32 aPropID, nsCString &aStr);
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
static const nsAFlatCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
// Find |aKeyword| in |aTable|, if found set |aValue| to its corresponding value.
// If not found, return PR_FALSE and do not set |aValue|.
static PRBool FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aValue);
// Return the first keyword in |aTable| that has the corresponding value |aValue|.
// Return |eCSSKeyword_UNKNOWN| if not found.
static nsCSSKeyword ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[]);
// Ditto but as a string, return "" when not found.
static const nsAFlatCString& ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[]);
static const nsCSSType kTypeTable[eCSSProperty_COUNT_no_shorthands];
static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];

Просмотреть файл

@ -236,7 +236,7 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
eCSSKeyword_menubar, NS_THEME_MENUBAR,
eCSSKeyword_menupopup, NS_THEME_MENUPOPUP,
eCSSKeyword_menuitem, NS_THEME_MENUITEM,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
// Keyword id tables for variant/enum parsing
@ -253,38 +253,38 @@ const PRInt32 nsCSSProps::kAzimuthKTable[] = {
eCSSKeyword_behind, NS_STYLE_AZIMUTH_BEHIND,
eCSSKeyword_leftwards, NS_STYLE_AZIMUTH_LEFTWARDS,
eCSSKeyword_rightwards, NS_STYLE_AZIMUTH_RIGHTWARDS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundAttachmentKTable[] = {
eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED,
eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundColorKTable[] = {
eCSSKeyword_transparent, NS_STYLE_BG_COLOR_TRANSPARENT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundClipKTable[] = {
eCSSKeyword_border, NS_STYLE_BG_CLIP_BORDER,
eCSSKeyword_padding, NS_STYLE_BG_CLIP_PADDING,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundInlinePolicyKTable[] = {
eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX,
eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS,
eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundOriginKTable[] = {
eCSSKeyword_border, NS_STYLE_BG_ORIGIN_BORDER,
eCSSKeyword_padding, NS_STYLE_BG_ORIGIN_PADDING,
eCSSKeyword_content, NS_STYLE_BG_ORIGIN_CONTENT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
@ -292,33 +292,33 @@ const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_XY,
eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_X,
eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_Y,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundXPositionKTable[] = {
eCSSKeyword_left, 0,
eCSSKeyword_center, 50,
eCSSKeyword_right, 100,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundYPositionKTable[] = {
eCSSKeyword_top, 0,
eCSSKeyword_center, 50,
eCSSKeyword_bottom, 100,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderCollapseKTable[] = {
eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE,
eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderColorKTable[] = {
eCSSKeyword_transparent, NS_STYLE_COLOR_TRANSPARENT,
eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
@ -334,27 +334,27 @@ const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
eCSSKeyword__moz_bg_inset, NS_STYLE_BORDER_STYLE_BG_INSET,
eCSSKeyword__moz_bg_outset, NS_STYLE_BORDER_STYLE_BG_OUTSET,
eCSSKeyword__moz_bg_solid, NS_STYLE_BORDER_STYLE_BG_SOLID,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL,
eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT,
eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER,
eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
@ -362,14 +362,14 @@ const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
eCSSKeyword_right, NS_SIDE_RIGHT,
eCSSKeyword_bottom, NS_SIDE_BOTTOM,
eCSSKeyword_left, NS_SIDE_LEFT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kClearKTable[] = {
eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kColorKTable[] = {
@ -422,7 +422,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = {
eCSSKeyword__moz_mac_accentdarkshadow, nsILookAndFeel::eColor__moz_mac_accentdarkshadow,
eCSSKeyword__moz_mac_accentdarkestshadow, nsILookAndFeel::eColor__moz_mac_accentdarkestshadow,
eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kContentKTable[] = {
@ -430,7 +430,7 @@ const PRInt32 nsCSSProps::kContentKTable[] = {
eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kCursorKTable[] = {
@ -478,13 +478,13 @@ const PRInt32 nsCSSProps::kCursorKTable[] = {
eCSSKeyword__moz_spinning, NS_STYLE_CURSOR_SPINNING,
eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kDirectionKTable[] = {
eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR,
eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kDisplayKTable[] = {
@ -518,7 +518,7 @@ const PRInt32 nsCSSProps::kDisplayKTable[] = {
eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP,
eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX,
eCSSKeyword__moz_page_break, NS_STYLE_DISPLAY_PAGE_BREAK,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kElevationKTable[] = {
@ -527,20 +527,20 @@ const PRInt32 nsCSSProps::kElevationKTable[] = {
eCSSKeyword_above, NS_STYLE_ELEVATION_ABOVE,
eCSSKeyword_higher, NS_STYLE_ELEVATION_HIGHER,
eCSSKeyword_lower, NS_STYLE_ELEVATION_LOWER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFloatKTable[] = {
eCSSKeyword_left, NS_STYLE_FLOAT_LEFT,
eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
@ -548,7 +548,7 @@ const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
eCSSKeyword_border_box, NS_STYLE_FLOAT_EDGE_BORDER,
eCSSKeyword_padding_box, NS_STYLE_FLOAT_EDGE_PADDING,
eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontKTable[] = {
@ -571,7 +571,7 @@ const PRInt32 nsCSSProps::kFontKTable[] = {
eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontSizeKTable[] = {
@ -584,7 +584,7 @@ const PRInt32 nsCSSProps::kFontSizeKTable[] = {
eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontStretchKTable[] = {
@ -598,36 +598,36 @@ const PRInt32 nsCSSProps::kFontStretchKTable[] = {
eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontStyleKTable[] = {
eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontVariantKTable[] = {
eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontWeightKTable[] = {
eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
// XXX What's the point?
const PRInt32 nsCSSProps::kKeyEquivalentKTable[] = {
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kListStyleKTable[] = {
@ -682,12 +682,12 @@ const PRInt32 nsCSSProps::kListStyleKTable[] = {
eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
eCSSKeyword_invert, NS_STYLE_COLOR_INVERT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kOverflowKTable[] = {
@ -699,7 +699,7 @@ const PRInt32 nsCSSProps::kOverflowKTable[] = {
eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
@ -708,7 +708,7 @@ const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
// Deprecated:
eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageBreakKTable[] = {
@ -716,24 +716,24 @@ const PRInt32 nsCSSProps::kPageBreakKTable[] = {
eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageMarksKTable[] = {
eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageSizeKTable[] = {
eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPitchKTable[] = {
@ -742,7 +742,7 @@ const PRInt32 nsCSSProps::kPitchKTable[] = {
eCSSKeyword_medium, NS_STYLE_PITCH_MEDIUM,
eCSSKeyword_high, NS_STYLE_PITCH_HIGH,
eCSSKeyword_x_high, NS_STYLE_PITCH_X_HIGH,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPositionKTable[] = {
@ -750,29 +750,29 @@ const PRInt32 nsCSSProps::kPositionKTable[] = {
eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakKTable[] = {
eCSSKeyword_spell_out, NS_STYLE_SPEAK_SPELL_OUT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakHeaderKTable[] = {
eCSSKeyword_once, NS_STYLE_SPEAK_HEADER_ONCE,
eCSSKeyword_always, NS_STYLE_SPEAK_HEADER_ALWAYS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakNumeralKTable[] = {
eCSSKeyword_digits, NS_STYLE_SPEAK_NUMERAL_DIGITS,
eCSSKeyword_continuous, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakPunctuationKTable[] = {
eCSSKeyword_code, NS_STYLE_SPEAK_PUNCTUATION_CODE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
@ -783,12 +783,12 @@ const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
eCSSKeyword_x_fast, NS_STYLE_SPEECH_RATE_X_FAST,
eCSSKeyword_faster, NS_STYLE_SPEECH_RATE_FASTER,
eCSSKeyword_slower, NS_STYLE_SPEECH_RATE_SLOWER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTextAlignKTable[] = {
@ -799,7 +799,7 @@ const PRInt32 nsCSSProps::kTextAlignKTable[] = {
eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
@ -808,20 +808,20 @@ const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_BLINK,
eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTextTransformKTable[] = {
eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserFocusKTable[] = {
@ -831,20 +831,20 @@ const PRInt32 nsCSSProps::kUserFocusKTable[] = {
eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER,
eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME,
eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserInputKTable[] = {
eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED,
eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserModifyKTable[] = {
eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY,
eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserSelectKTable[] = {
@ -855,7 +855,7 @@ const PRInt32 nsCSSProps::kUserSelectKTable[] = {
eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE,
eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE,
eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
@ -867,14 +867,14 @@ const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kVisibilityKTable[] = {
eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kVolumeKTable[] = {
@ -884,14 +884,14 @@ const PRInt32 nsCSSProps::kVolumeKTable[] = {
eCSSKeyword_medium, NS_STYLE_VOLUME_MEDIUM,
eCSSKeyword_loud, NS_STYLE_VOLUME_LOUD,
eCSSKeyword_x_loud, NS_STYLE_VOLUME_X_LOUD,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_MOZ_PRE_WRAP,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
// Specific keyword tables for XUL.properties
@ -901,13 +901,13 @@ const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE,
eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL,
eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
@ -915,7 +915,7 @@ const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL,
eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxPackKTable[] = {
@ -923,7 +923,7 @@ const PRInt32 nsCSSProps::kBoxPackKTable[] = {
eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER,
eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
#ifdef MOZ_SVG
@ -941,13 +941,13 @@ const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kFillRuleKTable[] = {
eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
@ -960,71 +960,85 @@ const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
#endif
PRInt32
nsCSSProps::SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[])
PRBool
nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
{
PRInt32 index = 0;
while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
if (aKeyword == nsCSSKeyword(aTable[index])) {
aResult = aTable[index+1];
return PR_TRUE;
}
index += 2;
}
return PR_FALSE;
}
nsCSSKeyword
nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
{
PRInt32 i = 1;
for (;;) {
if (aTable[i] == -1 && aTable[i-1] == -1) {
if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
break;
}
if (aValue == aTable[i]) {
return PRInt32(aTable[i-1]);
return nsCSSKeyword(aTable[i-1]);
}
i += 2;
}
return -1;
return eCSSKeyword_UNKNOWN;
}
const nsAFlatCString&
nsCSSProps::SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[])
nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
{
PRInt32 i = SearchKeywordTableInt(aValue, aTable);
if (i < 0) {
nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
if (keyword == eCSSKeyword_UNKNOWN) {
static nsDependentCString sNullStr("");
return sNullStr;
} else {
return nsCSSKeywords::GetStringValue(nsCSSKeyword(i));
return nsCSSKeywords::GetStringValue(keyword);
}
}
@ -1045,7 +1059,7 @@ nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
kwtable = kKeywordTableTable[aProp];
if (kwtable)
return SearchKeywordTable(aValue, kwtable);
return ValueToKeyword(aValue, kwtable);
static nsDependentCString sNullStr("");
return sNullStr;
@ -1054,18 +1068,17 @@ nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
{
PRBool rv = PR_FALSE;
PRInt32 keyword = -1;
// first get the keyword corresponding to the property Value from the color table
keyword = SearchKeywordTableInt(aPropValue, kColorKTable);
nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
// next get the name as a string from the keywords table
if (keyword >= 0) {
if (keyword != eCSSKeyword_UNKNOWN) {
nsCSSKeywords::AddRefTable();
aStr = nsCSSKeywords::GetStringValue((nsCSSKeyword)keyword);
aStr = nsCSSKeywords::GetStringValue(keyword);
nsCSSKeywords::ReleaseTable();
rv = PR_TRUE;
}
}
return rv;
}

Просмотреть файл

@ -137,6 +137,7 @@
#include "nsGlobalWindowCommands.h"
#include "nsAutoPtr.h"
#include "nsContentUtils.h"
#include "nsCSSProps.h"
#include "plbase64.h"
@ -5601,59 +5602,26 @@ nsGlobalChromeWindow::SetCursor(const nsAString& aCursor)
// use C strings to keep the code/data size down
NS_ConvertUCS2toUTF8 cursorString(aCursor);
if (cursorString.Equals("auto"))
cursor = NS_STYLE_CURSOR_AUTO;
else if (cursorString.Equals("default"))
cursor = NS_STYLE_CURSOR_DEFAULT;
else if (cursorString.Equals("pointer"))
cursor = NS_STYLE_CURSOR_POINTER;
else if (cursorString.Equals("crosshair"))
cursor = NS_STYLE_CURSOR_CROSSHAIR;
else if (cursorString.Equals("move"))
cursor = NS_STYLE_CURSOR_MOVE;
else if (cursorString.Equals("text"))
cursor = NS_STYLE_CURSOR_TEXT;
else if (cursorString.Equals("wait"))
cursor = NS_STYLE_CURSOR_WAIT;
else if (cursorString.Equals("help"))
cursor = NS_STYLE_CURSOR_HELP;
else if (cursorString.Equals("n-resize"))
cursor = NS_STYLE_CURSOR_N_RESIZE;
else if (cursorString.Equals("s-resize"))
cursor = NS_STYLE_CURSOR_S_RESIZE;
else if (cursorString.Equals("w-resize"))
cursor = NS_STYLE_CURSOR_W_RESIZE;
else if (cursorString.Equals("e-resize"))
cursor = NS_STYLE_CURSOR_E_RESIZE;
else if (cursorString.Equals("ne-resize"))
cursor = NS_STYLE_CURSOR_NE_RESIZE;
else if (cursorString.Equals("nw-resize"))
cursor = NS_STYLE_CURSOR_NW_RESIZE;
else if (cursorString.Equals("se-resize"))
cursor = NS_STYLE_CURSOR_SE_RESIZE;
else if (cursorString.Equals("sw-resize"))
cursor = NS_STYLE_CURSOR_SW_RESIZE;
else if (cursorString.Equals("copy"))
cursor = NS_STYLE_CURSOR_COPY; // CSS3
else if (cursorString.Equals("alias"))
cursor = NS_STYLE_CURSOR_ALIAS;
else if (cursorString.Equals("context-menu"))
cursor = NS_STYLE_CURSOR_CONTEXT_MENU;
else if (cursorString.Equals("cell"))
cursor = NS_STYLE_CURSOR_CELL;
else if (cursorString.Equals("grab"))
cursor = NS_STYLE_CURSOR_GRAB;
else if (cursorString.Equals("grabbing"))
cursor = NS_STYLE_CURSOR_GRABBING;
else if (cursorString.Equals("spinning"))
cursor = NS_STYLE_CURSOR_SPINNING;
else if (cursorString.Equals("-moz-zoom-in"))
cursor = NS_STYLE_CURSOR_MOZ_ZOOM_IN;
else if (cursorString.Equals("-moz-zoom-out"))
cursor = NS_STYLE_CURSOR_MOZ_ZOOM_OUT;
else
return NS_OK;
else {
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(aCursor);
if (eCSSKeyword_UNKNOWN == keyword ||
!nsCSSProps::FindKeyword(keyword, nsCSSProps::kCursorKTable, cursor)) {
// XXX remove the following three values (leave return NS_OK) after 1.8
// XXX since they should have been -moz- prefixed (covered by FindKeyword).
// XXX (also remove |cursorString| at that point?).
if (cursorString.Equals("grab"))
cursor = NS_STYLE_CURSOR_GRAB;
else if (cursorString.Equals("grabbing"))
cursor = NS_STYLE_CURSOR_GRABBING;
else if (cursorString.Equals("spinning"))
cursor = NS_STYLE_CURSOR_SPINNING;
else
return NS_OK;
}
}
nsCOMPtr<nsPresContext> presContext;
mDocShell->GetPresContext(getter_AddRefs(presContext));

Просмотреть файл

@ -295,7 +295,6 @@ protected:
// ParseColorOpacity will enforce that the color ends with a ')' after the opacity
PRBool ParseColorOpacity(nsresult& aErrorCode, PRUint8& aOpacity);
PRBool ParseEnum(nsresult& aErrorCode, nsCSSValue& aValue, const PRInt32 aKeywordTable[]);
PRInt32 SearchKeywordTable(nsCSSKeyword aKeyword, const PRInt32 aTable[]);
PRBool ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
PRInt32 aVariantMask,
const PRInt32 aKeywordTable[]);
@ -2759,9 +2758,9 @@ PRBool CSSParserImpl::ParseColor(nsresult& aErrorCode, nsCSSValue& aValue)
else {
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(tk->mIdent);
if (eCSSKeyword_UNKNOWN < keyword) { // known keyword
PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable);
if (0 < index) {
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
PRInt32 value;
if (nsCSSProps::FindKeyword(keyword, nsCSSProps::kColorKTable, value)) {
aValue.SetIntValue(value, eCSSUnit_Integer);
return PR_TRUE;
}
}
@ -3442,18 +3441,6 @@ static const nsCSSProperty kBorderLeftIDs[] = {
eCSSProperty_border_left_color
};
PRInt32 CSSParserImpl::SearchKeywordTable(nsCSSKeyword aKeyword, const PRInt32 aKeywordTable[])
{
PRInt32 index = 0;
while (0 <= aKeywordTable[index]) {
if (aKeyword == nsCSSKeyword(aKeywordTable[index++])) {
return index;
}
index++;
}
return -1;
}
PRBool CSSParserImpl::ParseEnum(nsresult& aErrorCode, nsCSSValue& aValue,
const PRInt32 aKeywordTable[])
{
@ -3463,9 +3450,9 @@ PRBool CSSParserImpl::ParseEnum(nsresult& aErrorCode, nsCSSValue& aValue,
}
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(*ident);
if (eCSSKeyword_UNKNOWN < keyword) {
PRInt32 index = SearchKeywordTable(keyword, aKeywordTable);
if (0 < index) {
aValue.SetIntValue(aKeywordTable[index], eCSSUnit_Enumerated);
PRInt32 value;
if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) {
aValue.SetIntValue(value, eCSSUnit_Enumerated);
return PR_TRUE;
}
}
@ -3605,9 +3592,9 @@ PRBool CSSParserImpl::ParseVariant(nsresult& aErrorCode, nsCSSValue& aValue,
}
}
if ((aVariantMask & VARIANT_KEYWORD) != 0) {
PRInt32 index = SearchKeywordTable(keyword, aKeywordTable);
if (0 < index) {
aValue.SetIntValue(aKeywordTable[index], eCSSUnit_Enumerated);
PRInt32 value;
if (nsCSSProps::FindKeyword(keyword, aKeywordTable, value)) {
aValue.SetIntValue(value, eCSSUnit_Enumerated);
return PR_TRUE;
}
}
@ -3753,8 +3740,9 @@ PRBool CSSParserImpl::ParseCounter(nsresult& aErrorCode, nsCSSValue& aValue)
if (ExpectSymbol(aErrorCode, ',', PR_TRUE)) {
if (GetToken(aErrorCode, PR_TRUE) && (eCSSToken_Ident == mToken.mType)) {
nsCSSKeyword keyword = nsCSSKeywords::LookupKeyword(mToken.mIdent);
PRInt32 dummy;
if ((eCSSKeyword_UNKNOWN < keyword) &&
(0 < SearchKeywordTable(keyword, nsCSSProps::kListStyleKTable))) {
nsCSSProps::FindKeyword(keyword, nsCSSProps::kListStyleKTable, dummy)) {
counter.Append(PRUnichar(','));
counter.Append(mToken.mIdent);
}

Просмотреть файл

@ -236,7 +236,7 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
eCSSKeyword_menubar, NS_THEME_MENUBAR,
eCSSKeyword_menupopup, NS_THEME_MENUPOPUP,
eCSSKeyword_menuitem, NS_THEME_MENUITEM,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
// Keyword id tables for variant/enum parsing
@ -253,38 +253,38 @@ const PRInt32 nsCSSProps::kAzimuthKTable[] = {
eCSSKeyword_behind, NS_STYLE_AZIMUTH_BEHIND,
eCSSKeyword_leftwards, NS_STYLE_AZIMUTH_LEFTWARDS,
eCSSKeyword_rightwards, NS_STYLE_AZIMUTH_RIGHTWARDS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundAttachmentKTable[] = {
eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED,
eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundColorKTable[] = {
eCSSKeyword_transparent, NS_STYLE_BG_COLOR_TRANSPARENT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundClipKTable[] = {
eCSSKeyword_border, NS_STYLE_BG_CLIP_BORDER,
eCSSKeyword_padding, NS_STYLE_BG_CLIP_PADDING,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundInlinePolicyKTable[] = {
eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX,
eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS,
eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundOriginKTable[] = {
eCSSKeyword_border, NS_STYLE_BG_ORIGIN_BORDER,
eCSSKeyword_padding, NS_STYLE_BG_ORIGIN_PADDING,
eCSSKeyword_content, NS_STYLE_BG_ORIGIN_CONTENT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
@ -292,33 +292,33 @@ const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_XY,
eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_X,
eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_Y,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundXPositionKTable[] = {
eCSSKeyword_left, 0,
eCSSKeyword_center, 50,
eCSSKeyword_right, 100,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBackgroundYPositionKTable[] = {
eCSSKeyword_top, 0,
eCSSKeyword_center, 50,
eCSSKeyword_bottom, 100,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderCollapseKTable[] = {
eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE,
eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderColorKTable[] = {
eCSSKeyword_transparent, NS_STYLE_COLOR_TRANSPARENT,
eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
@ -334,27 +334,27 @@ const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
eCSSKeyword__moz_bg_inset, NS_STYLE_BORDER_STYLE_BG_INSET,
eCSSKeyword__moz_bg_outset, NS_STYLE_BORDER_STYLE_BG_OUTSET,
eCSSKeyword__moz_bg_solid, NS_STYLE_BORDER_STYLE_BG_SOLID,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL,
eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT,
eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER,
eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
@ -362,14 +362,14 @@ const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
eCSSKeyword_right, NS_SIDE_RIGHT,
eCSSKeyword_bottom, NS_SIDE_BOTTOM,
eCSSKeyword_left, NS_SIDE_LEFT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kClearKTable[] = {
eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kColorKTable[] = {
@ -422,7 +422,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = {
eCSSKeyword__moz_mac_accentdarkshadow, nsILookAndFeel::eColor__moz_mac_accentdarkshadow,
eCSSKeyword__moz_mac_accentdarkestshadow, nsILookAndFeel::eColor__moz_mac_accentdarkestshadow,
eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kContentKTable[] = {
@ -430,7 +430,7 @@ const PRInt32 nsCSSProps::kContentKTable[] = {
eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kCursorKTable[] = {
@ -478,13 +478,13 @@ const PRInt32 nsCSSProps::kCursorKTable[] = {
eCSSKeyword__moz_spinning, NS_STYLE_CURSOR_SPINNING,
eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kDirectionKTable[] = {
eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR,
eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kDisplayKTable[] = {
@ -518,7 +518,7 @@ const PRInt32 nsCSSProps::kDisplayKTable[] = {
eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP,
eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX,
eCSSKeyword__moz_page_break, NS_STYLE_DISPLAY_PAGE_BREAK,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kElevationKTable[] = {
@ -527,20 +527,20 @@ const PRInt32 nsCSSProps::kElevationKTable[] = {
eCSSKeyword_above, NS_STYLE_ELEVATION_ABOVE,
eCSSKeyword_higher, NS_STYLE_ELEVATION_HIGHER,
eCSSKeyword_lower, NS_STYLE_ELEVATION_LOWER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFloatKTable[] = {
eCSSKeyword_left, NS_STYLE_FLOAT_LEFT,
eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
@ -548,7 +548,7 @@ const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
eCSSKeyword_border_box, NS_STYLE_FLOAT_EDGE_BORDER,
eCSSKeyword_padding_box, NS_STYLE_FLOAT_EDGE_PADDING,
eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontKTable[] = {
@ -571,7 +571,7 @@ const PRInt32 nsCSSProps::kFontKTable[] = {
eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontSizeKTable[] = {
@ -584,7 +584,7 @@ const PRInt32 nsCSSProps::kFontSizeKTable[] = {
eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontStretchKTable[] = {
@ -598,36 +598,36 @@ const PRInt32 nsCSSProps::kFontStretchKTable[] = {
eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontStyleKTable[] = {
eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontVariantKTable[] = {
eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kFontWeightKTable[] = {
eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
// XXX What's the point?
const PRInt32 nsCSSProps::kKeyEquivalentKTable[] = {
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kListStyleKTable[] = {
@ -682,12 +682,12 @@ const PRInt32 nsCSSProps::kListStyleKTable[] = {
eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
eCSSKeyword_invert, NS_STYLE_COLOR_INVERT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kOverflowKTable[] = {
@ -699,7 +699,7 @@ const PRInt32 nsCSSProps::kOverflowKTable[] = {
eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
@ -708,7 +708,7 @@ const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
// Deprecated:
eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageBreakKTable[] = {
@ -716,24 +716,24 @@ const PRInt32 nsCSSProps::kPageBreakKTable[] = {
eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageMarksKTable[] = {
eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPageSizeKTable[] = {
eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPitchKTable[] = {
@ -742,7 +742,7 @@ const PRInt32 nsCSSProps::kPitchKTable[] = {
eCSSKeyword_medium, NS_STYLE_PITCH_MEDIUM,
eCSSKeyword_high, NS_STYLE_PITCH_HIGH,
eCSSKeyword_x_high, NS_STYLE_PITCH_X_HIGH,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kPositionKTable[] = {
@ -750,29 +750,29 @@ const PRInt32 nsCSSProps::kPositionKTable[] = {
eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakKTable[] = {
eCSSKeyword_spell_out, NS_STYLE_SPEAK_SPELL_OUT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakHeaderKTable[] = {
eCSSKeyword_once, NS_STYLE_SPEAK_HEADER_ONCE,
eCSSKeyword_always, NS_STYLE_SPEAK_HEADER_ALWAYS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakNumeralKTable[] = {
eCSSKeyword_digits, NS_STYLE_SPEAK_NUMERAL_DIGITS,
eCSSKeyword_continuous, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeakPunctuationKTable[] = {
eCSSKeyword_code, NS_STYLE_SPEAK_PUNCTUATION_CODE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
@ -783,12 +783,12 @@ const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
eCSSKeyword_x_fast, NS_STYLE_SPEECH_RATE_X_FAST,
eCSSKeyword_faster, NS_STYLE_SPEECH_RATE_FASTER,
eCSSKeyword_slower, NS_STYLE_SPEECH_RATE_SLOWER,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTextAlignKTable[] = {
@ -799,7 +799,7 @@ const PRInt32 nsCSSProps::kTextAlignKTable[] = {
eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
@ -808,20 +808,20 @@ const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_BLINK,
eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kTextTransformKTable[] = {
eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserFocusKTable[] = {
@ -831,20 +831,20 @@ const PRInt32 nsCSSProps::kUserFocusKTable[] = {
eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER,
eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME,
eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserInputKTable[] = {
eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED,
eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserModifyKTable[] = {
eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY,
eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kUserSelectKTable[] = {
@ -855,7 +855,7 @@ const PRInt32 nsCSSProps::kUserSelectKTable[] = {
eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE,
eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE,
eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
@ -867,14 +867,14 @@ const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kVisibilityKTable[] = {
eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kVolumeKTable[] = {
@ -884,14 +884,14 @@ const PRInt32 nsCSSProps::kVolumeKTable[] = {
eCSSKeyword_medium, NS_STYLE_VOLUME_MEDIUM,
eCSSKeyword_loud, NS_STYLE_VOLUME_LOUD,
eCSSKeyword_x_loud, NS_STYLE_VOLUME_X_LOUD,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_MOZ_PRE_WRAP,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
// Specific keyword tables for XUL.properties
@ -901,13 +901,13 @@ const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE,
eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL,
eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
@ -915,7 +915,7 @@ const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL,
eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
const PRInt32 nsCSSProps::kBoxPackKTable[] = {
@ -923,7 +923,7 @@ const PRInt32 nsCSSProps::kBoxPackKTable[] = {
eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER,
eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY,
-1,-1
eCSSKeyword_UNKNOWN,-1
};
#ifdef MOZ_SVG
@ -941,13 +941,13 @@ const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kFillRuleKTable[] = {
eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
@ -960,71 +960,85 @@ const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
-1, -1
eCSSKeyword_UNKNOWN, -1
};
#endif
PRInt32
nsCSSProps::SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[])
PRBool
nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
{
PRInt32 index = 0;
while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
if (aKeyword == nsCSSKeyword(aTable[index])) {
aResult = aTable[index+1];
return PR_TRUE;
}
index += 2;
}
return PR_FALSE;
}
nsCSSKeyword
nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
{
PRInt32 i = 1;
for (;;) {
if (aTable[i] == -1 && aTable[i-1] == -1) {
if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
break;
}
if (aValue == aTable[i]) {
return PRInt32(aTable[i-1]);
return nsCSSKeyword(aTable[i-1]);
}
i += 2;
}
return -1;
return eCSSKeyword_UNKNOWN;
}
const nsAFlatCString&
nsCSSProps::SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[])
nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
{
PRInt32 i = SearchKeywordTableInt(aValue, aTable);
if (i < 0) {
nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
if (keyword == eCSSKeyword_UNKNOWN) {
static nsDependentCString sNullStr("");
return sNullStr;
} else {
return nsCSSKeywords::GetStringValue(nsCSSKeyword(i));
return nsCSSKeywords::GetStringValue(keyword);
}
}
@ -1045,7 +1059,7 @@ nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
kwtable = kKeywordTableTable[aProp];
if (kwtable)
return SearchKeywordTable(aValue, kwtable);
return ValueToKeyword(aValue, kwtable);
static nsDependentCString sNullStr("");
return sNullStr;
@ -1054,18 +1068,17 @@ nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
{
PRBool rv = PR_FALSE;
PRInt32 keyword = -1;
// first get the keyword corresponding to the property Value from the color table
keyword = SearchKeywordTableInt(aPropValue, kColorKTable);
nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
// next get the name as a string from the keywords table
if (keyword >= 0) {
if (keyword != eCSSKeyword_UNKNOWN) {
nsCSSKeywords::AddRefTable();
aStr = nsCSSKeywords::GetStringValue((nsCSSKeyword)keyword);
aStr = nsCSSKeywords::GetStringValue(keyword);
nsCSSKeywords::ReleaseTable();
rv = PR_TRUE;
}
}
return rv;
}

Просмотреть файл

@ -41,6 +41,7 @@
#include "nsChangeHint.h"
#include "nsCSSProperty.h"
#include "nsStyleStruct.h"
#include "nsCSSKeywords.h"
class nsCSSProps {
public:
@ -69,8 +70,14 @@ public:
// Sets the aStr param to the name of the propertyID
static PRBool GetColorName(PRInt32 aPropID, nsCString &aStr);
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
static const nsAFlatCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
// Find |aKeyword| in |aTable|, if found set |aValue| to its corresponding value.
// If not found, return PR_FALSE and do not set |aValue|.
static PRBool FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aValue);
// Return the first keyword in |aTable| that has the corresponding value |aValue|.
// Return |eCSSKeyword_UNKNOWN| if not found.
static nsCSSKeyword ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[]);
// Ditto but as a string, return "" when not found.
static const nsAFlatCString& ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[]);
static const nsCSSType kTypeTable[eCSSProperty_COUNT_no_shorthands];
static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];

Просмотреть файл

@ -408,8 +408,8 @@ nsComputedDOMStyle::GetClear(nsIFrame *aFrame,
if (display && display->mBreakType != NS_STYLE_CLEAR_NONE) {
const nsAFlatCString& clear =
nsCSSProps::SearchKeywordTable(display->mBreakType,
nsCSSProps::kClearKTable);
nsCSSProps::ValueToKeyword(display->mBreakType,
nsCSSProps::kClearKTable);
val->SetIdent(clear);
} else {
val->SetIdent(nsLayoutAtoms::none);
@ -430,8 +430,8 @@ nsComputedDOMStyle::GetCssFloat(nsIFrame *aFrame,
if (display && display->mFloats != NS_STYLE_FLOAT_NONE) {
const nsAFlatCString& cssFloat =
nsCSSProps::SearchKeywordTable(display->mFloats,
nsCSSProps::kFloatKTable);
nsCSSProps::ValueToKeyword(display->mFloats,
nsCSSProps::kFloatKTable);
val->SetIdent(cssFloat);
} else {
val->SetIdent(nsLayoutAtoms::none);
@ -683,8 +683,8 @@ nsComputedDOMStyle::GetFontStyle(nsIFrame *aFrame,
if (font && font->mFont.style != NS_STYLE_FONT_STYLE_NORMAL) {
const nsAFlatCString& style=
nsCSSProps::SearchKeywordTable(font->mFont.style,
nsCSSProps::kFontStyleKTable);
nsCSSProps::ValueToKeyword(font->mFont.style,
nsCSSProps::kFontStyleKTable);
val->SetIdent(style);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -705,8 +705,8 @@ nsComputedDOMStyle::GetFontWeight(nsIFrame *aFrame,
if (font) {
const nsAFlatCString& str_weight=
nsCSSProps::SearchKeywordTable(font->mFont.weight,
nsCSSProps::kFontWeightKTable);
nsCSSProps::ValueToKeyword(font->mFont.weight,
nsCSSProps::kFontWeightKTable);
if (!str_weight.IsEmpty()) {
val->SetIdent(str_weight);
} else {
@ -729,8 +729,8 @@ nsComputedDOMStyle::GetFontVariant(nsIFrame *aFrame,
if (font && font->mFont.variant != NS_STYLE_FONT_VARIANT_NORMAL) {
const nsAFlatCString& variant=
nsCSSProps::SearchKeywordTable(font->mFont.variant,
nsCSSProps::kFontVariantKTable);
nsCSSProps::ValueToKeyword(font->mFont.variant,
nsCSSProps::kFontVariantKTable);
val->SetIdent(variant);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -752,8 +752,8 @@ nsComputedDOMStyle::GetBackgroundAttachment(nsIFrame *aFrame,
if (background) {
const nsAFlatCString& backgroundAttachment =
nsCSSProps::SearchKeywordTable(background->mBackgroundAttachment,
nsCSSProps::kBackgroundAttachmentKTable);
nsCSSProps::ValueToKeyword(background->mBackgroundAttachment,
nsCSSProps::kBackgroundAttachmentKTable);
val->SetIdent(backgroundAttachment);
}
@ -776,8 +776,8 @@ nsComputedDOMStyle::GetBackgroundClip(nsIFrame *aFrame,
}
const nsAFlatCString& backgroundClip =
nsCSSProps::SearchKeywordTable(clip,
nsCSSProps::kBackgroundClipKTable);
nsCSSProps::ValueToKeyword(clip,
nsCSSProps::kBackgroundClipKTable);
val->SetIdent(backgroundClip);
@ -797,8 +797,8 @@ nsComputedDOMStyle::GetBackgroundColor(nsIFrame *aFrame,
if (color) {
if (color->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) {
const nsAFlatCString& backgroundColor =
nsCSSProps::SearchKeywordTable(NS_STYLE_BG_COLOR_TRANSPARENT,
nsCSSProps::kBackgroundColorKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_BG_COLOR_TRANSPARENT,
nsCSSProps::kBackgroundColorKTable);
val->SetIdent(backgroundColor);
} else {
nsDOMCSSRGBColor *rgb = nsnull;
@ -857,8 +857,8 @@ nsComputedDOMStyle::GetBackgroundInlinePolicy(nsIFrame *aFrame,
}
const nsAFlatCString& backgroundPolicy =
nsCSSProps::SearchKeywordTable(policy,
nsCSSProps::kBackgroundInlinePolicyKTable);
nsCSSProps::ValueToKeyword(policy,
nsCSSProps::kBackgroundInlinePolicyKTable);
val->SetIdent(backgroundPolicy);
@ -881,8 +881,8 @@ nsComputedDOMStyle::GetBackgroundOrigin(nsIFrame *aFrame,
}
const nsAFlatCString& backgroundOrigin =
nsCSSProps::SearchKeywordTable(origin,
nsCSSProps::kBackgroundOriginKTable);
nsCSSProps::ValueToKeyword(origin,
nsCSSProps::kBackgroundOriginKTable);
val->SetIdent(backgroundOrigin);
@ -902,8 +902,8 @@ nsComputedDOMStyle::GetBackgroundRepeat(nsIFrame *aFrame,
if (background) {
const nsAFlatCString& backgroundRepeat =
nsCSSProps::SearchKeywordTable(background->mBackgroundRepeat,
nsCSSProps::kBackgroundRepeatKTable);
nsCSSProps::ValueToKeyword(background->mBackgroundRepeat,
nsCSSProps::kBackgroundRepeatKTable);
val->SetIdent(backgroundRepeat);
}
@ -960,8 +960,8 @@ nsComputedDOMStyle::GetBorderCollapse(nsIFrame *aFrame,
if (table) {
const nsAFlatCString& ident=
nsCSSProps::SearchKeywordTable(table->mBorderCollapse,
nsCSSProps::kBorderCollapseKTable);
nsCSSProps::ValueToKeyword(table->mBorderCollapse,
nsCSSProps::kBorderCollapseKTable);
val->SetIdent(ident);
}
@ -1021,8 +1021,8 @@ nsComputedDOMStyle::GetCaptionSide(nsIFrame *aFrame,
if (table) {
const nsAFlatCString& side =
nsCSSProps::SearchKeywordTable(table->mCaptionSide,
nsCSSProps::kCaptionSideKTable);
nsCSSProps::ValueToKeyword(table->mCaptionSide,
nsCSSProps::kCaptionSideKTable);
val->SetIdent(side);
}
@ -1041,8 +1041,8 @@ nsComputedDOMStyle::GetEmptyCells(nsIFrame *aFrame,
if (table) {
const nsAFlatCString& emptyCells =
nsCSSProps::SearchKeywordTable(table->mEmptyCells,
nsCSSProps::kEmptyCellsKTable);
nsCSSProps::ValueToKeyword(table->mEmptyCells,
nsCSSProps::kEmptyCellsKTable);
val->SetIdent(emptyCells);
}
@ -1061,8 +1061,8 @@ nsComputedDOMStyle::GetTableLayout(nsIFrame *aFrame,
if (table && table->mLayoutStrategy != NS_STYLE_TABLE_LAYOUT_AUTO) {
const nsAFlatCString& tableLayout =
nsCSSProps::SearchKeywordTable(table->mLayoutStrategy,
nsCSSProps::kTableLayoutKTable);
nsCSSProps::ValueToKeyword(table->mLayoutStrategy,
nsCSSProps::kTableLayoutKTable);
val->SetIdent(tableLayout);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -1332,8 +1332,8 @@ nsComputedDOMStyle::GetOutlineWidth(nsIFrame *aFrame,
case eStyleUnit_Chars:
{
const nsAFlatCString& width=
nsCSSProps::SearchKeywordTable(outline->mOutlineWidth.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
nsCSSProps::ValueToKeyword(outline->mOutlineWidth.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
val->SetIdent(width);
break;
}
@ -1363,8 +1363,8 @@ nsComputedDOMStyle::GetOutlineStyle(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::none);
} else {
const nsAFlatCString& style=
nsCSSProps::SearchKeywordTable(outlineStyle,
nsCSSProps::kBorderStyleKTable);
nsCSSProps::ValueToKeyword(outlineStyle,
nsCSSProps::kBorderStyleKTable);
val->SetIdent(style);
}
}
@ -1464,8 +1464,8 @@ nsComputedDOMStyle::GetListStylePosition(nsIFrame *aFrame,
if (list) {
const nsAFlatCString& style =
nsCSSProps::SearchKeywordTable(list->mListStylePosition,
nsCSSProps::kListStylePositionKTable);
nsCSSProps::ValueToKeyword(list->mListStylePosition,
nsCSSProps::kListStylePositionKTable);
val->SetIdent(style);
}
@ -1487,8 +1487,8 @@ nsComputedDOMStyle::GetListStyleType(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::none);
} else {
const nsAFlatCString& style =
nsCSSProps::SearchKeywordTable(list->mListStyleType,
nsCSSProps::kListStyleKTable);
nsCSSProps::ValueToKeyword(list->mListStyleType,
nsCSSProps::kListStyleKTable);
val->SetIdent(style);
}
}
@ -1605,8 +1605,8 @@ nsComputedDOMStyle::GetVerticalAlign(nsIFrame *aFrame,
case eStyleUnit_Enumerated:
{
const nsAFlatCString& align =
nsCSSProps::SearchKeywordTable(text->mVerticalAlign.GetIntValue(),
nsCSSProps::kVerticalAlignKTable);
nsCSSProps::ValueToKeyword(text->mVerticalAlign.GetIntValue(),
nsCSSProps::kVerticalAlignKTable);
val->SetIdent(align);
break;
}
@ -1648,8 +1648,8 @@ nsComputedDOMStyle::GetTextAlign(nsIFrame *aFrame,
if (text) {
const nsAFlatCString& align=
nsCSSProps::SearchKeywordTable(text->mTextAlign,
nsCSSProps::kTextAlignKTable);
nsCSSProps::ValueToKeyword(text->mTextAlign,
nsCSSProps::kTextAlignKTable);
val->SetIdent(align);
}
@ -1675,8 +1675,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
nsAutoString decorationString;
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_UNDERLINE) {
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_UNDERLINE,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_UNDERLINE,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_OVERLINE) {
@ -1684,8 +1684,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
decorationString.Append(PRUnichar(' '));
}
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_OVERLINE,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_OVERLINE,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_LINE_THROUGH) {
@ -1693,8 +1693,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
decorationString.Append(PRUnichar(' '));
}
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
if (text->mTextDecoration & NS_STYLE_TEXT_DECORATION_BLINK) {
@ -1702,8 +1702,8 @@ nsComputedDOMStyle::GetTextDecoration(nsIFrame *aFrame,
decorationString.Append(PRUnichar(' '));
}
const nsAFlatCString& decoration=
nsCSSProps::SearchKeywordTable(NS_STYLE_TEXT_DECORATION_BLINK,
nsCSSProps::kTextDecorationKTable);
nsCSSProps::ValueToKeyword(NS_STYLE_TEXT_DECORATION_BLINK,
nsCSSProps::kTextDecorationKTable);
decorationString.AppendWithConversion(decoration.get());
}
val->SetString(decorationString);
@ -1763,8 +1763,8 @@ nsComputedDOMStyle::GetTextTransform(nsIFrame *aFrame,
if (text && text->mTextTransform != NS_STYLE_TEXT_TRANSFORM_NONE) {
const nsAFlatCString& textTransform =
nsCSSProps::SearchKeywordTable(text->mTextTransform,
nsCSSProps::kTextTransformKTable);
nsCSSProps::ValueToKeyword(text->mTextTransform,
nsCSSProps::kTextTransformKTable);
val->SetIdent(textTransform);
} else {
val->SetIdent(nsLayoutAtoms::none);
@ -1823,8 +1823,8 @@ nsComputedDOMStyle::GetWhiteSpace(nsIFrame *aFrame,
if (text && text->mWhiteSpace != NS_STYLE_WHITESPACE_NORMAL) {
const nsAFlatCString& whiteSpace =
nsCSSProps::SearchKeywordTable(text->mWhiteSpace,
nsCSSProps::kWhitespaceKTable);
nsCSSProps::ValueToKeyword(text->mWhiteSpace,
nsCSSProps::kWhitespaceKTable);
val->SetIdent(whiteSpace);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -1846,8 +1846,8 @@ nsComputedDOMStyle::GetVisibility(nsIFrame *aFrame,
if (visibility) {
const nsAFlatCString& value=
nsCSSProps::SearchKeywordTable(visibility->mVisible,
nsCSSProps::kVisibilityKTable);
nsCSSProps::ValueToKeyword(visibility->mVisible,
nsCSSProps::kVisibilityKTable);
val->SetIdent(value);
}
@ -1867,8 +1867,8 @@ nsComputedDOMStyle::GetDirection(nsIFrame *aFrame,
if (visibility) {
const nsAFlatCString & direction =
nsCSSProps::SearchKeywordTable(visibility->mDirection,
nsCSSProps::kDirectionKTable);
nsCSSProps::ValueToKeyword(visibility->mDirection,
nsCSSProps::kDirectionKTable);
val->SetIdent(direction);
}
@ -1887,8 +1887,8 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame,
if (text && text->mUnicodeBidi != NS_STYLE_UNICODE_BIDI_NORMAL) {
const nsAFlatCString& bidi =
nsCSSProps::SearchKeywordTable(text->mUnicodeBidi,
nsCSSProps::kUnicodeBidiKTable);
nsCSSProps::ValueToKeyword(text->mUnicodeBidi,
nsCSSProps::kUnicodeBidiKTable);
val->SetIdent(bidi);
} else {
val->SetIdent(nsLayoutAtoms::normal);
@ -1912,8 +1912,8 @@ nsComputedDOMStyle::GetCursor(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::autoAtom);
} else {
const nsAFlatCString& cursor =
nsCSSProps::SearchKeywordTable(ui->mCursor,
nsCSSProps::kCursorKTable);
nsCSSProps::ValueToKeyword(ui->mCursor,
nsCSSProps::kCursorKTable);
val->SetIdent(cursor);
}
}
@ -1938,8 +1938,8 @@ nsComputedDOMStyle::GetAppearance(nsIFrame *aFrame,
}
const nsAFlatCString& appearanceIdent =
nsCSSProps::SearchKeywordTable(appearance,
nsCSSProps::kAppearanceKTable);
nsCSSProps::ValueToKeyword(appearance,
nsCSSProps::kAppearanceKTable);
val->SetIdent(appearanceIdent);
return CallQueryInterface(val, aValue);
@ -1962,8 +1962,8 @@ nsComputedDOMStyle::GetBoxAlign(nsIFrame *aFrame,
}
const nsAFlatCString& boxAlignIdent =
nsCSSProps::SearchKeywordTable(boxAlign,
nsCSSProps::kBoxAlignKTable);
nsCSSProps::ValueToKeyword(boxAlign,
nsCSSProps::kBoxAlignKTable);
val->SetIdent(boxAlignIdent);
return CallQueryInterface(val, aValue);
@ -1985,8 +1985,8 @@ nsComputedDOMStyle::GetBoxDirection(nsIFrame *aFrame,
}
const nsAFlatCString& boxDirectionIdent =
nsCSSProps::SearchKeywordTable(boxDirection,
nsCSSProps::kBoxDirectionKTable);
nsCSSProps::ValueToKeyword(boxDirection,
nsCSSProps::kBoxDirectionKTable);
val->SetIdent(boxDirectionIdent);
return CallQueryInterface(val, aValue);
@ -2048,8 +2048,8 @@ nsComputedDOMStyle::GetBoxOrient(nsIFrame *aFrame,
}
const nsAFlatCString& boxOrientIdent =
nsCSSProps::SearchKeywordTable(boxOrient,
nsCSSProps::kBoxOrientKTable);
nsCSSProps::ValueToKeyword(boxOrient,
nsCSSProps::kBoxOrientKTable);
val->SetIdent(boxOrientIdent);
return CallQueryInterface(val, aValue);
@ -2071,8 +2071,8 @@ nsComputedDOMStyle::GetBoxPack(nsIFrame *aFrame,
}
const nsAFlatCString& boxPackIdent =
nsCSSProps::SearchKeywordTable(boxPack,
nsCSSProps::kBoxPackKTable);
nsCSSProps::ValueToKeyword(boxPack,
nsCSSProps::kBoxPackKTable);
val->SetIdent(boxPackIdent);
return CallQueryInterface(val, aValue);
@ -2095,8 +2095,8 @@ nsComputedDOMStyle::GetBoxSizing(nsIFrame *aFrame,
}
const nsAFlatCString& boxSizingIdent =
nsCSSProps::SearchKeywordTable(boxSizing,
nsCSSProps::kBoxSizingKTable);
nsCSSProps::ValueToKeyword(boxSizing,
nsCSSProps::kBoxSizingKTable);
val->SetIdent(boxSizingIdent);
return CallQueryInterface(val, aValue);
@ -2118,8 +2118,8 @@ nsComputedDOMStyle::GetFloatEdge(nsIFrame *aFrame,
}
const nsAFlatCString& floatEdgeIdent =
nsCSSProps::SearchKeywordTable(floatEdge,
nsCSSProps::kFloatEdgeKTable);
nsCSSProps::ValueToKeyword(floatEdge,
nsCSSProps::kFloatEdgeKTable);
val->SetIdent(floatEdgeIdent);
return CallQueryInterface(val, aValue);
@ -2144,8 +2144,8 @@ nsComputedDOMStyle::GetUserFocus(nsIFrame *aFrame,
val->SetIdent(userFocusIdent);
} else {
const nsAFlatCString& userFocusIdent =
nsCSSProps::SearchKeywordTable(uiData->mUserFocus,
nsCSSProps::kUserFocusKTable);
nsCSSProps::ValueToKeyword(uiData->mUserFocus,
nsCSSProps::kUserFocusKTable);
val->SetIdent(userFocusIdent);
}
} else {
@ -2175,8 +2175,8 @@ nsComputedDOMStyle::GetUserInput(nsIFrame *aFrame,
val->SetIdent(userInputIdent);
} else {
const nsAFlatCString& userInputIdent =
nsCSSProps::SearchKeywordTable(uiData->mUserInput,
nsCSSProps::kUserInputKTable);
nsCSSProps::ValueToKeyword(uiData->mUserInput,
nsCSSProps::kUserInputKTable);
val->SetIdent(userInputIdent);
}
} else {
@ -2205,8 +2205,8 @@ nsComputedDOMStyle::GetUserModify(nsIFrame *aFrame,
}
const nsAFlatCString& userModifyIdent =
nsCSSProps::SearchKeywordTable(userModify,
nsCSSProps::kUserModifyKTable);
nsCSSProps::ValueToKeyword(userModify,
nsCSSProps::kUserModifyKTable);
val->SetIdent(userModifyIdent);
return CallQueryInterface(val, aValue);
@ -2229,8 +2229,8 @@ nsComputedDOMStyle::GetUserSelect(nsIFrame *aFrame,
val->SetIdent(userSelectIdent);
} else {
const nsAFlatCString& userSelectIdent =
nsCSSProps::SearchKeywordTable(uiData->mUserSelect,
nsCSSProps::kUserSelectKTable);
nsCSSProps::ValueToKeyword(uiData->mUserSelect,
nsCSSProps::kUserSelectKTable);
val->SetIdent(userSelectIdent);
}
} else {
@ -2258,8 +2258,8 @@ nsComputedDOMStyle::GetDisplay(nsIFrame *aFrame,
val->SetIdent(nsLayoutAtoms::none);
} else {
const nsAFlatCString& display =
nsCSSProps::SearchKeywordTable(displayData->mDisplay,
nsCSSProps::kDisplayKTable);
nsCSSProps::ValueToKeyword(displayData->mDisplay,
nsCSSProps::kDisplayKTable);
val->SetIdent(display);
}
}
@ -2280,8 +2280,8 @@ nsComputedDOMStyle::GetPosition(nsIFrame *aFrame,
if (display) {
const nsAFlatCString& position =
nsCSSProps::SearchKeywordTable(display->mPosition,
nsCSSProps::kPositionKTable);
nsCSSProps::ValueToKeyword(display->mPosition,
nsCSSProps::kPositionKTable);
val->SetIdent(position);
}
@ -2381,8 +2381,8 @@ nsComputedDOMStyle::GetOverflow(nsIFrame *aFrame,
if (display && display->mOverflowX == display->mOverflowY) {
if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowKTable);
nsCSSProps::ValueToKeyword(display->mOverflowX,
nsCSSProps::kOverflowKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -2404,8 +2404,8 @@ nsComputedDOMStyle::GetOverflowX(nsIFrame *aFrame,
if (display && display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::ValueToKeyword(display->mOverflowX,
nsCSSProps::kOverflowSubKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -2426,8 +2426,8 @@ nsComputedDOMStyle::GetOverflowY(nsIFrame *aFrame,
if (display && display->mOverflowY != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowY,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::ValueToKeyword(display->mOverflowY,
nsCSSProps::kOverflowSubKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -3387,8 +3387,8 @@ nsComputedDOMStyle::GetBorderWidthFor(PRUint8 aSide, nsIFrame *aFrame,
case eStyleUnit_Chars:
{
const nsAFlatCString& width=
nsCSSProps::SearchKeywordTable(coord.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
nsCSSProps::ValueToKeyword(coord.GetIntValue(),
nsCSSProps::kBorderWidthKTable);
val->SetIdent(width);
break;
}
@ -3499,8 +3499,8 @@ nsComputedDOMStyle::GetBorderStyleFor(PRUint8 aSide, nsIFrame *aFrame,
if (borderStyle != NS_STYLE_BORDER_STYLE_NONE) {
const nsAFlatCString& style=
nsCSSProps::SearchKeywordTable(borderStyle,
nsCSSProps::kBorderStyleKTable);
nsCSSProps::ValueToKeyword(borderStyle,
nsCSSProps::kBorderStyleKTable);
val->SetIdent(style);
} else {
val->SetIdent(nsLayoutAtoms::none);