Back to index

lightning-sunbird  0.9+nobinonly
nsCSSProps.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Mats Palmgren <mats.palmgren@bredband.net>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsCSSProps.h"
00040 #include "nsCSSKeywords.h"
00041 #include "nsStyleConsts.h"
00042 #include "nsThemeConstants.h"  // For system widget appearance types
00043 
00044 #include "nsILookAndFeel.h" // for system colors
00045 
00046 #include "nsString.h"
00047 #include "nsReadableUtils.h"
00048 #include "nsStaticNameTable.h"
00049 
00050 // required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it
00051 extern const char* const kCSSRawProperties[];
00052 
00053 // define an array of all CSS properties
00054 const char* const kCSSRawProperties[] = {
00055 #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) #name_,
00056 #include "nsCSSPropList.h"
00057 #undef CSS_PROP
00058 #define CSS_PROP_SHORTHAND(name_, id_, method_) #name_,
00059 #include "nsCSSPropList.h"
00060 #undef CSS_PROP_SHORTHAND
00061 };
00062 
00063 
00064 static PRInt32 gTableRefCount;
00065 static nsStaticCaseInsensitiveNameTable* gPropertyTable;
00066 
00067 void
00068 nsCSSProps::AddRefTable(void) 
00069 {
00070   if (0 == gTableRefCount++) {
00071     NS_ASSERTION(!gPropertyTable, "pre existing array!");
00072     gPropertyTable = new nsStaticCaseInsensitiveNameTable();
00073     if (gPropertyTable) {
00074 #ifdef DEBUG
00075     {
00076       // let's verify the table...
00077       for (PRInt32 index = 0; index < eCSSProperty_COUNT; ++index) {
00078         nsCAutoString temp1(kCSSRawProperties[index]);
00079         nsCAutoString temp2(kCSSRawProperties[index]);
00080         ToLowerCase(temp1);
00081         NS_ASSERTION(temp1.Equals(temp2), "upper case char in table");
00082         NS_ASSERTION(-1 == temp1.FindChar('_'), "underscore char in table");
00083       }
00084     }
00085 #endif      
00086       gPropertyTable->Init(kCSSRawProperties, eCSSProperty_COUNT); 
00087     }
00088   }
00089 }
00090 
00091 void
00092 nsCSSProps::ReleaseTable(void) 
00093 {
00094   if (0 == --gTableRefCount) {
00095     if (gPropertyTable) {
00096       delete gPropertyTable;
00097       gPropertyTable = nsnull;
00098     }
00099   }
00100 }
00101 
00102 struct CSSPropertyAlias {
00103   char name[sizeof("-moz-outline-offset")];
00104   nsCSSProperty id;
00105 };
00106 
00107 static const CSSPropertyAlias gAliases[] = {
00108   { "-moz-opacity", eCSSProperty_opacity },
00109   { "-moz-outline", eCSSProperty_outline },
00110   { "-moz-outline-color", eCSSProperty_outline_color },
00111   { "-moz-outline-style", eCSSProperty_outline_style },
00112   { "-moz-outline-width", eCSSProperty_outline_width },
00113   { "-moz-outline-offset", eCSSProperty_outline_offset }
00114   // Don't forget to update the sizeof in CSSPropertyAlias above with the
00115   // longest string when you add stuff here.
00116 };
00117 
00118 nsCSSProperty 
00119 nsCSSProps::LookupProperty(const nsACString& aProperty)
00120 {
00121   NS_ASSERTION(gPropertyTable, "no lookup table, needs addref");
00122 
00123   nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
00124   if (res == eCSSProperty_UNKNOWN) {
00125     const nsCString& prop = PromiseFlatCString(aProperty);
00126     for (const CSSPropertyAlias *alias = gAliases,
00127                             *alias_end = gAliases + NS_ARRAY_LENGTH(gAliases);
00128          alias < alias_end; ++alias)
00129       if (nsCRT::strcasecmp(prop.get(), alias->name) == 0) {
00130         res = alias->id;
00131         break;
00132       }
00133   }
00134   return res;
00135 }
00136 
00137 nsCSSProperty 
00138 nsCSSProps::LookupProperty(const nsAString& aProperty)
00139 {
00140   // This is faster than converting and calling
00141   // LookupProperty(nsACString&).  The table will do its own
00142   // converting and avoid a PromiseFlatCString() call.
00143   NS_ASSERTION(gPropertyTable, "no lookup table, needs addref");
00144   nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
00145   if (res == eCSSProperty_UNKNOWN) {
00146     NS_ConvertUTF16toUTF8 prop(aProperty);
00147     for (const CSSPropertyAlias *alias = gAliases,
00148                             *alias_end = gAliases + NS_ARRAY_LENGTH(gAliases);
00149          alias < alias_end; ++alias)
00150       if (nsCRT::strcasecmp(prop.get(), alias->name) == 0) {
00151         res = alias->id;
00152         break;
00153       }
00154   }
00155   return res;
00156 }
00157 
00158 const nsAFlatCString& 
00159 nsCSSProps::GetStringValue(nsCSSProperty aProperty)
00160 {
00161   NS_ASSERTION(gPropertyTable, "no lookup table, needs addref");
00162   if (gPropertyTable) {
00163     return gPropertyTable->GetStringValue(PRInt32(aProperty));
00164   } else {
00165     static nsDependentCString sNullStr("");
00166     return sNullStr;
00167   }
00168 }
00169 
00170 
00171 /***************************************************************************/
00172 
00173 const PRInt32 nsCSSProps::kAppearanceKTable[] = {
00174   eCSSKeyword_none,                   NS_THEME_NONE,
00175   eCSSKeyword_button,                 NS_THEME_BUTTON,
00176   eCSSKeyword_radio,                  NS_THEME_RADIO,
00177   eCSSKeyword_checkbox,               NS_THEME_CHECKBOX,
00178   eCSSKeyword_radio_small,            NS_THEME_RADIO_SMALL,
00179   eCSSKeyword_checkbox_small,         NS_THEME_CHECKBOX_SMALL,
00180   eCSSKeyword_button_small,           NS_THEME_BUTTON_SMALL,
00181   eCSSKeyword_button_bevel,           NS_THEME_BUTTON_BEVEL,
00182   eCSSKeyword_toolbox,                NS_THEME_TOOLBOX,
00183   eCSSKeyword_toolbar,                NS_THEME_TOOLBAR,
00184   eCSSKeyword_toolbarbutton,          NS_THEME_TOOLBAR_BUTTON,
00185   eCSSKeyword_toolbargripper,         NS_THEME_TOOLBAR_GRIPPER,
00186   eCSSKeyword_dualbutton,             NS_THEME_TOOLBAR_DUAL_BUTTON,
00187   eCSSKeyword_dualbutton_dropdown,    NS_THEME_TOOLBAR_DUAL_BUTTON_DROPDOWN,
00188   eCSSKeyword_separator,              NS_THEME_TOOLBAR_SEPARATOR,
00189   eCSSKeyword_statusbar,              NS_THEME_STATUSBAR,
00190   eCSSKeyword_statusbarpanel,         NS_THEME_STATUSBAR_PANEL,
00191   eCSSKeyword_resizerpanel,           NS_THEME_STATUSBAR_RESIZER_PANEL,
00192   eCSSKeyword_resizer,                NS_THEME_RESIZER,
00193   eCSSKeyword_listbox,                NS_THEME_LISTBOX,
00194   eCSSKeyword_listitem,               NS_THEME_LISTBOX_LISTITEM,
00195   eCSSKeyword_treeview,               NS_THEME_TREEVIEW,
00196   eCSSKeyword_treeitem,               NS_THEME_TREEVIEW_TREEITEM,
00197   eCSSKeyword_treetwisty,             NS_THEME_TREEVIEW_TWISTY,
00198   eCSSKeyword_treetwistyopen,         NS_THEME_TREEVIEW_TWISTY_OPEN,
00199   eCSSKeyword_treeline,               NS_THEME_TREEVIEW_LINE,
00200   eCSSKeyword_treeheader,             NS_THEME_TREEVIEW_HEADER,
00201   eCSSKeyword_treeheadercell,         NS_THEME_TREEVIEW_HEADER_CELL,
00202   eCSSKeyword_treeheadersortarrow,    NS_THEME_TREEVIEW_HEADER_SORTARROW,
00203   eCSSKeyword_progressbar,            NS_THEME_PROGRESSBAR,
00204   eCSSKeyword_progresschunk,          NS_THEME_PROGRESSBAR_CHUNK,
00205   eCSSKeyword_progressbar_vertical,   NS_THEME_PROGRESSBAR_VERTICAL,
00206   eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL,
00207   eCSSKeyword_tab,                    NS_THEME_TAB,
00208   eCSSKeyword_tab_left_edge,          NS_THEME_TAB_LEFT_EDGE,
00209   eCSSKeyword_tab_right_edge,         NS_THEME_TAB_RIGHT_EDGE,
00210   eCSSKeyword_tabpanels,              NS_THEME_TAB_PANELS,
00211   eCSSKeyword_tabpanel,               NS_THEME_TAB_PANEL,
00212   eCSSKeyword_tooltip,                NS_THEME_TOOLTIP,
00213   eCSSKeyword_spinner,                NS_THEME_SPINNER,
00214   eCSSKeyword_spinner_upbutton,       NS_THEME_SPINNER_UP_BUTTON,
00215   eCSSKeyword_spinner_downbutton,     NS_THEME_SPINNER_DOWN_BUTTON,
00216   eCSSKeyword_scrollbar,              NS_THEME_SCROLLBAR,
00217   eCSSKeyword_scrollbarbutton_up,     NS_THEME_SCROLLBAR_BUTTON_UP,
00218   eCSSKeyword_scrollbarbutton_down,   NS_THEME_SCROLLBAR_BUTTON_DOWN,
00219   eCSSKeyword_scrollbarbutton_left,   NS_THEME_SCROLLBAR_BUTTON_LEFT,
00220   eCSSKeyword_scrollbarbutton_right,  NS_THEME_SCROLLBAR_BUTTON_RIGHT,
00221   eCSSKeyword_scrollbartrack_horizontal,    NS_THEME_SCROLLBAR_TRACK_HORIZONTAL,
00222   eCSSKeyword_scrollbartrack_vertical,      NS_THEME_SCROLLBAR_TRACK_VERTICAL,
00223   eCSSKeyword_scrollbarthumb_horizontal,    NS_THEME_SCROLLBAR_THUMB_HORIZONTAL,
00224   eCSSKeyword_scrollbarthumb_vertical,      NS_THEME_SCROLLBAR_THUMB_VERTICAL,
00225   eCSSKeyword_scrollbargripper_horizontal,  NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL,
00226   eCSSKeyword_scrollbargripper_vertical,    NS_THEME_SCROLLBAR_GRIPPER_VERTICAL,
00227   eCSSKeyword_textfield,              NS_THEME_TEXTFIELD,
00228   eCSSKeyword_caret,                  NS_THEME_TEXTFIELD_CARET,
00229   eCSSKeyword_menulist,               NS_THEME_DROPDOWN,
00230   eCSSKeyword_menulistbutton,         NS_THEME_DROPDOWN_BUTTON,
00231   eCSSKeyword_menulisttext,           NS_THEME_DROPDOWN_TEXT,
00232   eCSSKeyword_menulisttextfield,      NS_THEME_DROPDOWN_TEXTFIELD,
00233   eCSSKeyword_slider,                 NS_THEME_SLIDER,
00234   eCSSKeyword_sliderthumb,            NS_THEME_SLIDER_THUMB,
00235   eCSSKeyword_sliderthumbstart,       NS_THEME_SLIDER_THUMB_START,
00236   eCSSKeyword_sliderthumbend,         NS_THEME_SLIDER_THUMB_END,
00237   eCSSKeyword_sliderthumbtick,        NS_THEME_SLIDER_TICK,
00238   eCSSKeyword_checkboxcontainer,      NS_THEME_CHECKBOX_CONTAINER,
00239   eCSSKeyword_radiocontainer,         NS_THEME_RADIO_CONTAINER,
00240   eCSSKeyword_checkboxlabel,          NS_THEME_CHECKBOX_LABEL,
00241   eCSSKeyword_radiolabel,             NS_THEME_RADIO_LABEL,
00242   eCSSKeyword_buttonfocus,            NS_THEME_BUTTON_FOCUS,
00243   eCSSKeyword_window,                 NS_THEME_WINDOW,
00244   eCSSKeyword_dialog,                 NS_THEME_DIALOG,
00245   eCSSKeyword_menubar,                NS_THEME_MENUBAR,
00246   eCSSKeyword_menupopup,              NS_THEME_MENUPOPUP,
00247   eCSSKeyword_menuitem,               NS_THEME_MENUITEM,
00248   eCSSKeyword_checkmenuitem,          NS_THEME_CHECKMENUITEM,
00249   eCSSKeyword_radiomenuitem,          NS_THEME_RADIOMENUITEM,
00250   eCSSKeyword_UNKNOWN,-1
00251 };
00252 
00253 // Keyword id tables for variant/enum parsing
00254 const PRInt32 nsCSSProps::kAzimuthKTable[] = {
00255   eCSSKeyword_left_side,    NS_STYLE_AZIMUTH_LEFT_SIDE,
00256   eCSSKeyword_far_left,     NS_STYLE_AZIMUTH_FAR_LEFT,
00257   eCSSKeyword_left,         NS_STYLE_AZIMUTH_LEFT,
00258   eCSSKeyword_center_left,  NS_STYLE_AZIMUTH_CENTER_LEFT,
00259   eCSSKeyword_center,       NS_STYLE_AZIMUTH_CENTER,
00260   eCSSKeyword_center_right, NS_STYLE_AZIMUTH_CENTER_RIGHT,
00261   eCSSKeyword_right,        NS_STYLE_AZIMUTH_RIGHT,
00262   eCSSKeyword_far_right,    NS_STYLE_AZIMUTH_FAR_RIGHT,
00263   eCSSKeyword_right_side,   NS_STYLE_AZIMUTH_RIGHT_SIDE,
00264   eCSSKeyword_behind,       NS_STYLE_AZIMUTH_BEHIND,
00265   eCSSKeyword_leftwards,    NS_STYLE_AZIMUTH_LEFTWARDS,
00266   eCSSKeyword_rightwards,   NS_STYLE_AZIMUTH_RIGHTWARDS,
00267   eCSSKeyword_UNKNOWN,-1
00268 };
00269 
00270 const PRInt32 nsCSSProps::kBackgroundAttachmentKTable[] = {
00271   eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED,
00272   eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL,
00273   eCSSKeyword_UNKNOWN,-1
00274 };
00275 
00276 const PRInt32 nsCSSProps::kBackgroundColorKTable[] = {
00277   eCSSKeyword_transparent, NS_STYLE_BG_COLOR_TRANSPARENT,
00278   eCSSKeyword_UNKNOWN,-1
00279 };
00280 
00281 const PRInt32 nsCSSProps::kBackgroundClipKTable[] = {
00282   eCSSKeyword_border,     NS_STYLE_BG_CLIP_BORDER,
00283   eCSSKeyword_padding,    NS_STYLE_BG_CLIP_PADDING,
00284   eCSSKeyword_UNKNOWN,-1
00285 };
00286 
00287 const PRInt32 nsCSSProps::kBackgroundInlinePolicyKTable[] = {
00288   eCSSKeyword_each_box,     NS_STYLE_BG_INLINE_POLICY_EACH_BOX,
00289   eCSSKeyword_continuous,   NS_STYLE_BG_INLINE_POLICY_CONTINUOUS,
00290   eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX,
00291   eCSSKeyword_UNKNOWN,-1
00292 };
00293 
00294 const PRInt32 nsCSSProps::kBackgroundOriginKTable[] = {
00295   eCSSKeyword_border,     NS_STYLE_BG_ORIGIN_BORDER,
00296   eCSSKeyword_padding,    NS_STYLE_BG_ORIGIN_PADDING,
00297   eCSSKeyword_content,    NS_STYLE_BG_ORIGIN_CONTENT,
00298   eCSSKeyword_UNKNOWN,-1
00299 };
00300 
00301 const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
00302   eCSSKeyword_no_repeat,  NS_STYLE_BG_REPEAT_OFF,
00303   eCSSKeyword_repeat,     NS_STYLE_BG_REPEAT_XY,
00304   eCSSKeyword_repeat_x,   NS_STYLE_BG_REPEAT_X,
00305   eCSSKeyword_repeat_y,   NS_STYLE_BG_REPEAT_Y,
00306   eCSSKeyword_UNKNOWN,-1
00307 };
00308 
00309 const PRInt32 nsCSSProps::kBackgroundXPositionKTable[] = {
00310   eCSSKeyword_left,   0,
00311   eCSSKeyword_center, 50,
00312   eCSSKeyword_right,  100,
00313   eCSSKeyword_UNKNOWN,-1
00314 };
00315 
00316 const PRInt32 nsCSSProps::kBackgroundYPositionKTable[] = {
00317   eCSSKeyword_top,    0,
00318   eCSSKeyword_center, 50,
00319   eCSSKeyword_bottom, 100,
00320   eCSSKeyword_UNKNOWN,-1
00321 };
00322 
00323 const PRInt32 nsCSSProps::kBorderCollapseKTable[] = {
00324   eCSSKeyword_collapse,  NS_STYLE_BORDER_COLLAPSE,
00325   eCSSKeyword_separate,  NS_STYLE_BORDER_SEPARATE,
00326   eCSSKeyword_UNKNOWN,-1
00327 };
00328 
00329 const PRInt32 nsCSSProps::kBorderColorKTable[] = {
00330   eCSSKeyword_transparent, NS_STYLE_COLOR_TRANSPARENT,
00331   eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
00332   eCSSKeyword_UNKNOWN,-1
00333 };
00334 
00335 const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
00336   eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN,
00337   eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
00338   eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
00339   eCSSKeyword_solid,  NS_STYLE_BORDER_STYLE_SOLID,
00340   eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
00341   eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
00342   eCSSKeyword_ridge,  NS_STYLE_BORDER_STYLE_RIDGE,
00343   eCSSKeyword_inset,  NS_STYLE_BORDER_STYLE_INSET,
00344   eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
00345   eCSSKeyword__moz_bg_inset,  NS_STYLE_BORDER_STYLE_BG_INSET,
00346   eCSSKeyword__moz_bg_outset, NS_STYLE_BORDER_STYLE_BG_OUTSET,
00347   eCSSKeyword__moz_bg_solid,  NS_STYLE_BORDER_STYLE_BG_SOLID,
00348   eCSSKeyword_UNKNOWN,-1
00349 };
00350 
00351 const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
00352   eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
00353   eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
00354   eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
00355   eCSSKeyword_UNKNOWN,-1
00356 };
00357 
00358 const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
00359   eCSSKeyword_physical,     NS_BOXPROP_SOURCE_PHYSICAL,
00360   eCSSKeyword_logical,      NS_BOXPROP_SOURCE_LOGICAL,
00361   eCSSKeyword_UNKNOWN,-1
00362 };
00363 
00364 const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
00365   eCSSKeyword_content_box,  NS_STYLE_BOX_SIZING_CONTENT,
00366   eCSSKeyword_border_box,   NS_STYLE_BOX_SIZING_BORDER,
00367   eCSSKeyword_padding_box,  NS_STYLE_BOX_SIZING_PADDING,
00368   eCSSKeyword_UNKNOWN,-1
00369 };
00370 
00371 const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
00372   eCSSKeyword_top,    NS_SIDE_TOP,
00373   eCSSKeyword_right,  NS_SIDE_RIGHT,
00374   eCSSKeyword_bottom, NS_SIDE_BOTTOM,
00375   eCSSKeyword_left,   NS_SIDE_LEFT,
00376   eCSSKeyword_UNKNOWN,-1
00377 };
00378 
00379 const PRInt32 nsCSSProps::kClearKTable[] = {
00380   eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
00381   eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
00382   eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
00383   eCSSKeyword_UNKNOWN,-1
00384 };
00385 
00386 const PRInt32 nsCSSProps::kColorKTable[] = {
00387   eCSSKeyword_activeborder, nsILookAndFeel::eColor_activeborder,
00388   eCSSKeyword_activecaption, nsILookAndFeel::eColor_activecaption,
00389   eCSSKeyword_appworkspace, nsILookAndFeel::eColor_appworkspace,
00390   eCSSKeyword_background, nsILookAndFeel::eColor_background,
00391   eCSSKeyword_buttonface, nsILookAndFeel::eColor_buttonface,
00392   eCSSKeyword_buttonhighlight, nsILookAndFeel::eColor_buttonhighlight,
00393   eCSSKeyword_buttonshadow, nsILookAndFeel::eColor_buttonshadow,
00394   eCSSKeyword_buttontext, nsILookAndFeel::eColor_buttontext,
00395   eCSSKeyword_captiontext, nsILookAndFeel::eColor_captiontext,
00396   eCSSKeyword_graytext, nsILookAndFeel::eColor_graytext,
00397   eCSSKeyword_highlight, nsILookAndFeel::eColor_highlight,
00398   eCSSKeyword_highlighttext, nsILookAndFeel::eColor_highlighttext,
00399   eCSSKeyword_inactiveborder, nsILookAndFeel::eColor_inactiveborder,
00400   eCSSKeyword_inactivecaption, nsILookAndFeel::eColor_inactivecaption,
00401   eCSSKeyword_inactivecaptiontext, nsILookAndFeel::eColor_inactivecaptiontext,
00402   eCSSKeyword_infobackground, nsILookAndFeel::eColor_infobackground,
00403   eCSSKeyword_infotext, nsILookAndFeel::eColor_infotext,
00404   eCSSKeyword_menu, nsILookAndFeel::eColor_menu,
00405   eCSSKeyword_menutext, nsILookAndFeel::eColor_menutext,
00406   eCSSKeyword_scrollbar, nsILookAndFeel::eColor_scrollbar,
00407   eCSSKeyword_threeddarkshadow, nsILookAndFeel::eColor_threeddarkshadow,
00408   eCSSKeyword_threedface, nsILookAndFeel::eColor_threedface,
00409   eCSSKeyword_threedhighlight, nsILookAndFeel::eColor_threedhighlight,
00410   eCSSKeyword_threedlightshadow, nsILookAndFeel::eColor_threedlightshadow,
00411   eCSSKeyword_threedshadow, nsILookAndFeel::eColor_threedshadow,
00412   eCSSKeyword_window, nsILookAndFeel::eColor_window,
00413   eCSSKeyword_windowframe, nsILookAndFeel::eColor_windowframe,
00414   eCSSKeyword_windowtext, nsILookAndFeel::eColor_windowtext,
00415   eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT,
00416   eCSSKeyword__moz_buttondefault, nsILookAndFeel::eColor__moz_buttondefault,
00417   eCSSKeyword__moz_buttonhoverface, nsILookAndFeel::eColor__moz_buttonhoverface,
00418   eCSSKeyword__moz_buttonhovertext, nsILookAndFeel::eColor__moz_buttonhovertext,
00419   eCSSKeyword__moz_cellhighlight, nsILookAndFeel::eColor__moz_cellhighlight,
00420   eCSSKeyword__moz_cellhighlighttext, nsILookAndFeel::eColor__moz_cellhighlighttext,
00421   eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field,
00422   eCSSKeyword__moz_fieldtext, nsILookAndFeel::eColor__moz_fieldtext,
00423   eCSSKeyword__moz_dialog, nsILookAndFeel::eColor__moz_dialog,
00424   eCSSKeyword__moz_dialogtext, nsILookAndFeel::eColor__moz_dialogtext,
00425   eCSSKeyword__moz_dragtargetzone, nsILookAndFeel::eColor__moz_dragtargetzone,
00426   eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT,
00427   eCSSKeyword__moz_mac_focusring, nsILookAndFeel::eColor__moz_mac_focusring,
00428   eCSSKeyword__moz_mac_menuselect, nsILookAndFeel::eColor__moz_mac_menuselect,
00429   eCSSKeyword__moz_mac_menushadow, nsILookAndFeel::eColor__moz_mac_menushadow,
00430   eCSSKeyword__moz_mac_menutextdisable, nsILookAndFeel::eColor__moz_mac_menutextdisable,
00431   eCSSKeyword__moz_mac_menutextselect, nsILookAndFeel::eColor__moz_mac_menutextselect,
00432   eCSSKeyword__moz_mac_accentlightesthighlight, nsILookAndFeel::eColor__moz_mac_accentlightesthighlight,
00433   eCSSKeyword__moz_mac_accentregularhighlight, nsILookAndFeel::eColor__moz_mac_accentregularhighlight,
00434   eCSSKeyword__moz_mac_accentface, nsILookAndFeel::eColor__moz_mac_accentface,
00435   eCSSKeyword__moz_mac_accentlightshadow, nsILookAndFeel::eColor__moz_mac_accentlightshadow,
00436   eCSSKeyword__moz_mac_accentregularshadow, nsILookAndFeel::eColor__moz_mac_accentregularshadow,
00437   eCSSKeyword__moz_mac_accentdarkshadow, nsILookAndFeel::eColor__moz_mac_accentdarkshadow,
00438   eCSSKeyword__moz_mac_accentdarkestshadow, nsILookAndFeel::eColor__moz_mac_accentdarkestshadow,
00439   eCSSKeyword__moz_mac_alternateprimaryhighlight, nsILookAndFeel::eColor__moz_mac_alternateprimaryhighlight,
00440   eCSSKeyword__moz_mac_secondaryhighlight, nsILookAndFeel::eColor__moz_mac_secondaryhighlight,
00441   eCSSKeyword__moz_menuhover, nsILookAndFeel::eColor__moz_menuhover,
00442   eCSSKeyword__moz_menuhovertext, nsILookAndFeel::eColor__moz_menuhovertext,
00443   eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
00444   eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR,
00445   eCSSKeyword_UNKNOWN,-1
00446 };
00447 
00448 const PRInt32 nsCSSProps::kContentKTable[] = {
00449   eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE,
00450   eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
00451   eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
00452   eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
00453   eCSSKeyword_UNKNOWN,-1
00454 };
00455 
00456 const PRInt32 nsCSSProps::kCursorKTable[] = {
00457   // CSS 2.0
00458   eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR,
00459   eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT,
00460   eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER,
00461   eCSSKeyword_move, NS_STYLE_CURSOR_MOVE,
00462   eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE,
00463   eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE,
00464   eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE,
00465   eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE,
00466   eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE,
00467   eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE,
00468   eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE,
00469   eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE,
00470   eCSSKeyword_text, NS_STYLE_CURSOR_TEXT,
00471   eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT,
00472   eCSSKeyword_help, NS_STYLE_CURSOR_HELP,
00473   // CSS 2.1
00474   eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING,
00475   // CSS3 basic user interface module
00476   eCSSKeyword_copy, NS_STYLE_CURSOR_COPY,
00477   eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS,
00478   eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
00479   eCSSKeyword_cell, NS_STYLE_CURSOR_CELL,
00480   eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED,
00481   eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE,
00482   eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE,
00483   eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP,
00484   eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT,
00485   eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL,
00486   eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE,
00487   eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE,
00488   eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE,
00489   eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE,
00490   // -moz- prefixed aliases for some CSS3 cursors for backward compat
00491   eCSSKeyword__moz_copy, NS_STYLE_CURSOR_COPY,
00492   eCSSKeyword__moz_alias, NS_STYLE_CURSOR_ALIAS,
00493   eCSSKeyword__moz_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
00494   eCSSKeyword__moz_cell, NS_STYLE_CURSOR_CELL,
00495   // -moz- prefixed vendor specific
00496   eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB,
00497   eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING,
00498   eCSSKeyword__moz_spinning, NS_STYLE_CURSOR_SPINNING,
00499   eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
00500   eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
00501   eCSSKeyword_UNKNOWN,-1
00502 };
00503 
00504 const PRInt32 nsCSSProps::kDirectionKTable[] = {
00505   eCSSKeyword_ltr,      NS_STYLE_DIRECTION_LTR,
00506   eCSSKeyword_rtl,      NS_STYLE_DIRECTION_RTL,
00507   eCSSKeyword_UNKNOWN,-1
00508 };
00509 
00510 const PRInt32 nsCSSProps::kDisplayKTable[] = {
00511   eCSSKeyword_inline,             NS_STYLE_DISPLAY_INLINE,
00512   eCSSKeyword_block,              NS_STYLE_DISPLAY_BLOCK,
00513   eCSSKeyword__moz_inline_block,  NS_STYLE_DISPLAY_INLINE_BLOCK,
00514   eCSSKeyword_list_item,          NS_STYLE_DISPLAY_LIST_ITEM,
00515   eCSSKeyword__moz_run_in,        NS_STYLE_DISPLAY_RUN_IN,
00516   eCSSKeyword__moz_compact,       NS_STYLE_DISPLAY_COMPACT,
00517   eCSSKeyword__moz_marker,        NS_STYLE_DISPLAY_MARKER,
00518   eCSSKeyword_table,              NS_STYLE_DISPLAY_TABLE,
00519   eCSSKeyword__moz_inline_table,  NS_STYLE_DISPLAY_INLINE_TABLE,
00520   eCSSKeyword_table_row_group,    NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
00521   eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
00522   eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
00523   eCSSKeyword_table_row,          NS_STYLE_DISPLAY_TABLE_ROW,
00524   eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
00525   eCSSKeyword_table_column,       NS_STYLE_DISPLAY_TABLE_COLUMN,
00526   eCSSKeyword_table_cell,         NS_STYLE_DISPLAY_TABLE_CELL,
00527   eCSSKeyword_table_caption,      NS_STYLE_DISPLAY_TABLE_CAPTION,
00528   eCSSKeyword__moz_box,           NS_STYLE_DISPLAY_BOX,
00529   eCSSKeyword__moz_inline_box,    NS_STYLE_DISPLAY_INLINE_BOX,
00530   eCSSKeyword__moz_grid,          NS_STYLE_DISPLAY_GRID,
00531   eCSSKeyword__moz_inline_grid,   NS_STYLE_DISPLAY_INLINE_GRID,
00532   eCSSKeyword__moz_grid_group,    NS_STYLE_DISPLAY_GRID_GROUP,
00533   eCSSKeyword__moz_grid_line,     NS_STYLE_DISPLAY_GRID_LINE,
00534   eCSSKeyword__moz_stack,         NS_STYLE_DISPLAY_STACK,
00535   eCSSKeyword__moz_inline_stack,  NS_STYLE_DISPLAY_INLINE_STACK,
00536   eCSSKeyword__moz_deck,          NS_STYLE_DISPLAY_DECK,
00537   eCSSKeyword__moz_popup,         NS_STYLE_DISPLAY_POPUP,
00538   eCSSKeyword__moz_groupbox,      NS_STYLE_DISPLAY_GROUPBOX,
00539   eCSSKeyword_UNKNOWN,-1
00540 };
00541 
00542 const PRInt32 nsCSSProps::kElevationKTable[] = {
00543   eCSSKeyword_below,  NS_STYLE_ELEVATION_BELOW,
00544   eCSSKeyword_level,  NS_STYLE_ELEVATION_LEVEL,
00545   eCSSKeyword_above,  NS_STYLE_ELEVATION_ABOVE,
00546   eCSSKeyword_higher, NS_STYLE_ELEVATION_HIGHER,
00547   eCSSKeyword_lower,  NS_STYLE_ELEVATION_LOWER,
00548   eCSSKeyword_UNKNOWN,-1
00549 };
00550 
00551 const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
00552   eCSSKeyword_show,                 NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
00553   eCSSKeyword_hide,                 NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
00554   eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
00555   eCSSKeyword_UNKNOWN,-1
00556 };
00557 
00558 const PRInt32 nsCSSProps::kFloatKTable[] = {
00559   eCSSKeyword_left,  NS_STYLE_FLOAT_LEFT,
00560   eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
00561   eCSSKeyword_UNKNOWN,-1
00562 };
00563 
00564 const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
00565   eCSSKeyword_content_box,  NS_STYLE_FLOAT_EDGE_CONTENT,
00566   eCSSKeyword_border_box,  NS_STYLE_FLOAT_EDGE_BORDER,
00567   eCSSKeyword_padding_box,  NS_STYLE_FLOAT_EDGE_PADDING,
00568   eCSSKeyword_margin_box,  NS_STYLE_FLOAT_EDGE_MARGIN,
00569   eCSSKeyword_UNKNOWN,-1
00570 };
00571 
00572 const PRInt32 nsCSSProps::kFontKTable[] = {
00573   // CSS2.
00574   eCSSKeyword_caption, NS_STYLE_FONT_CAPTION,
00575   eCSSKeyword_icon, NS_STYLE_FONT_ICON,
00576   eCSSKeyword_menu, NS_STYLE_FONT_MENU,
00577   eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX,
00578   eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION,
00579   eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR,
00580 
00581   // Proposed for CSS3.
00582   eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW,
00583   eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT,
00584   eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE,
00585   eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP,
00586   eCSSKeyword__moz_info, NS_STYLE_FONT_INFO,
00587   eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG,
00588   eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON,
00589   eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
00590   eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
00591   eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
00592   eCSSKeyword_UNKNOWN,-1
00593 };
00594 
00595 const PRInt32 nsCSSProps::kFontSizeKTable[] = {
00596   eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL,
00597   eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL,
00598   eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL,
00599   eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM,
00600   eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE,
00601   eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE,
00602   eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
00603   eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
00604   eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
00605   eCSSKeyword_UNKNOWN,-1
00606 };
00607 
00608 const PRInt32 nsCSSProps::kFontStretchKTable[] = {
00609   eCSSKeyword_wider, NS_STYLE_FONT_STRETCH_WIDER,
00610   eCSSKeyword_narrower, NS_STYLE_FONT_STRETCH_NARROWER,
00611   eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED,
00612   eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED,
00613   eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED,
00614   eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED,
00615   eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED,
00616   eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
00617   eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
00618   eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
00619   eCSSKeyword_UNKNOWN,-1
00620 };
00621 
00622 const PRInt32 nsCSSProps::kFontStyleKTable[] = {
00623   eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
00624   eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
00625   eCSSKeyword_UNKNOWN,-1
00626 };
00627 
00628 const PRInt32 nsCSSProps::kFontVariantKTable[] = {
00629   eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
00630   eCSSKeyword_UNKNOWN,-1
00631 };
00632 
00633 const PRInt32 nsCSSProps::kFontWeightKTable[] = {
00634   eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
00635   eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
00636   eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
00637   eCSSKeyword_UNKNOWN,-1
00638 };
00639 
00640 // XXX What's the point?
00641 const PRInt32 nsCSSProps::kKeyEquivalentKTable[] = {
00642   eCSSKeyword_UNKNOWN,-1
00643 };
00644 
00645 const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
00646   eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
00647   eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
00648   eCSSKeyword_UNKNOWN,-1
00649 };
00650 
00651 const PRInt32 nsCSSProps::kListStyleKTable[] = {
00652   eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC,
00653   eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE,
00654   eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE,
00655   eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL,
00656   eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO,
00657   eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN,
00658   eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN,
00659   eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK,
00660   eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA,
00661   eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN,
00662   eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA,
00663   eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN,
00664   eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW,
00665   eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN,
00666   eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN,
00667   eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC,
00668   eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA,
00669   eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA,
00670   eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA,
00671   eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA,
00672   eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM,
00673   eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH,
00674   eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL,
00675   eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL,
00676   eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL,
00677   eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL,
00678   eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL,
00679   eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL,
00680   eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC,
00681   eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN,
00682   eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU,
00683   eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI,
00684   eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI,
00685   eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI,
00686   eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA,
00687   eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA,
00688   eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM,
00689   eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI,
00690   eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL,
00691   eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU,
00692   eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI,
00693   eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO,
00694   eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR,
00695   eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER,
00696   eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL,
00697   eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT,
00698   eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME,
00699   eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC,
00700   eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
00701   eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
00702   eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
00703   eCSSKeyword_UNKNOWN,-1
00704 };
00705 
00706 // Same as kBorderStyleKTable except 'hidden'.
00707 const PRInt32 nsCSSProps::kOutlineStyleKTable[] = {
00708   eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
00709   eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
00710   eCSSKeyword_solid,  NS_STYLE_BORDER_STYLE_SOLID,
00711   eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
00712   eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
00713   eCSSKeyword_ridge,  NS_STYLE_BORDER_STYLE_RIDGE,
00714   eCSSKeyword_inset,  NS_STYLE_BORDER_STYLE_INSET,
00715   eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
00716   eCSSKeyword__moz_bg_inset,  NS_STYLE_BORDER_STYLE_BG_INSET,
00717   eCSSKeyword__moz_bg_outset, NS_STYLE_BORDER_STYLE_BG_OUTSET,
00718   eCSSKeyword__moz_bg_solid,  NS_STYLE_BORDER_STYLE_BG_SOLID,
00719   eCSSKeyword_UNKNOWN,-1
00720 };
00721 
00722 const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
00723   eCSSKeyword_invert, NS_STYLE_COLOR_INVERT,
00724   eCSSKeyword_UNKNOWN,-1
00725 };
00726 
00727 const PRInt32 nsCSSProps::kOverflowKTable[] = {
00728   eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
00729   eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
00730   eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
00731   // Deprecated:
00732   eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
00733   eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
00734   eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
00735   eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
00736   eCSSKeyword_UNKNOWN,-1
00737 };
00738 
00739 const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
00740   eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
00741   eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
00742   eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
00743   // Deprecated:
00744   eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
00745   eCSSKeyword_UNKNOWN,-1
00746 };
00747 
00748 const PRInt32 nsCSSProps::kPageBreakKTable[] = {
00749   eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
00750   eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
00751   eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
00752   eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
00753   eCSSKeyword_UNKNOWN,-1
00754 };
00755 
00756 const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
00757   eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
00758   eCSSKeyword_UNKNOWN,-1
00759 };
00760 
00761 const PRInt32 nsCSSProps::kPageMarksKTable[] = {
00762   eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
00763   eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
00764   eCSSKeyword_UNKNOWN,-1
00765 };
00766 
00767 const PRInt32 nsCSSProps::kPageSizeKTable[] = {
00768   eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
00769   eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
00770   eCSSKeyword_UNKNOWN,-1
00771 };
00772 
00773 const PRInt32 nsCSSProps::kPitchKTable[] = {
00774   eCSSKeyword_x_low, NS_STYLE_PITCH_X_LOW,
00775   eCSSKeyword_low, NS_STYLE_PITCH_LOW,
00776   eCSSKeyword_medium, NS_STYLE_PITCH_MEDIUM,
00777   eCSSKeyword_high, NS_STYLE_PITCH_HIGH,
00778   eCSSKeyword_x_high, NS_STYLE_PITCH_X_HIGH,
00779   eCSSKeyword_UNKNOWN,-1
00780 };
00781 
00782 const PRInt32 nsCSSProps::kPositionKTable[] = {
00783   eCSSKeyword_static, NS_STYLE_POSITION_STATIC,
00784   eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
00785   eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
00786   eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
00787   eCSSKeyword_UNKNOWN,-1
00788 };
00789 
00790 const PRInt32 nsCSSProps::kSpeakKTable[] = {
00791   eCSSKeyword_spell_out, NS_STYLE_SPEAK_SPELL_OUT,
00792   eCSSKeyword_UNKNOWN,-1
00793 };
00794 
00795 const PRInt32 nsCSSProps::kSpeakHeaderKTable[] = {
00796   eCSSKeyword_once, NS_STYLE_SPEAK_HEADER_ONCE,
00797   eCSSKeyword_always, NS_STYLE_SPEAK_HEADER_ALWAYS,
00798   eCSSKeyword_UNKNOWN,-1
00799 };
00800 
00801 const PRInt32 nsCSSProps::kSpeakNumeralKTable[] = {
00802   eCSSKeyword_digits, NS_STYLE_SPEAK_NUMERAL_DIGITS,
00803   eCSSKeyword_continuous, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS,
00804   eCSSKeyword_UNKNOWN,-1
00805 };
00806 
00807 const PRInt32 nsCSSProps::kSpeakPunctuationKTable[] = {
00808   eCSSKeyword_code, NS_STYLE_SPEAK_PUNCTUATION_CODE,
00809   eCSSKeyword_UNKNOWN,-1
00810 };
00811 
00812 const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
00813   eCSSKeyword_x_slow, NS_STYLE_SPEECH_RATE_X_SLOW,
00814   eCSSKeyword_slow, NS_STYLE_SPEECH_RATE_SLOW,
00815   eCSSKeyword_medium, NS_STYLE_SPEECH_RATE_MEDIUM,
00816   eCSSKeyword_fast, NS_STYLE_SPEECH_RATE_FAST,
00817   eCSSKeyword_x_fast, NS_STYLE_SPEECH_RATE_X_FAST,
00818   eCSSKeyword_faster, NS_STYLE_SPEECH_RATE_FASTER,
00819   eCSSKeyword_slower, NS_STYLE_SPEECH_RATE_SLOWER,
00820   eCSSKeyword_UNKNOWN,-1
00821 };
00822 
00823 const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
00824   eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
00825   eCSSKeyword_UNKNOWN,-1
00826 };
00827 
00828 const PRInt32 nsCSSProps::kTextAlignKTable[] = {
00829   eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
00830   eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
00831   eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
00832   eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
00833   eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
00834   eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
00835   eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT,
00836   eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
00837   eCSSKeyword_UNKNOWN,-1
00838 };
00839 
00840 const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
00841   eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_UNDERLINE,
00842   eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_OVERLINE,
00843   eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
00844   eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_BLINK,
00845   eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS,
00846   eCSSKeyword_UNKNOWN,-1
00847 };
00848 
00849 const PRInt32 nsCSSProps::kTextTransformKTable[] = {
00850   eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
00851   eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
00852   eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
00853   eCSSKeyword_UNKNOWN,-1
00854 };
00855 
00856 const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
00857   eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
00858   eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
00859   eCSSKeyword_UNKNOWN,-1
00860 };
00861 
00862 const PRInt32 nsCSSProps::kUserFocusKTable[] = {
00863   eCSSKeyword_ignore,         NS_STYLE_USER_FOCUS_IGNORE,
00864   eCSSKeyword_select_all,     NS_STYLE_USER_FOCUS_SELECT_ALL,
00865   eCSSKeyword_select_before,  NS_STYLE_USER_FOCUS_SELECT_BEFORE,
00866   eCSSKeyword_select_after,   NS_STYLE_USER_FOCUS_SELECT_AFTER,
00867   eCSSKeyword_select_same,    NS_STYLE_USER_FOCUS_SELECT_SAME,
00868   eCSSKeyword_select_menu,    NS_STYLE_USER_FOCUS_SELECT_MENU,
00869   eCSSKeyword_UNKNOWN,-1
00870 };
00871 
00872 const PRInt32 nsCSSProps::kUserInputKTable[] = {
00873   eCSSKeyword_enabled,  NS_STYLE_USER_INPUT_ENABLED,
00874   eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
00875   eCSSKeyword_UNKNOWN,-1
00876 };
00877 
00878 const PRInt32 nsCSSProps::kUserModifyKTable[] = {
00879   eCSSKeyword_read_only,  NS_STYLE_USER_MODIFY_READ_ONLY,
00880   eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
00881   eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
00882   eCSSKeyword_UNKNOWN,-1
00883 };
00884 
00885 const PRInt32 nsCSSProps::kUserSelectKTable[] = {
00886   eCSSKeyword_text,       NS_STYLE_USER_SELECT_TEXT,
00887   eCSSKeyword_element,    NS_STYLE_USER_SELECT_ELEMENT,
00888   eCSSKeyword_elements,   NS_STYLE_USER_SELECT_ELEMENTS,
00889   eCSSKeyword_all,        NS_STYLE_USER_SELECT_ALL,
00890   eCSSKeyword_toggle,     NS_STYLE_USER_SELECT_TOGGLE,
00891   eCSSKeyword_tri_state,  NS_STYLE_USER_SELECT_TRI_STATE,
00892   eCSSKeyword__moz_all,   NS_STYLE_USER_SELECT_MOZ_ALL,
00893   eCSSKeyword__moz_none,  NS_STYLE_USER_SELECT_MOZ_NONE,
00894   eCSSKeyword_UNKNOWN,-1
00895 };
00896 
00897 const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
00898   eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE,
00899   eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB,
00900   eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER,
00901   eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP,
00902   eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP,
00903   eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
00904   eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE,
00905   eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
00906   eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
00907   eCSSKeyword_UNKNOWN,-1
00908 };
00909 
00910 const PRInt32 nsCSSProps::kVisibilityKTable[] = {
00911   eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
00912   eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
00913   eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
00914   eCSSKeyword_UNKNOWN,-1
00915 };
00916 
00917 const PRInt32 nsCSSProps::kVolumeKTable[] = {
00918   eCSSKeyword_silent, NS_STYLE_VOLUME_SILENT,
00919   eCSSKeyword_x_soft, NS_STYLE_VOLUME_X_SOFT,
00920   eCSSKeyword_soft, NS_STYLE_VOLUME_SOFT,
00921   eCSSKeyword_medium, NS_STYLE_VOLUME_MEDIUM,
00922   eCSSKeyword_loud, NS_STYLE_VOLUME_LOUD,
00923   eCSSKeyword_x_loud, NS_STYLE_VOLUME_X_LOUD,
00924   eCSSKeyword_UNKNOWN,-1
00925 };
00926 
00927 const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
00928   eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
00929   eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
00930   eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_MOZ_PRE_WRAP,
00931   eCSSKeyword_UNKNOWN,-1
00932 };
00933 
00934 // Specific keyword tables for XUL.properties
00935 const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
00936   eCSSKeyword_stretch,  NS_STYLE_BOX_ALIGN_STRETCH,
00937   eCSSKeyword_start,   NS_STYLE_BOX_ALIGN_START,
00938   eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
00939   eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE, 
00940   eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END, 
00941   eCSSKeyword_UNKNOWN,-1
00942 };
00943 
00944 const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
00945   eCSSKeyword_normal,  NS_STYLE_BOX_DIRECTION_NORMAL,
00946   eCSSKeyword_reverse,   NS_STYLE_BOX_DIRECTION_REVERSE,
00947   eCSSKeyword_UNKNOWN,-1
00948 };
00949 
00950 const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
00951   eCSSKeyword_horizontal,  NS_STYLE_BOX_ORIENT_HORIZONTAL,
00952   eCSSKeyword_vertical,   NS_STYLE_BOX_ORIENT_VERTICAL,
00953   eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
00954   eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL, 
00955   eCSSKeyword_UNKNOWN,-1
00956 };
00957 
00958 const PRInt32 nsCSSProps::kBoxPackKTable[] = {
00959   eCSSKeyword_start,  NS_STYLE_BOX_PACK_START,
00960   eCSSKeyword_center,   NS_STYLE_BOX_PACK_CENTER,
00961   eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
00962   eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY, 
00963   eCSSKeyword_UNKNOWN,-1
00964 };
00965 
00966 #ifdef MOZ_SVG
00967 // keyword tables for SVG properties
00968 
00969 const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
00970   eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT,
00971   eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE,
00972   eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE,
00973   eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC,
00974   eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING,
00975   eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC,
00976   eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL,
00977   eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL,
00978   eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
00979   eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
00980   eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
00981   eCSSKeyword_UNKNOWN, -1
00982 };
00983 
00984 const PRInt32 nsCSSProps::kFillRuleKTable[] = {
00985   eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
00986   eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
00987   eCSSKeyword_UNKNOWN, -1
00988 };
00989 
00990 const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
00991   eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
00992   eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
00993   eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
00994   eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
00995   eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
00996   eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
00997   eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
00998   eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
00999   eCSSKeyword_UNKNOWN, -1
01000 };
01001 
01002 const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
01003   eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
01004   eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
01005   eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
01006   eCSSKeyword_UNKNOWN, -1
01007 };
01008 
01009 const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
01010   eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
01011   eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
01012   eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
01013   eCSSKeyword_UNKNOWN, -1
01014 };
01015 
01016 const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
01017   eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
01018   eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
01019   eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
01020   eCSSKeyword_UNKNOWN, -1
01021 };
01022 
01023 const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
01024   eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
01025   eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
01026   eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
01027   eCSSKeyword_UNKNOWN, -1
01028 };
01029 
01030 const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
01031   eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
01032   eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
01033   eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
01034   eCSSKeyword_UNKNOWN, -1
01035 };
01036 
01037 #endif
01038 
01039 PRBool
01040 nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
01041 {
01042   PRInt32 index = 0;
01043   while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
01044     if (aKeyword == nsCSSKeyword(aTable[index])) {
01045       aResult = aTable[index+1];
01046       return PR_TRUE;
01047     }
01048     index += 2;
01049   }
01050   return PR_FALSE;
01051 }
01052 
01053 nsCSSKeyword
01054 nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
01055 {
01056   PRInt32 i = 1;
01057   for (;;) {
01058     if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
01059       break;
01060     }
01061     if (aValue == aTable[i]) {
01062       return nsCSSKeyword(aTable[i-1]);
01063     }
01064     i += 2;
01065   }
01066   return eCSSKeyword_UNKNOWN;
01067 }
01068 
01069 const nsAFlatCString&
01070 nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
01071 {
01072   nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
01073   if (keyword == eCSSKeyword_UNKNOWN) {
01074     static nsDependentCString sNullStr("");
01075     return sNullStr;
01076   } else {
01077     return nsCSSKeywords::GetStringValue(keyword);
01078   }
01079 }
01080 
01081 /* static */ const PRInt32* const
01082 nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = {
01083   #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) kwtable_,
01084   #include "nsCSSPropList.h"
01085   #undef CSS_PROP
01086 };
01087 
01088 const nsAFlatCString& 
01089 nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
01090 {
01091   NS_ASSERTION(aProp >= 0 && aProp < eCSSProperty_COUNT, "property out of range");
01092 
01093   const PRInt32* kwtable = nsnull;
01094   if (aProp < eCSSProperty_COUNT_no_shorthands)
01095     kwtable = kKeywordTableTable[aProp];
01096 
01097   if (kwtable)
01098     return ValueToKeyword(aValue, kwtable);
01099 
01100   static nsDependentCString sNullStr("");
01101   return sNullStr;
01102 }
01103 
01104 PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
01105 {
01106   PRBool rv = PR_FALSE;
01107 
01108   // first get the keyword corresponding to the property Value from the color table
01109   nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
01110 
01111   // next get the name as a string from the keywords table
01112   if (keyword != eCSSKeyword_UNKNOWN) {
01113     nsCSSKeywords::AddRefTable();
01114     aStr = nsCSSKeywords::GetStringValue(keyword);
01115     nsCSSKeywords::ReleaseTable();
01116     rv = PR_TRUE;
01117   }
01118   return rv;
01119 }
01120 
01121 // define array of all CSS property types
01122 const nsCSSType nsCSSProps::kTypeTable[eCSSProperty_COUNT_no_shorthands] = {
01123     #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) type_,
01124     #include "nsCSSPropList.h"
01125     #undef CSS_PROP
01126 };
01127 
01128 const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = {
01129     #define CSS_PROP_FONT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Font,
01130     #define CSS_PROP_COLOR(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Color,
01131     #define CSS_PROP_BACKGROUND(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Background,
01132     #define CSS_PROP_LIST(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_List,
01133     #define CSS_PROP_POSITION(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Position,
01134     #define CSS_PROP_TEXT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Text,
01135     #define CSS_PROP_TEXTRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_TextReset,
01136     #define CSS_PROP_DISPLAY(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Display,
01137     #define CSS_PROP_VISIBILITY(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Visibility,
01138     #define CSS_PROP_CONTENT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Content,
01139     #define CSS_PROP_QUOTES(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Quotes,
01140     #define CSS_PROP_USERINTERFACE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_UserInterface,
01141     #define CSS_PROP_UIRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_UIReset,
01142     #define CSS_PROP_TABLE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Table,
01143     #define CSS_PROP_TABLEBORDER(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_TableBorder,
01144     #define CSS_PROP_MARGIN(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Margin,
01145     #define CSS_PROP_PADDING(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Padding,
01146     #define CSS_PROP_BORDER(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Border,
01147     #define CSS_PROP_OUTLINE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Outline,
01148     #define CSS_PROP_XUL(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_XUL,
01149     #define CSS_PROP_SVG(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVG,
01150     #define CSS_PROP_SVGRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVGReset,
01151     #define CSS_PROP_COLUMN(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Column,
01152     // This shouldn't matter, but we need something to go here.
01153     #define CSS_PROP_BACKENDONLY(name_, id_, method_, datastruct_, member_, type_, kwtable_) nsStyleStructID(-1),
01154 
01155     #include "nsCSSPropList.h"
01156 
01157     #undef CSS_PROP_FONT
01158     #undef CSS_PROP_COLOR
01159     #undef CSS_PROP_BACKGROUND
01160     #undef CSS_PROP_LIST
01161     #undef CSS_PROP_POSITION
01162     #undef CSS_PROP_TEXT
01163     #undef CSS_PROP_TEXTRESET
01164     #undef CSS_PROP_DISPLAY
01165     #undef CSS_PROP_VISIBILITY
01166     #undef CSS_PROP_CONTENT
01167     #undef CSS_PROP_QUOTES
01168     #undef CSS_PROP_USERINTERFACE
01169     #undef CSS_PROP_UIRESET
01170     #undef CSS_PROP_TABLE
01171     #undef CSS_PROP_TABLEBORDER
01172     #undef CSS_PROP_MARGIN
01173     #undef CSS_PROP_PADDING
01174     #undef CSS_PROP_BORDER
01175     #undef CSS_PROP_OUTLINE
01176     #undef CSS_PROP_XUL
01177     #undef CSS_PROP_SVG
01178     #undef CSS_PROP_SVGRESET
01179     #undef CSS_PROP_COLUMN
01180     #undef CSS_PROP_BACKENDONLY
01181 };
01182 
01183 static const nsCSSProperty gMozBorderRadiusSubpropTable[] = {
01184   // Code relies on these being in topleft-topright-bottomright-bottomleft
01185   // order.
01186   eCSSProperty__moz_border_radius_topLeft,
01187   eCSSProperty__moz_border_radius_topRight,
01188   eCSSProperty__moz_border_radius_bottomRight,
01189   eCSSProperty__moz_border_radius_bottomLeft,
01190   eCSSProperty_UNKNOWN
01191 };
01192 
01193 static const nsCSSProperty gMozOutlineRadiusSubpropTable[] = {
01194   // Code relies on these being in topleft-topright-bottomright-bottomleft
01195   // order.
01196   eCSSProperty__moz_outline_radius_topLeft,
01197   eCSSProperty__moz_outline_radius_topRight,
01198   eCSSProperty__moz_outline_radius_bottomRight,
01199   eCSSProperty__moz_outline_radius_bottomLeft,
01200   eCSSProperty_UNKNOWN
01201 };
01202 
01203 static const nsCSSProperty gBackgroundSubpropTable[] = {
01204   eCSSProperty_background_color,
01205   eCSSProperty_background_image,
01206   eCSSProperty_background_repeat,
01207   eCSSProperty_background_attachment,
01208   eCSSProperty_background_x_position,
01209   eCSSProperty_background_y_position,
01210   eCSSProperty__moz_background_clip, // XXX Added LDB.
01211   eCSSProperty__moz_background_origin, // XXX Added LDB.
01212   eCSSProperty__moz_background_inline_policy, // XXX Added LDB.
01213   eCSSProperty_UNKNOWN
01214 };
01215 
01216 static const nsCSSProperty gBackgroundPositionSubpropTable[] = {
01217   eCSSProperty_background_x_position,
01218   eCSSProperty_background_y_position,
01219   eCSSProperty_UNKNOWN
01220 };
01221 
01222 static const nsCSSProperty gBorderSubpropTable[] = {
01223   eCSSProperty_border_top_width,
01224   eCSSProperty_border_right_width,
01225   eCSSProperty_border_bottom_width,
01226   eCSSProperty_border_left_width,
01227   eCSSProperty_border_top_style,
01228   eCSSProperty_border_right_style,
01229   eCSSProperty_border_bottom_style,
01230   eCSSProperty_border_left_style,
01231   eCSSProperty_border_top_color,
01232   eCSSProperty_border_right_color,
01233   eCSSProperty_border_bottom_color,
01234   eCSSProperty_border_left_color,
01235   eCSSProperty_UNKNOWN
01236 };
01237 
01238 static const nsCSSProperty gBorderBottomSubpropTable[] = {
01239   // nsCSSDeclaration.cpp outputs the subproperties in this order.
01240   eCSSProperty_border_bottom_width,
01241   eCSSProperty_border_bottom_style,
01242   eCSSProperty_border_bottom_color,
01243   eCSSProperty_UNKNOWN
01244 };
01245 
01246 static const nsCSSProperty gBorderColorSubpropTable[] = {
01247   // Code relies on these being in top-right-bottom-left order.
01248   eCSSProperty_border_top_color,
01249   eCSSProperty_border_right_color,
01250   eCSSProperty_border_bottom_color,
01251   eCSSProperty_border_left_color,
01252   eCSSProperty_UNKNOWN
01253 };
01254 
01255 static const nsCSSProperty gBorderLeftSubpropTable[] = {
01256   // nsCSSDeclaration.cpp outputs the subproperties in this order.
01257   eCSSProperty_border_left_width,
01258   eCSSProperty_border_left_style,
01259   eCSSProperty_border_left_color,
01260   eCSSProperty_UNKNOWN
01261 };
01262 
01263 static const nsCSSProperty gBorderRightSubpropTable[] = {
01264   // nsCSSDeclaration.cpp outputs the subproperties in this order.
01265   eCSSProperty_border_right_width,
01266   eCSSProperty_border_right_style,
01267   eCSSProperty_border_right_color,
01268   eCSSProperty_UNKNOWN
01269 };
01270 
01271 static const nsCSSProperty gBorderStyleSubpropTable[] = {
01272   // Code relies on these being in top-right-bottom-left order.
01273   eCSSProperty_border_top_style,
01274   eCSSProperty_border_right_style,
01275   eCSSProperty_border_bottom_style,
01276   eCSSProperty_border_left_style,
01277   eCSSProperty_UNKNOWN
01278 };
01279 
01280 static const nsCSSProperty gBorderTopSubpropTable[] = {
01281   // nsCSSDeclaration.cpp outputs the subproperties in this order.
01282   eCSSProperty_border_top_width,
01283   eCSSProperty_border_top_style,
01284   eCSSProperty_border_top_color,
01285   eCSSProperty_UNKNOWN
01286 };
01287 
01288 static const nsCSSProperty gBorderWidthSubpropTable[] = {
01289   // Code relies on these being in top-right-bottom-left order.
01290   eCSSProperty_border_top_width,
01291   eCSSProperty_border_right_width,
01292   eCSSProperty_border_bottom_width,
01293   eCSSProperty_border_left_width,
01294   eCSSProperty_UNKNOWN
01295 };
01296 
01297 static const nsCSSProperty gCueSubpropTable[] = {
01298   eCSSProperty_cue_after,
01299   eCSSProperty_cue_before,
01300   eCSSProperty_UNKNOWN
01301 };
01302 
01303 static const nsCSSProperty gFontSubpropTable[] = {
01304   eCSSProperty_font_family,
01305   eCSSProperty_font_style,
01306   eCSSProperty_font_variant,
01307   eCSSProperty_font_weight,
01308   eCSSProperty_font_size,
01309   eCSSProperty_line_height,
01310   eCSSProperty_font_size_adjust, // XXX Added LDB.
01311   eCSSProperty_font_stretch, // XXX Added LDB.
01312   eCSSProperty_UNKNOWN
01313 };
01314 
01315 static const nsCSSProperty gListStyleSubpropTable[] = {
01316   eCSSProperty_list_style_type,
01317   eCSSProperty_list_style_image,
01318   eCSSProperty_list_style_position,
01319   eCSSProperty_UNKNOWN
01320 };
01321 
01322 static const nsCSSProperty gMarginSubpropTable[] = {
01323   // Code relies on these being in top-right-bottom-left order.
01324   eCSSProperty_margin_top,
01325   eCSSProperty_margin_right_value,
01326   eCSSProperty_margin_bottom,
01327   eCSSProperty_margin_left_value,
01328   // extras:
01329   eCSSProperty_margin_left_ltr_source,
01330   eCSSProperty_margin_left_rtl_source,
01331   eCSSProperty_margin_right_ltr_source,
01332   eCSSProperty_margin_right_rtl_source,
01333   eCSSProperty_UNKNOWN
01334 };
01335 
01336 static const nsCSSProperty gMarginLeftSubpropTable[] = {
01337   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01338   eCSSProperty_margin_left_value,
01339   eCSSProperty_margin_left_ltr_source,
01340   eCSSProperty_margin_left_rtl_source,
01341   eCSSProperty_UNKNOWN
01342 };
01343 
01344 static const nsCSSProperty gMarginRightSubpropTable[] = {
01345   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01346   eCSSProperty_margin_right_value,
01347   eCSSProperty_margin_right_ltr_source,
01348   eCSSProperty_margin_right_rtl_source,
01349   eCSSProperty_UNKNOWN
01350 };
01351 
01352 static const nsCSSProperty gMozMarginStartSubpropTable[] = {
01353   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01354   eCSSProperty_margin_start_value,
01355   eCSSProperty_margin_left_ltr_source,
01356   eCSSProperty_margin_right_rtl_source,
01357   eCSSProperty_UNKNOWN
01358 };
01359 
01360 static const nsCSSProperty gMozMarginEndSubpropTable[] = {
01361   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01362   eCSSProperty_margin_end_value,
01363   eCSSProperty_margin_right_ltr_source,
01364   eCSSProperty_margin_left_rtl_source,
01365   eCSSProperty_UNKNOWN
01366 };
01367 
01368 
01369 static const nsCSSProperty gOutlineSubpropTable[] = {
01370   // nsCSSDeclaration.cpp outputs the subproperties in this order.
01371   eCSSProperty_outline_color,
01372   eCSSProperty_outline_style,
01373   eCSSProperty_outline_width,
01374   eCSSProperty_UNKNOWN
01375 };
01376 
01377 static const nsCSSProperty gOverflowSubpropTable[] = {
01378   eCSSProperty_overflow_x,
01379   eCSSProperty_overflow_y,
01380   eCSSProperty_UNKNOWN
01381 };
01382 
01383 static const nsCSSProperty gPaddingSubpropTable[] = {
01384   // Code relies on these being in top-right-bottom-left order.
01385   eCSSProperty_padding_top,
01386   eCSSProperty_padding_right_value,
01387   eCSSProperty_padding_bottom,
01388   eCSSProperty_padding_left_value,
01389   // extras:
01390   eCSSProperty_padding_left_ltr_source,
01391   eCSSProperty_padding_left_rtl_source,
01392   eCSSProperty_padding_right_ltr_source,
01393   eCSSProperty_padding_right_rtl_source,
01394   eCSSProperty_UNKNOWN
01395 };
01396 
01397 static const nsCSSProperty gPaddingLeftSubpropTable[] = {
01398   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01399   eCSSProperty_padding_left_value,
01400   eCSSProperty_padding_left_ltr_source,
01401   eCSSProperty_padding_left_rtl_source,
01402   eCSSProperty_UNKNOWN
01403 };
01404 
01405 static const nsCSSProperty gPaddingRightSubpropTable[] = {
01406   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01407   eCSSProperty_padding_right_value,
01408   eCSSProperty_padding_right_ltr_source,
01409   eCSSProperty_padding_right_rtl_source,
01410   eCSSProperty_UNKNOWN
01411 };
01412 
01413 static const nsCSSProperty gMozPaddingStartSubpropTable[] = {
01414   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01415   eCSSProperty_padding_start_value,
01416   eCSSProperty_padding_left_ltr_source,
01417   eCSSProperty_padding_right_rtl_source,
01418   eCSSProperty_UNKNOWN
01419 };
01420 
01421 static const nsCSSProperty gMozPaddingEndSubpropTable[] = {
01422   // nsCSSParser::ParseDirectionalBoxProperty depends on this order
01423   eCSSProperty_padding_end_value,
01424   eCSSProperty_padding_right_ltr_source,
01425   eCSSProperty_padding_left_rtl_source,
01426   eCSSProperty_UNKNOWN
01427 };
01428 
01429 static const nsCSSProperty gPauseSubpropTable[] = {
01430   eCSSProperty_pause_after,
01431   eCSSProperty_pause_before,
01432   eCSSProperty_UNKNOWN
01433 };
01434 
01435 #ifdef MOZ_SVG
01436 static const nsCSSProperty gMarkerSubpropTable[] = {
01437   eCSSProperty_marker_start,
01438   eCSSProperty_marker_mid,
01439   eCSSProperty_marker_end,
01440   eCSSProperty_UNKNOWN
01441 };
01442 #endif
01443 
01444 const nsCSSProperty *const
01445 nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = {
01446     #define CSS_PROP_SHORTHAND(name_, id_, method_) g##method_##SubpropTable,
01447     #include "nsCSSPropList.h"
01448     #undef CSS_PROP_SHORTHAND
01449 };