Bug 454376 add -lCrun -lCstd for Solaris OS_LIBS, r=bsmedberg
[wine-gecko.git] / layout / style / nsCSSProps.cpp
blob6811fe46a43a1b582e598322f1c69c23c94b2028
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Mats Palmgren <mats.palmgren@bredband.net>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
40 * methods for dealing with CSS properties and tables of the keyword
41 * values they accept
44 #include "nsCSSProps.h"
45 #include "nsCSSKeywords.h"
46 #include "nsStyleConsts.h"
47 #include "nsThemeConstants.h" // For system widget appearance types
49 #include "nsILookAndFeel.h" // for system colors
51 #include "nsString.h"
52 #include "nsReadableUtils.h"
53 #include "nsStaticNameTable.h"
55 // required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it
56 extern const char* const kCSSRawProperties[];
58 // define an array of all CSS properties
59 const char* const kCSSRawProperties[] = {
60 #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) #name_,
61 #include "nsCSSPropList.h"
62 #undef CSS_PROP
63 #define CSS_PROP_SHORTHAND(name_, id_, method_) #name_,
64 #include "nsCSSPropList.h"
65 #undef CSS_PROP_SHORTHAND
69 static PRInt32 gTableRefCount;
70 static nsStaticCaseInsensitiveNameTable* gPropertyTable;
71 static nsStaticCaseInsensitiveNameTable* gFontDescTable;
73 // Keep in sync with enum nsCSSFontDesc in nsCSSProperty.h.
74 static const char* const kCSSRawFontDescs[] = {
75 "font-family",
76 "font-style",
77 "font-weight",
78 "font-stretch",
79 "src",
80 "unicode-range"
83 void
84 nsCSSProps::AddRefTable(void)
86 if (0 == gTableRefCount++) {
87 NS_ASSERTION(!gPropertyTable, "pre existing array!");
88 NS_ASSERTION(!gFontDescTable, "pre existing array!");
90 gPropertyTable = new nsStaticCaseInsensitiveNameTable();
91 if (gPropertyTable) {
92 #ifdef DEBUG
94 // let's verify the table...
95 for (PRInt32 index = 0; index < eCSSProperty_COUNT; ++index) {
96 nsCAutoString temp1(kCSSRawProperties[index]);
97 nsCAutoString temp2(kCSSRawProperties[index]);
98 ToLowerCase(temp1);
99 NS_ASSERTION(temp1.Equals(temp2), "upper case char in prop table");
100 NS_ASSERTION(-1 == temp1.FindChar('_'), "underscore char in prop table");
103 #endif
104 gPropertyTable->Init(kCSSRawProperties, eCSSProperty_COUNT);
107 gFontDescTable = new nsStaticCaseInsensitiveNameTable();
108 if (gFontDescTable) {
109 #ifdef DEBUG
111 // let's verify the table...
112 for (PRInt32 index = 0; index < eCSSFontDesc_COUNT; ++index) {
113 nsCAutoString temp1(kCSSRawFontDescs[index]);
114 nsCAutoString temp2(kCSSRawFontDescs[index]);
115 ToLowerCase(temp1);
116 NS_ASSERTION(temp1.Equals(temp2), "upper case char in desc table");
117 NS_ASSERTION(-1 == temp1.FindChar('_'), "underscore char in desc table");
120 #endif
121 gFontDescTable->Init(kCSSRawFontDescs, eCSSFontDesc_COUNT);
126 void
127 nsCSSProps::ReleaseTable(void)
129 if (0 == --gTableRefCount) {
130 if (gPropertyTable) {
131 delete gPropertyTable;
132 gPropertyTable = nsnull;
134 if (gFontDescTable) {
135 delete gFontDescTable;
136 gFontDescTable = nsnull;
141 struct CSSPropertyAlias {
142 char name[sizeof("-moz-outline-offset")];
143 nsCSSProperty id;
146 static const CSSPropertyAlias gAliases[] = {
147 { "-moz-opacity", eCSSProperty_opacity },
148 { "-moz-outline", eCSSProperty_outline },
149 { "-moz-outline-color", eCSSProperty_outline_color },
150 { "-moz-outline-style", eCSSProperty_outline_style },
151 { "-moz-outline-width", eCSSProperty_outline_width },
152 { "-moz-outline-offset", eCSSProperty_outline_offset }
153 // Don't forget to update the sizeof in CSSPropertyAlias above with the
154 // longest string when you add stuff here.
157 nsCSSProperty
158 nsCSSProps::LookupProperty(const nsACString& aProperty)
160 NS_ASSERTION(gPropertyTable, "no lookup table, needs addref");
162 nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
163 if (res == eCSSProperty_UNKNOWN) {
164 const nsCString& prop = PromiseFlatCString(aProperty);
165 for (const CSSPropertyAlias *alias = gAliases,
166 *alias_end = gAliases + NS_ARRAY_LENGTH(gAliases);
167 alias < alias_end; ++alias)
168 if (nsCRT::strcasecmp(prop.get(), alias->name) == 0) {
169 res = alias->id;
170 break;
173 return res;
176 nsCSSProperty
177 nsCSSProps::LookupProperty(const nsAString& aProperty)
179 // This is faster than converting and calling
180 // LookupProperty(nsACString&). The table will do its own
181 // converting and avoid a PromiseFlatCString() call.
182 NS_ASSERTION(gPropertyTable, "no lookup table, needs addref");
183 nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
184 if (res == eCSSProperty_UNKNOWN) {
185 NS_ConvertUTF16toUTF8 prop(aProperty);
186 for (const CSSPropertyAlias *alias = gAliases,
187 *alias_end = gAliases + NS_ARRAY_LENGTH(gAliases);
188 alias < alias_end; ++alias)
189 if (nsCRT::strcasecmp(prop.get(), alias->name) == 0) {
190 res = alias->id;
191 break;
194 return res;
197 nsCSSFontDesc
198 nsCSSProps::LookupFontDesc(const nsACString& aFontDesc)
200 NS_ASSERTION(gFontDescTable, "no lookup table, needs addref");
201 return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
204 nsCSSFontDesc
205 nsCSSProps::LookupFontDesc(const nsAString& aFontDesc)
207 NS_ASSERTION(gFontDescTable, "no lookup table, needs addref");
208 return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
211 const nsAFlatCString&
212 nsCSSProps::GetStringValue(nsCSSProperty aProperty)
214 NS_ASSERTION(gPropertyTable, "no lookup table, needs addref");
215 if (gPropertyTable) {
216 return gPropertyTable->GetStringValue(PRInt32(aProperty));
217 } else {
218 static nsDependentCString sNullStr("");
219 return sNullStr;
223 const nsAFlatCString&
224 nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID)
226 NS_ASSERTION(gFontDescTable, "no lookup table, needs addref");
227 if (gFontDescTable) {
228 return gFontDescTable->GetStringValue(PRInt32(aFontDescID));
229 } else {
230 static nsDependentCString sNullStr("");
231 return sNullStr;
236 /***************************************************************************/
238 const PRInt32 nsCSSProps::kAppearanceKTable[] = {
239 eCSSKeyword_none, NS_THEME_NONE,
240 eCSSKeyword_button, NS_THEME_BUTTON,
241 eCSSKeyword_radio, NS_THEME_RADIO,
242 eCSSKeyword_checkbox, NS_THEME_CHECKBOX,
243 eCSSKeyword_radio_small, NS_THEME_RADIO_SMALL,
244 eCSSKeyword_checkbox_small, NS_THEME_CHECKBOX_SMALL,
245 eCSSKeyword_button_bevel, NS_THEME_BUTTON_BEVEL,
246 eCSSKeyword_toolbox, NS_THEME_TOOLBOX,
247 eCSSKeyword_toolbar, NS_THEME_TOOLBAR,
248 eCSSKeyword_toolbarbutton, NS_THEME_TOOLBAR_BUTTON,
249 eCSSKeyword_toolbargripper, NS_THEME_TOOLBAR_GRIPPER,
250 eCSSKeyword_dualbutton, NS_THEME_TOOLBAR_DUAL_BUTTON,
251 eCSSKeyword_toolbarbutton_dropdown, NS_THEME_TOOLBAR_BUTTON_DROPDOWN,
252 eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR,
253 eCSSKeyword_splitter, NS_THEME_SPLITTER,
254 eCSSKeyword_statusbar, NS_THEME_STATUSBAR,
255 eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL,
256 eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL,
257 eCSSKeyword_resizer, NS_THEME_RESIZER,
258 eCSSKeyword_listbox, NS_THEME_LISTBOX,
259 eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM,
260 eCSSKeyword_treeview, NS_THEME_TREEVIEW,
261 eCSSKeyword_treeitem, NS_THEME_TREEVIEW_TREEITEM,
262 eCSSKeyword_treetwisty, NS_THEME_TREEVIEW_TWISTY,
263 eCSSKeyword_treetwistyopen, NS_THEME_TREEVIEW_TWISTY_OPEN,
264 eCSSKeyword_treeline, NS_THEME_TREEVIEW_LINE,
265 eCSSKeyword_treeheader, NS_THEME_TREEVIEW_HEADER,
266 eCSSKeyword_treeheadercell, NS_THEME_TREEVIEW_HEADER_CELL,
267 eCSSKeyword_treeheadersortarrow, NS_THEME_TREEVIEW_HEADER_SORTARROW,
268 eCSSKeyword_progressbar, NS_THEME_PROGRESSBAR,
269 eCSSKeyword_progresschunk, NS_THEME_PROGRESSBAR_CHUNK,
270 eCSSKeyword_progressbar_vertical, NS_THEME_PROGRESSBAR_VERTICAL,
271 eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL,
272 eCSSKeyword_tab, NS_THEME_TAB,
273 eCSSKeyword_tab_left_edge, NS_THEME_TAB_LEFT_EDGE,
274 eCSSKeyword_tab_right_edge, NS_THEME_TAB_RIGHT_EDGE,
275 eCSSKeyword_tabpanels, NS_THEME_TAB_PANELS,
276 eCSSKeyword_tabpanel, NS_THEME_TAB_PANEL,
277 eCSSKeyword_tabscrollarrow_back, NS_THEME_TAB_SCROLLARROW_BACK,
278 eCSSKeyword_tabscrollarrow_forward, NS_THEME_TAB_SCROLLARROW_FORWARD,
279 eCSSKeyword_tooltip, NS_THEME_TOOLTIP,
280 eCSSKeyword_spinner, NS_THEME_SPINNER,
281 eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON,
282 eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON,
283 eCSSKeyword_spinner_textfield, NS_THEME_SPINNER_TEXTFIELD,
284 eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR,
285 eCSSKeyword_scrollbar_small, NS_THEME_SCROLLBAR_SMALL,
286 eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP,
287 eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN,
288 eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT,
289 eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT,
290 eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL,
291 eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL,
292 eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL,
293 eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL,
294 eCSSKeyword_textfield, NS_THEME_TEXTFIELD,
295 eCSSKeyword_textfield_multiline, NS_THEME_TEXTFIELD_MULTILINE,
296 eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET,
297 eCSSKeyword_menulist, NS_THEME_DROPDOWN,
298 eCSSKeyword_menulistbutton, NS_THEME_DROPDOWN_BUTTON,
299 eCSSKeyword_menulisttext, NS_THEME_DROPDOWN_TEXT,
300 eCSSKeyword_menulisttextfield, NS_THEME_DROPDOWN_TEXTFIELD,
301 eCSSKeyword_scale_horizontal, NS_THEME_SCALE_HORIZONTAL,
302 eCSSKeyword_scale_vertical, NS_THEME_SCALE_VERTICAL,
303 eCSSKeyword_scalethumb_horizontal, NS_THEME_SCALE_THUMB_HORIZONTAL,
304 eCSSKeyword_scalethumb_vertical, NS_THEME_SCALE_THUMB_VERTICAL,
305 eCSSKeyword_scalethumbstart, NS_THEME_SCALE_THUMB_START,
306 eCSSKeyword_scalethumbend, NS_THEME_SCALE_THUMB_END,
307 eCSSKeyword_scalethumbtick, NS_THEME_SCALE_TICK,
308 eCSSKeyword_groupbox, NS_THEME_GROUPBOX,
309 eCSSKeyword_checkboxcontainer, NS_THEME_CHECKBOX_CONTAINER,
310 eCSSKeyword_radiocontainer, NS_THEME_RADIO_CONTAINER,
311 eCSSKeyword_checkboxlabel, NS_THEME_CHECKBOX_LABEL,
312 eCSSKeyword_radiolabel, NS_THEME_RADIO_LABEL,
313 eCSSKeyword_buttonfocus, NS_THEME_BUTTON_FOCUS,
314 eCSSKeyword_window, NS_THEME_WINDOW,
315 eCSSKeyword_dialog, NS_THEME_DIALOG,
316 eCSSKeyword_menubar, NS_THEME_MENUBAR,
317 eCSSKeyword_menupopup, NS_THEME_MENUPOPUP,
318 eCSSKeyword_menuitem, NS_THEME_MENUITEM,
319 eCSSKeyword_checkmenuitem, NS_THEME_CHECKMENUITEM,
320 eCSSKeyword_radiomenuitem, NS_THEME_RADIOMENUITEM,
321 eCSSKeyword_menucheckbox, NS_THEME_MENUCHECKBOX,
322 eCSSKeyword_menuradio, NS_THEME_MENURADIO,
323 eCSSKeyword_menuseparator, NS_THEME_MENUSEPARATOR,
324 eCSSKeyword_menuarrow, NS_THEME_MENUARROW,
325 eCSSKeyword_menuimage, NS_THEME_MENUIMAGE,
326 eCSSKeyword_menuitemtext, NS_THEME_MENUITEMTEXT,
327 eCSSKeyword__moz_win_media_toolbox, NS_THEME_WIN_MEDIA_TOOLBOX,
328 eCSSKeyword__moz_win_communications_toolbox, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX,
329 eCSSKeyword__moz_win_browsertabbar_toolbox, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX,
330 eCSSKeyword__moz_win_glass, NS_THEME_WIN_GLASS,
331 eCSSKeyword__moz_mac_unified_toolbar, NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR,
332 eCSSKeyword_UNKNOWN,-1
335 // Keyword id tables for variant/enum parsing
336 const PRInt32 nsCSSProps::kAzimuthKTable[] = {
337 eCSSKeyword_left_side, NS_STYLE_AZIMUTH_LEFT_SIDE,
338 eCSSKeyword_far_left, NS_STYLE_AZIMUTH_FAR_LEFT,
339 eCSSKeyword_left, NS_STYLE_AZIMUTH_LEFT,
340 eCSSKeyword_center_left, NS_STYLE_AZIMUTH_CENTER_LEFT,
341 eCSSKeyword_center, NS_STYLE_AZIMUTH_CENTER,
342 eCSSKeyword_center_right, NS_STYLE_AZIMUTH_CENTER_RIGHT,
343 eCSSKeyword_right, NS_STYLE_AZIMUTH_RIGHT,
344 eCSSKeyword_far_right, NS_STYLE_AZIMUTH_FAR_RIGHT,
345 eCSSKeyword_right_side, NS_STYLE_AZIMUTH_RIGHT_SIDE,
346 eCSSKeyword_behind, NS_STYLE_AZIMUTH_BEHIND,
347 eCSSKeyword_leftwards, NS_STYLE_AZIMUTH_LEFTWARDS,
348 eCSSKeyword_rightwards, NS_STYLE_AZIMUTH_RIGHTWARDS,
349 eCSSKeyword_UNKNOWN,-1
352 const PRInt32 nsCSSProps::kBackgroundAttachmentKTable[] = {
353 eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED,
354 eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL,
355 eCSSKeyword_UNKNOWN,-1
358 const PRInt32 nsCSSProps::kBackgroundClipKTable[] = {
359 eCSSKeyword_border, NS_STYLE_BG_CLIP_BORDER,
360 eCSSKeyword_padding, NS_STYLE_BG_CLIP_PADDING,
361 eCSSKeyword_UNKNOWN,-1
364 const PRInt32 nsCSSProps::kBackgroundInlinePolicyKTable[] = {
365 eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX,
366 eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS,
367 eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX,
368 eCSSKeyword_UNKNOWN,-1
371 const PRInt32 nsCSSProps::kBackgroundOriginKTable[] = {
372 eCSSKeyword_border, NS_STYLE_BG_ORIGIN_BORDER,
373 eCSSKeyword_padding, NS_STYLE_BG_ORIGIN_PADDING,
374 eCSSKeyword_content, NS_STYLE_BG_ORIGIN_CONTENT,
375 eCSSKeyword_UNKNOWN,-1
378 // Note: Don't change this table unless you update
379 // parseBackgroundPosition!
381 const PRInt32 nsCSSProps::kBackgroundPositionKTable[] = {
382 eCSSKeyword_center, NS_STYLE_BG_POSITION_CENTER,
383 eCSSKeyword_top, NS_STYLE_BG_POSITION_TOP,
384 eCSSKeyword_bottom, NS_STYLE_BG_POSITION_BOTTOM,
385 eCSSKeyword_left, NS_STYLE_BG_POSITION_LEFT,
386 eCSSKeyword_right, NS_STYLE_BG_POSITION_RIGHT,
387 eCSSKeyword_UNKNOWN,-1
390 const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
391 eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_OFF,
392 eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_XY,
393 eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_X,
394 eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_Y,
395 eCSSKeyword_UNKNOWN,-1
398 const PRInt32 nsCSSProps::kBorderCollapseKTable[] = {
399 eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE,
400 eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE,
401 eCSSKeyword_UNKNOWN,-1
404 const PRInt32 nsCSSProps::kBorderColorKTable[] = {
405 eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
406 eCSSKeyword_UNKNOWN,-1
409 const PRInt32 nsCSSProps::kBorderImageKTable[] = {
410 eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_STRETCH,
411 eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT,
412 eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_ROUND,
413 eCSSKeyword_UNKNOWN,-1
416 const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
417 eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN,
418 eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
419 eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
420 eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
421 eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
422 eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
423 eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
424 eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
425 eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
426 eCSSKeyword_UNKNOWN,-1
429 const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
430 eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
431 eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
432 eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
433 eCSSKeyword_UNKNOWN,-1
436 const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
437 eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL,
438 eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL,
439 eCSSKeyword_UNKNOWN,-1
442 const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
443 eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT,
444 eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER,
445 eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING,
446 eCSSKeyword_UNKNOWN,-1
449 const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
450 eCSSKeyword_top, NS_STYLE_CAPTION_SIDE_TOP,
451 eCSSKeyword_right, NS_STYLE_CAPTION_SIDE_RIGHT,
452 eCSSKeyword_bottom, NS_STYLE_CAPTION_SIDE_BOTTOM,
453 eCSSKeyword_left, NS_STYLE_CAPTION_SIDE_LEFT,
454 eCSSKeyword_top_outside, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE,
455 eCSSKeyword_bottom_outside, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
456 eCSSKeyword_UNKNOWN, -1
459 const PRInt32 nsCSSProps::kClearKTable[] = {
460 eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
461 eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
462 eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
463 eCSSKeyword_UNKNOWN,-1
466 const PRInt32 nsCSSProps::kColorKTable[] = {
467 eCSSKeyword_activeborder, nsILookAndFeel::eColor_activeborder,
468 eCSSKeyword_activecaption, nsILookAndFeel::eColor_activecaption,
469 eCSSKeyword_appworkspace, nsILookAndFeel::eColor_appworkspace,
470 eCSSKeyword_background, nsILookAndFeel::eColor_background,
471 eCSSKeyword_buttonface, nsILookAndFeel::eColor_buttonface,
472 eCSSKeyword_buttonhighlight, nsILookAndFeel::eColor_buttonhighlight,
473 eCSSKeyword_buttonshadow, nsILookAndFeel::eColor_buttonshadow,
474 eCSSKeyword_buttontext, nsILookAndFeel::eColor_buttontext,
475 eCSSKeyword_captiontext, nsILookAndFeel::eColor_captiontext,
476 eCSSKeyword_graytext, nsILookAndFeel::eColor_graytext,
477 eCSSKeyword_highlight, nsILookAndFeel::eColor_highlight,
478 eCSSKeyword_highlighttext, nsILookAndFeel::eColor_highlighttext,
479 eCSSKeyword_inactiveborder, nsILookAndFeel::eColor_inactiveborder,
480 eCSSKeyword_inactivecaption, nsILookAndFeel::eColor_inactivecaption,
481 eCSSKeyword_inactivecaptiontext, nsILookAndFeel::eColor_inactivecaptiontext,
482 eCSSKeyword_infobackground, nsILookAndFeel::eColor_infobackground,
483 eCSSKeyword_infotext, nsILookAndFeel::eColor_infotext,
484 eCSSKeyword_menu, nsILookAndFeel::eColor_menu,
485 eCSSKeyword_menutext, nsILookAndFeel::eColor_menutext,
486 eCSSKeyword_scrollbar, nsILookAndFeel::eColor_scrollbar,
487 eCSSKeyword_threeddarkshadow, nsILookAndFeel::eColor_threeddarkshadow,
488 eCSSKeyword_threedface, nsILookAndFeel::eColor_threedface,
489 eCSSKeyword_threedhighlight, nsILookAndFeel::eColor_threedhighlight,
490 eCSSKeyword_threedlightshadow, nsILookAndFeel::eColor_threedlightshadow,
491 eCSSKeyword_threedshadow, nsILookAndFeel::eColor_threedshadow,
492 eCSSKeyword_window, nsILookAndFeel::eColor_window,
493 eCSSKeyword_windowframe, nsILookAndFeel::eColor_windowframe,
494 eCSSKeyword_windowtext, nsILookAndFeel::eColor_windowtext,
495 eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT,
496 eCSSKeyword__moz_buttondefault, nsILookAndFeel::eColor__moz_buttondefault,
497 eCSSKeyword__moz_buttonhoverface, nsILookAndFeel::eColor__moz_buttonhoverface,
498 eCSSKeyword__moz_buttonhovertext, nsILookAndFeel::eColor__moz_buttonhovertext,
499 eCSSKeyword__moz_cellhighlight, nsILookAndFeel::eColor__moz_cellhighlight,
500 eCSSKeyword__moz_cellhighlighttext, nsILookAndFeel::eColor__moz_cellhighlighttext,
501 eCSSKeyword__moz_eventreerow, nsILookAndFeel::eColor__moz_eventreerow,
502 eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field,
503 eCSSKeyword__moz_fieldtext, nsILookAndFeel::eColor__moz_fieldtext,
504 eCSSKeyword__moz_dialog, nsILookAndFeel::eColor__moz_dialog,
505 eCSSKeyword__moz_dialogtext, nsILookAndFeel::eColor__moz_dialogtext,
506 eCSSKeyword__moz_dragtargetzone, nsILookAndFeel::eColor__moz_dragtargetzone,
507 eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT,
508 eCSSKeyword__moz_html_cellhighlight, nsILookAndFeel::eColor__moz_html_cellhighlight,
509 eCSSKeyword__moz_html_cellhighlighttext, nsILookAndFeel::eColor__moz_html_cellhighlighttext,
510 eCSSKeyword__moz_mac_chrome_active, nsILookAndFeel::eColor__moz_mac_chrome_active,
511 eCSSKeyword__moz_mac_chrome_inactive, nsILookAndFeel::eColor__moz_mac_chrome_inactive,
512 eCSSKeyword__moz_mac_focusring, nsILookAndFeel::eColor__moz_mac_focusring,
513 eCSSKeyword__moz_mac_menuselect, nsILookAndFeel::eColor__moz_mac_menuselect,
514 eCSSKeyword__moz_mac_menushadow, nsILookAndFeel::eColor__moz_mac_menushadow,
515 eCSSKeyword__moz_mac_menutextdisable, nsILookAndFeel::eColor__moz_mac_menutextdisable,
516 eCSSKeyword__moz_mac_menutextselect, nsILookAndFeel::eColor__moz_mac_menutextselect,
517 eCSSKeyword__moz_mac_accentlightesthighlight, nsILookAndFeel::eColor__moz_mac_accentlightesthighlight,
518 eCSSKeyword__moz_mac_accentregularhighlight, nsILookAndFeel::eColor__moz_mac_accentregularhighlight,
519 eCSSKeyword__moz_mac_accentface, nsILookAndFeel::eColor__moz_mac_accentface,
520 eCSSKeyword__moz_mac_accentlightshadow, nsILookAndFeel::eColor__moz_mac_accentlightshadow,
521 eCSSKeyword__moz_mac_accentregularshadow, nsILookAndFeel::eColor__moz_mac_accentregularshadow,
522 eCSSKeyword__moz_mac_accentdarkshadow, nsILookAndFeel::eColor__moz_mac_accentdarkshadow,
523 eCSSKeyword__moz_mac_accentdarkestshadow, nsILookAndFeel::eColor__moz_mac_accentdarkestshadow,
524 eCSSKeyword__moz_mac_alternateprimaryhighlight, nsILookAndFeel::eColor__moz_mac_alternateprimaryhighlight,
525 eCSSKeyword__moz_mac_secondaryhighlight, nsILookAndFeel::eColor__moz_mac_secondaryhighlight,
526 eCSSKeyword__moz_menuhover, nsILookAndFeel::eColor__moz_menuhover,
527 eCSSKeyword__moz_menuhovertext, nsILookAndFeel::eColor__moz_menuhovertext,
528 eCSSKeyword__moz_menubarhovertext, nsILookAndFeel::eColor__moz_menubarhovertext,
529 eCSSKeyword__moz_oddtreerow, nsILookAndFeel::eColor__moz_oddtreerow,
530 eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
531 eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR,
532 eCSSKeyword__moz_win_mediatext, nsILookAndFeel::eColor__moz_win_mediatext,
533 eCSSKeyword__moz_win_communicationstext, nsILookAndFeel::eColor__moz_win_communicationstext,
534 eCSSKeyword__moz_nativehyperlinktext, nsILookAndFeel::eColor__moz_nativehyperlinktext,
535 eCSSKeyword_UNKNOWN,-1
538 const PRInt32 nsCSSProps::kContentKTable[] = {
539 eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE,
540 eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
541 eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
542 eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
543 eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT,
544 eCSSKeyword_UNKNOWN,-1
547 const PRInt32 nsCSSProps::kCursorKTable[] = {
548 // CSS 2.0
549 eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR,
550 eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT,
551 eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER,
552 eCSSKeyword_move, NS_STYLE_CURSOR_MOVE,
553 eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE,
554 eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE,
555 eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE,
556 eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE,
557 eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE,
558 eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE,
559 eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE,
560 eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE,
561 eCSSKeyword_text, NS_STYLE_CURSOR_TEXT,
562 eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT,
563 eCSSKeyword_help, NS_STYLE_CURSOR_HELP,
564 // CSS 2.1
565 eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING,
566 // CSS3 basic user interface module
567 eCSSKeyword_copy, NS_STYLE_CURSOR_COPY,
568 eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS,
569 eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
570 eCSSKeyword_cell, NS_STYLE_CURSOR_CELL,
571 eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED,
572 eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE,
573 eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE,
574 eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP,
575 eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT,
576 eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL,
577 eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE,
578 eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE,
579 eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE,
580 eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE,
581 eCSSKeyword_none, NS_STYLE_CURSOR_NONE,
582 // -moz- prefixed aliases for some CSS3 cursors for backward compat
583 eCSSKeyword__moz_copy, NS_STYLE_CURSOR_COPY,
584 eCSSKeyword__moz_alias, NS_STYLE_CURSOR_ALIAS,
585 eCSSKeyword__moz_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
586 eCSSKeyword__moz_cell, NS_STYLE_CURSOR_CELL,
587 // -moz- prefixed vendor specific
588 eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB,
589 eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING,
590 eCSSKeyword__moz_spinning, NS_STYLE_CURSOR_SPINNING,
591 eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
592 eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
593 eCSSKeyword_UNKNOWN,-1
596 const PRInt32 nsCSSProps::kDirectionKTable[] = {
597 eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR,
598 eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL,
599 eCSSKeyword_UNKNOWN,-1
602 const PRInt32 nsCSSProps::kDisplayKTable[] = {
603 eCSSKeyword_inline, NS_STYLE_DISPLAY_INLINE,
604 eCSSKeyword_block, NS_STYLE_DISPLAY_BLOCK,
605 eCSSKeyword_inline_block, NS_STYLE_DISPLAY_INLINE_BLOCK,
606 eCSSKeyword_list_item, NS_STYLE_DISPLAY_LIST_ITEM,
607 eCSSKeyword__moz_run_in, NS_STYLE_DISPLAY_RUN_IN,
608 eCSSKeyword__moz_compact, NS_STYLE_DISPLAY_COMPACT,
609 eCSSKeyword__moz_marker, NS_STYLE_DISPLAY_MARKER,
610 eCSSKeyword_table, NS_STYLE_DISPLAY_TABLE,
611 eCSSKeyword_inline_table, NS_STYLE_DISPLAY_INLINE_TABLE,
612 eCSSKeyword_table_row_group, NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
613 eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
614 eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
615 eCSSKeyword_table_row, NS_STYLE_DISPLAY_TABLE_ROW,
616 eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
617 eCSSKeyword_table_column, NS_STYLE_DISPLAY_TABLE_COLUMN,
618 eCSSKeyword_table_cell, NS_STYLE_DISPLAY_TABLE_CELL,
619 eCSSKeyword_table_caption, NS_STYLE_DISPLAY_TABLE_CAPTION,
620 // Make sure this is kept in sync with the code in
621 // nsCSSFrameConstructor::ConstructXULFrame
622 eCSSKeyword__moz_box, NS_STYLE_DISPLAY_BOX,
623 eCSSKeyword__moz_inline_box, NS_STYLE_DISPLAY_INLINE_BOX,
624 #ifdef MOZ_XUL
625 eCSSKeyword__moz_grid, NS_STYLE_DISPLAY_GRID,
626 eCSSKeyword__moz_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID,
627 eCSSKeyword__moz_grid_group, NS_STYLE_DISPLAY_GRID_GROUP,
628 eCSSKeyword__moz_grid_line, NS_STYLE_DISPLAY_GRID_LINE,
629 eCSSKeyword__moz_stack, NS_STYLE_DISPLAY_STACK,
630 eCSSKeyword__moz_inline_stack, NS_STYLE_DISPLAY_INLINE_STACK,
631 eCSSKeyword__moz_deck, NS_STYLE_DISPLAY_DECK,
632 eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP,
633 eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX,
634 #endif
635 eCSSKeyword_UNKNOWN,-1
638 const PRInt32 nsCSSProps::kElevationKTable[] = {
639 eCSSKeyword_below, NS_STYLE_ELEVATION_BELOW,
640 eCSSKeyword_level, NS_STYLE_ELEVATION_LEVEL,
641 eCSSKeyword_above, NS_STYLE_ELEVATION_ABOVE,
642 eCSSKeyword_higher, NS_STYLE_ELEVATION_HIGHER,
643 eCSSKeyword_lower, NS_STYLE_ELEVATION_LOWER,
644 eCSSKeyword_UNKNOWN,-1
647 const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
648 eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
649 eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
650 eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
651 eCSSKeyword_UNKNOWN,-1
654 const PRInt32 nsCSSProps::kFloatKTable[] = {
655 eCSSKeyword_left, NS_STYLE_FLOAT_LEFT,
656 eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
657 eCSSKeyword_UNKNOWN,-1
660 const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
661 eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT,
662 eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN,
663 eCSSKeyword_UNKNOWN,-1
666 const PRInt32 nsCSSProps::kFontKTable[] = {
667 // CSS2.
668 eCSSKeyword_caption, NS_STYLE_FONT_CAPTION,
669 eCSSKeyword_icon, NS_STYLE_FONT_ICON,
670 eCSSKeyword_menu, NS_STYLE_FONT_MENU,
671 eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX,
672 eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION,
673 eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR,
675 // Proposed for CSS3.
676 eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW,
677 eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT,
678 eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE,
679 eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP,
680 eCSSKeyword__moz_info, NS_STYLE_FONT_INFO,
681 eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG,
682 eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON,
683 eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
684 eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
685 eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
686 eCSSKeyword_UNKNOWN,-1
689 const PRInt32 nsCSSProps::kFontSizeKTable[] = {
690 eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL,
691 eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL,
692 eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL,
693 eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM,
694 eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE,
695 eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE,
696 eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
697 eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
698 eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
699 eCSSKeyword_UNKNOWN,-1
702 const PRInt32 nsCSSProps::kFontStretchKTable[] = {
703 eCSSKeyword_wider, NS_STYLE_FONT_STRETCH_WIDER,
704 eCSSKeyword_narrower, NS_STYLE_FONT_STRETCH_NARROWER,
705 eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED,
706 eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED,
707 eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED,
708 eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED,
709 eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED,
710 eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
711 eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
712 eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
713 eCSSKeyword_UNKNOWN,-1
716 const PRInt32 nsCSSProps::kFontStyleKTable[] = {
717 eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
718 eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
719 eCSSKeyword_UNKNOWN,-1
722 const PRInt32 nsCSSProps::kFontVariantKTable[] = {
723 eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
724 eCSSKeyword_UNKNOWN,-1
727 const PRInt32 nsCSSProps::kFontWeightKTable[] = {
728 eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
729 eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
730 eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
731 eCSSKeyword_UNKNOWN,-1
734 const PRInt32 nsCSSProps::kIMEModeKTable[] = {
735 eCSSKeyword_active, NS_STYLE_IME_MODE_ACTIVE,
736 eCSSKeyword_disabled, NS_STYLE_IME_MODE_DISABLED,
737 eCSSKeyword_inactive, NS_STYLE_IME_MODE_INACTIVE,
738 eCSSKeyword_UNKNOWN,-1
741 // XXX What's the point?
742 const PRInt32 nsCSSProps::kKeyEquivalentKTable[] = {
743 eCSSKeyword_UNKNOWN,-1
746 const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
747 eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
748 eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
749 eCSSKeyword_UNKNOWN,-1
752 const PRInt32 nsCSSProps::kListStyleKTable[] = {
753 eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC,
754 eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE,
755 eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE,
756 eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL,
757 eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO,
758 eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN,
759 eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN,
760 eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK,
761 eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA,
762 eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN,
763 eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA,
764 eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN,
765 eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW,
766 eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN,
767 eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN,
768 eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC,
769 eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA,
770 eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA,
771 eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA,
772 eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA,
773 eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM,
774 eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH,
775 eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL,
776 eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL,
777 eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL,
778 eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL,
779 eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL,
780 eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL,
781 eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC,
782 eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN,
783 eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU,
784 eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI,
785 eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI,
786 eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI,
787 eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA,
788 eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA,
789 eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM,
790 eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI,
791 eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL,
792 eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU,
793 eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI,
794 eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO,
795 eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR,
796 eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER,
797 eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL,
798 eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT,
799 eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME,
800 eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC,
801 eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
802 eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
803 eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
804 eCSSKeyword_UNKNOWN,-1
807 // Same as kBorderStyleKTable except 'hidden'.
808 const PRInt32 nsCSSProps::kOutlineStyleKTable[] = {
809 eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
810 eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
811 eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
812 eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
813 eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
814 eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
815 eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
816 eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
817 eCSSKeyword_UNKNOWN,-1
820 const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
821 #ifdef GFX_HAS_INVERT
822 eCSSKeyword_invert, NS_STYLE_COLOR_INVERT,
823 #else
824 eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
825 #endif
826 eCSSKeyword_UNKNOWN,-1
829 const PRInt32 nsCSSProps::kOverflowKTable[] = {
830 eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
831 eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
832 eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
833 // Deprecated:
834 eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
835 eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
836 eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
837 eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
838 eCSSKeyword_UNKNOWN,-1
841 const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
842 eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
843 eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
844 eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
845 // Deprecated:
846 eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
847 eCSSKeyword_UNKNOWN,-1
850 const PRInt32 nsCSSProps::kPageBreakKTable[] = {
851 eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
852 eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
853 eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
854 eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
855 eCSSKeyword_UNKNOWN,-1
858 const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
859 eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
860 eCSSKeyword_UNKNOWN,-1
863 const PRInt32 nsCSSProps::kPageMarksKTable[] = {
864 eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
865 eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
866 eCSSKeyword_UNKNOWN,-1
869 const PRInt32 nsCSSProps::kPageSizeKTable[] = {
870 eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
871 eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
872 eCSSKeyword_UNKNOWN,-1
875 const PRInt32 nsCSSProps::kPitchKTable[] = {
876 eCSSKeyword_x_low, NS_STYLE_PITCH_X_LOW,
877 eCSSKeyword_low, NS_STYLE_PITCH_LOW,
878 eCSSKeyword_medium, NS_STYLE_PITCH_MEDIUM,
879 eCSSKeyword_high, NS_STYLE_PITCH_HIGH,
880 eCSSKeyword_x_high, NS_STYLE_PITCH_X_HIGH,
881 eCSSKeyword_UNKNOWN,-1
884 const PRInt32 nsCSSProps::kPositionKTable[] = {
885 eCSSKeyword_static, NS_STYLE_POSITION_STATIC,
886 eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
887 eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
888 eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
889 eCSSKeyword_UNKNOWN,-1
892 const PRInt32 nsCSSProps::kSpeakKTable[] = {
893 eCSSKeyword_spell_out, NS_STYLE_SPEAK_SPELL_OUT,
894 eCSSKeyword_UNKNOWN,-1
897 const PRInt32 nsCSSProps::kSpeakHeaderKTable[] = {
898 eCSSKeyword_once, NS_STYLE_SPEAK_HEADER_ONCE,
899 eCSSKeyword_always, NS_STYLE_SPEAK_HEADER_ALWAYS,
900 eCSSKeyword_UNKNOWN,-1
903 const PRInt32 nsCSSProps::kSpeakNumeralKTable[] = {
904 eCSSKeyword_digits, NS_STYLE_SPEAK_NUMERAL_DIGITS,
905 eCSSKeyword_continuous, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS,
906 eCSSKeyword_UNKNOWN,-1
909 const PRInt32 nsCSSProps::kSpeakPunctuationKTable[] = {
910 eCSSKeyword_code, NS_STYLE_SPEAK_PUNCTUATION_CODE,
911 eCSSKeyword_UNKNOWN,-1
914 const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
915 eCSSKeyword_x_slow, NS_STYLE_SPEECH_RATE_X_SLOW,
916 eCSSKeyword_slow, NS_STYLE_SPEECH_RATE_SLOW,
917 eCSSKeyword_medium, NS_STYLE_SPEECH_RATE_MEDIUM,
918 eCSSKeyword_fast, NS_STYLE_SPEECH_RATE_FAST,
919 eCSSKeyword_x_fast, NS_STYLE_SPEECH_RATE_X_FAST,
920 eCSSKeyword_faster, NS_STYLE_SPEECH_RATE_FASTER,
921 eCSSKeyword_slower, NS_STYLE_SPEECH_RATE_SLOWER,
922 eCSSKeyword_UNKNOWN,-1
925 const PRInt32 nsCSSProps::kStackSizingKTable[] = {
926 eCSSKeyword_ignore, NS_STYLE_STACK_SIZING_IGNORE,
927 eCSSKeyword_stretch_to_fit, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT,
928 eCSSKeyword_UNKNOWN,-1
931 const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
932 eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
933 eCSSKeyword_UNKNOWN,-1
936 const PRInt32 nsCSSProps::kTextAlignKTable[] = {
937 eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
938 eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
939 eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
940 eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
941 eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
942 eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
943 eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT,
944 eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
945 eCSSKeyword_UNKNOWN,-1
948 const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
949 eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_UNDERLINE,
950 eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_OVERLINE,
951 eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
952 eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_BLINK,
953 eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS,
954 eCSSKeyword_UNKNOWN,-1
957 const PRInt32 nsCSSProps::kTextTransformKTable[] = {
958 eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
959 eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
960 eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
961 eCSSKeyword_UNKNOWN,-1
964 const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
965 eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
966 eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
967 eCSSKeyword_UNKNOWN,-1
970 const PRInt32 nsCSSProps::kUserFocusKTable[] = {
971 eCSSKeyword_ignore, NS_STYLE_USER_FOCUS_IGNORE,
972 eCSSKeyword_select_all, NS_STYLE_USER_FOCUS_SELECT_ALL,
973 eCSSKeyword_select_before, NS_STYLE_USER_FOCUS_SELECT_BEFORE,
974 eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER,
975 eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME,
976 eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU,
977 eCSSKeyword_UNKNOWN,-1
980 const PRInt32 nsCSSProps::kUserInputKTable[] = {
981 eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED,
982 eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
983 eCSSKeyword_UNKNOWN,-1
986 const PRInt32 nsCSSProps::kUserModifyKTable[] = {
987 eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY,
988 eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
989 eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
990 eCSSKeyword_UNKNOWN,-1
993 const PRInt32 nsCSSProps::kUserSelectKTable[] = {
994 eCSSKeyword_text, NS_STYLE_USER_SELECT_TEXT,
995 eCSSKeyword_element, NS_STYLE_USER_SELECT_ELEMENT,
996 eCSSKeyword_elements, NS_STYLE_USER_SELECT_ELEMENTS,
997 eCSSKeyword_all, NS_STYLE_USER_SELECT_ALL,
998 eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE,
999 eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE,
1000 eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL,
1001 eCSSKeyword__moz_none, NS_STYLE_USER_SELECT_MOZ_NONE,
1002 eCSSKeyword_UNKNOWN,-1
1005 const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
1006 eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE,
1007 eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB,
1008 eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER,
1009 eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP,
1010 eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP,
1011 eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
1012 eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE,
1013 eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
1014 eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
1015 eCSSKeyword_UNKNOWN,-1
1018 const PRInt32 nsCSSProps::kVisibilityKTable[] = {
1019 eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
1020 eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
1021 eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
1022 eCSSKeyword_UNKNOWN,-1
1025 const PRInt32 nsCSSProps::kVolumeKTable[] = {
1026 eCSSKeyword_silent, NS_STYLE_VOLUME_SILENT,
1027 eCSSKeyword_x_soft, NS_STYLE_VOLUME_X_SOFT,
1028 eCSSKeyword_soft, NS_STYLE_VOLUME_SOFT,
1029 eCSSKeyword_medium, NS_STYLE_VOLUME_MEDIUM,
1030 eCSSKeyword_loud, NS_STYLE_VOLUME_LOUD,
1031 eCSSKeyword_x_loud, NS_STYLE_VOLUME_X_LOUD,
1032 eCSSKeyword_UNKNOWN,-1
1035 const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
1036 eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
1037 eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
1038 eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP,
1039 eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP,
1040 eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE,
1041 eCSSKeyword_UNKNOWN,-1
1044 const PRInt32 nsCSSProps::kWidthKTable[] = {
1045 eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT,
1046 eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT,
1047 eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT,
1048 eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE,
1049 eCSSKeyword_UNKNOWN,-1
1052 const PRInt32 nsCSSProps::kWordwrapKTable[] = {
1053 eCSSKeyword_normal, NS_STYLE_WORDWRAP_NORMAL,
1054 eCSSKeyword_break_word, NS_STYLE_WORDWRAP_BREAK_WORD,
1055 eCSSKeyword_UNKNOWN,-1
1058 // Specific keyword tables for XUL.properties
1059 const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
1060 eCSSKeyword_stretch, NS_STYLE_BOX_ALIGN_STRETCH,
1061 eCSSKeyword_start, NS_STYLE_BOX_ALIGN_START,
1062 eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
1063 eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE,
1064 eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END,
1065 eCSSKeyword_UNKNOWN,-1
1068 const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
1069 eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL,
1070 eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE,
1071 eCSSKeyword_UNKNOWN,-1
1074 const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
1075 eCSSKeyword_horizontal, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1076 eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL,
1077 eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1078 eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL,
1079 eCSSKeyword_UNKNOWN,-1
1082 const PRInt32 nsCSSProps::kBoxPackKTable[] = {
1083 eCSSKeyword_start, NS_STYLE_BOX_PACK_START,
1084 eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER,
1085 eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
1086 eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY,
1087 eCSSKeyword_UNKNOWN,-1
1090 #ifdef MOZ_SVG
1091 // keyword tables for SVG properties
1093 const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
1094 eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT,
1095 eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE,
1096 eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE,
1097 eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC,
1098 eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING,
1099 eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC,
1100 eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL,
1101 eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL,
1102 eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
1103 eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
1104 eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
1105 eCSSKeyword_UNKNOWN, -1
1108 const PRInt32 nsCSSProps::kFillRuleKTable[] = {
1109 eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
1110 eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
1111 eCSSKeyword_UNKNOWN, -1
1114 const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
1115 eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
1116 eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
1117 eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
1118 eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
1119 eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
1120 eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
1121 eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
1122 eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
1123 eCSSKeyword_UNKNOWN, -1
1126 const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
1127 eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
1128 eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
1129 eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
1130 eCSSKeyword_UNKNOWN, -1
1133 const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
1134 eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
1135 eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
1136 eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
1137 eCSSKeyword_UNKNOWN, -1
1140 const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
1141 eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
1142 eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
1143 eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
1144 eCSSKeyword_UNKNOWN, -1
1147 const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
1148 eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
1149 eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
1150 eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
1151 eCSSKeyword_UNKNOWN, -1
1154 const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
1155 eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
1156 eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
1157 eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
1158 eCSSKeyword_UNKNOWN, -1
1161 const PRInt32 nsCSSProps::kColorInterpolationKTable[] = {
1162 eCSSKeyword_srgb, NS_STYLE_COLOR_INTERPOLATION_SRGB,
1163 eCSSKeyword_linearrgb, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB,
1164 eCSSKeyword_UNKNOWN, -1
1167 #endif
1169 PRBool
1170 nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
1172 PRInt32 index = 0;
1173 while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
1174 if (aKeyword == nsCSSKeyword(aTable[index])) {
1175 aResult = aTable[index+1];
1176 return PR_TRUE;
1178 index += 2;
1180 return PR_FALSE;
1183 nsCSSKeyword
1184 nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
1186 PRInt32 i = 1;
1187 for (;;) {
1188 if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
1189 break;
1191 if (aValue == aTable[i]) {
1192 return nsCSSKeyword(aTable[i-1]);
1194 i += 2;
1196 return eCSSKeyword_UNKNOWN;
1199 const nsAFlatCString&
1200 nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
1202 nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
1203 if (keyword == eCSSKeyword_UNKNOWN) {
1204 static nsDependentCString sNullStr("");
1205 return sNullStr;
1206 } else {
1207 return nsCSSKeywords::GetStringValue(keyword);
1211 /* static */ const PRInt32* const
1212 nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = {
1213 #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) kwtable_,
1214 #include "nsCSSPropList.h"
1215 #undef CSS_PROP
1218 const nsAFlatCString&
1219 nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
1221 NS_ASSERTION(aProp >= 0 && aProp < eCSSProperty_COUNT, "property out of range");
1223 const PRInt32* kwtable = nsnull;
1224 if (aProp < eCSSProperty_COUNT_no_shorthands)
1225 kwtable = kKeywordTableTable[aProp];
1227 if (kwtable)
1228 return ValueToKeyword(aValue, kwtable);
1230 static nsDependentCString sNullStr("");
1231 return sNullStr;
1234 PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
1236 PRBool rv = PR_FALSE;
1238 // first get the keyword corresponding to the property Value from the color table
1239 nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
1241 // next get the name as a string from the keywords table
1242 if (keyword != eCSSKeyword_UNKNOWN) {
1243 nsCSSKeywords::AddRefTable();
1244 aStr = nsCSSKeywords::GetStringValue(keyword);
1245 nsCSSKeywords::ReleaseTable();
1246 rv = PR_TRUE;
1248 return rv;
1251 // define array of all CSS property types
1252 const nsCSSType nsCSSProps::kTypeTable[eCSSProperty_COUNT_no_shorthands] = {
1253 #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) type_,
1254 #include "nsCSSPropList.h"
1255 #undef CSS_PROP
1258 const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = {
1259 #define CSS_PROP_FONT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Font,
1260 #define CSS_PROP_COLOR(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Color,
1261 #define CSS_PROP_BACKGROUND(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Background,
1262 #define CSS_PROP_LIST(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_List,
1263 #define CSS_PROP_POSITION(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Position,
1264 #define CSS_PROP_TEXT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Text,
1265 #define CSS_PROP_TEXTRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_TextReset,
1266 #define CSS_PROP_DISPLAY(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Display,
1267 #define CSS_PROP_VISIBILITY(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Visibility,
1268 #define CSS_PROP_CONTENT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Content,
1269 #define CSS_PROP_QUOTES(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Quotes,
1270 #define CSS_PROP_USERINTERFACE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_UserInterface,
1271 #define CSS_PROP_UIRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_UIReset,
1272 #define CSS_PROP_TABLE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Table,
1273 #define CSS_PROP_TABLEBORDER(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_TableBorder,
1274 #define CSS_PROP_MARGIN(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Margin,
1275 #define CSS_PROP_PADDING(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Padding,
1276 #define CSS_PROP_BORDER(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Border,
1277 #define CSS_PROP_OUTLINE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Outline,
1278 #define CSS_PROP_XUL(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_XUL,
1279 #define CSS_PROP_SVG(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVG,
1280 #define CSS_PROP_SVGRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVGReset,
1281 #define CSS_PROP_COLUMN(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Column,
1282 // This shouldn't matter, but we need something to go here.
1283 #define CSS_PROP_BACKENDONLY(name_, id_, method_, datastruct_, member_, type_, kwtable_) nsStyleStructID(-1),
1285 #include "nsCSSPropList.h"
1287 #undef CSS_PROP_FONT
1288 #undef CSS_PROP_COLOR
1289 #undef CSS_PROP_BACKGROUND
1290 #undef CSS_PROP_LIST
1291 #undef CSS_PROP_POSITION
1292 #undef CSS_PROP_TEXT
1293 #undef CSS_PROP_TEXTRESET
1294 #undef CSS_PROP_DISPLAY
1295 #undef CSS_PROP_VISIBILITY
1296 #undef CSS_PROP_CONTENT
1297 #undef CSS_PROP_QUOTES
1298 #undef CSS_PROP_USERINTERFACE
1299 #undef CSS_PROP_UIRESET
1300 #undef CSS_PROP_TABLE
1301 #undef CSS_PROP_TABLEBORDER
1302 #undef CSS_PROP_MARGIN
1303 #undef CSS_PROP_PADDING
1304 #undef CSS_PROP_BORDER
1305 #undef CSS_PROP_OUTLINE
1306 #undef CSS_PROP_XUL
1307 #undef CSS_PROP_SVG
1308 #undef CSS_PROP_SVGRESET
1309 #undef CSS_PROP_COLUMN
1310 #undef CSS_PROP_BACKENDONLY
1313 static const nsCSSProperty gMozBorderRadiusSubpropTable[] = {
1314 // Code relies on these being in topleft-topright-bottomright-bottomleft
1315 // order.
1316 eCSSProperty__moz_border_radius_topLeft,
1317 eCSSProperty__moz_border_radius_topRight,
1318 eCSSProperty__moz_border_radius_bottomRight,
1319 eCSSProperty__moz_border_radius_bottomLeft,
1320 eCSSProperty_UNKNOWN
1323 static const nsCSSProperty gMozOutlineRadiusSubpropTable[] = {
1324 // Code relies on these being in topleft-topright-bottomright-bottomleft
1325 // order.
1326 eCSSProperty__moz_outline_radius_topLeft,
1327 eCSSProperty__moz_outline_radius_topRight,
1328 eCSSProperty__moz_outline_radius_bottomRight,
1329 eCSSProperty__moz_outline_radius_bottomLeft,
1330 eCSSProperty_UNKNOWN
1333 static const nsCSSProperty gBackgroundSubpropTable[] = {
1334 eCSSProperty_background_color,
1335 eCSSProperty_background_image,
1336 eCSSProperty_background_repeat,
1337 eCSSProperty_background_attachment,
1338 eCSSProperty_background_position,
1339 eCSSProperty__moz_background_clip, // XXX Added LDB.
1340 eCSSProperty__moz_background_origin, // XXX Added LDB.
1341 eCSSProperty__moz_background_inline_policy, // XXX Added LDB.
1342 eCSSProperty_UNKNOWN
1345 static const nsCSSProperty gBorderSubpropTable[] = {
1346 eCSSProperty_border_top_width,
1347 eCSSProperty_border_right_width_value,
1348 eCSSProperty_border_right_width_ltr_source,
1349 eCSSProperty_border_right_width_rtl_source,
1350 eCSSProperty_border_bottom_width,
1351 eCSSProperty_border_left_width_value,
1352 eCSSProperty_border_left_width_ltr_source,
1353 eCSSProperty_border_left_width_rtl_source,
1354 eCSSProperty_border_top_style,
1355 eCSSProperty_border_right_style_value,
1356 eCSSProperty_border_right_style_ltr_source,
1357 eCSSProperty_border_right_style_rtl_source,
1358 eCSSProperty_border_bottom_style,
1359 eCSSProperty_border_left_style_value,
1360 eCSSProperty_border_left_style_ltr_source,
1361 eCSSProperty_border_left_style_rtl_source,
1362 eCSSProperty_border_top_color,
1363 eCSSProperty_border_right_color_value,
1364 eCSSProperty_border_right_color_ltr_source,
1365 eCSSProperty_border_right_color_rtl_source,
1366 eCSSProperty_border_bottom_color,
1367 eCSSProperty_border_left_color_value,
1368 eCSSProperty_border_left_color_ltr_source,
1369 eCSSProperty_border_left_color_rtl_source,
1370 eCSSProperty_UNKNOWN
1373 static const nsCSSProperty gBorderBottomSubpropTable[] = {
1374 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1375 eCSSProperty_border_bottom_width,
1376 eCSSProperty_border_bottom_style,
1377 eCSSProperty_border_bottom_color,
1378 eCSSProperty_UNKNOWN
1381 static const nsCSSProperty gBorderColorSubpropTable[] = {
1382 // Code relies on these being in top-right-bottom-left order.
1383 eCSSProperty_border_top_color,
1384 eCSSProperty_border_right_color_value,
1385 eCSSProperty_border_bottom_color,
1386 eCSSProperty_border_left_color_value,
1387 // extras:
1388 eCSSProperty_border_left_color_ltr_source,
1389 eCSSProperty_border_left_color_rtl_source,
1390 eCSSProperty_border_right_color_ltr_source,
1391 eCSSProperty_border_right_color_rtl_source,
1392 eCSSProperty_UNKNOWN
1395 static const nsCSSProperty gMozBorderEndColorSubpropTable[] = {
1396 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1397 eCSSProperty_border_end_color_value,
1398 eCSSProperty_border_right_color_ltr_source,
1399 eCSSProperty_border_left_color_rtl_source,
1400 eCSSProperty_UNKNOWN
1403 static const nsCSSProperty gBorderLeftColorSubpropTable[] = {
1404 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1405 eCSSProperty_border_left_color_value,
1406 eCSSProperty_border_left_color_ltr_source,
1407 eCSSProperty_border_left_color_rtl_source,
1408 eCSSProperty_UNKNOWN
1411 static const nsCSSProperty gBorderRightColorSubpropTable[] = {
1412 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1413 eCSSProperty_border_right_color_value,
1414 eCSSProperty_border_right_color_ltr_source,
1415 eCSSProperty_border_right_color_rtl_source,
1416 eCSSProperty_UNKNOWN
1419 static const nsCSSProperty gMozBorderStartColorSubpropTable[] = {
1420 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1421 eCSSProperty_border_start_color_value,
1422 eCSSProperty_border_left_color_ltr_source,
1423 eCSSProperty_border_right_color_rtl_source,
1424 eCSSProperty_UNKNOWN
1427 static const nsCSSProperty gMozBorderEndSubpropTable[] = {
1428 // nsCSSDeclaration.cpp output the subproperties in this order.
1429 eCSSProperty_border_end_width_value,
1430 eCSSProperty_border_end_style_value,
1431 eCSSProperty_border_end_color_value,
1432 // extras:
1433 eCSSProperty_border_right_width_ltr_source,
1434 eCSSProperty_border_left_width_rtl_source,
1435 eCSSProperty_border_right_style_ltr_source,
1436 eCSSProperty_border_left_style_rtl_source,
1437 eCSSProperty_border_right_color_ltr_source,
1438 eCSSProperty_border_left_color_rtl_source,
1439 eCSSProperty_UNKNOWN
1442 static const nsCSSProperty gBorderLeftSubpropTable[] = {
1443 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1444 eCSSProperty_border_left_width_value,
1445 eCSSProperty_border_left_style_value,
1446 eCSSProperty_border_left_color_value,
1447 // extras:
1448 eCSSProperty_border_left_width_ltr_source,
1449 eCSSProperty_border_left_width_rtl_source,
1450 eCSSProperty_border_left_style_ltr_source,
1451 eCSSProperty_border_left_style_rtl_source,
1452 eCSSProperty_border_left_color_ltr_source,
1453 eCSSProperty_border_left_color_rtl_source,
1454 eCSSProperty_UNKNOWN
1457 static const nsCSSProperty gBorderRightSubpropTable[] = {
1458 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1459 eCSSProperty_border_right_width_value,
1460 eCSSProperty_border_right_style_value,
1461 eCSSProperty_border_right_color_value,
1462 // extras:
1463 eCSSProperty_border_right_width_ltr_source,
1464 eCSSProperty_border_right_width_rtl_source,
1465 eCSSProperty_border_right_style_ltr_source,
1466 eCSSProperty_border_right_style_rtl_source,
1467 eCSSProperty_border_right_color_ltr_source,
1468 eCSSProperty_border_right_color_rtl_source,
1469 eCSSProperty_UNKNOWN
1472 static const nsCSSProperty gMozBorderStartSubpropTable[] = {
1473 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1474 eCSSProperty_border_start_width_value,
1475 eCSSProperty_border_start_style_value,
1476 eCSSProperty_border_start_color_value,
1477 // extras:
1478 eCSSProperty_border_left_width_ltr_source,
1479 eCSSProperty_border_right_width_rtl_source,
1480 eCSSProperty_border_left_style_ltr_source,
1481 eCSSProperty_border_right_style_rtl_source,
1482 eCSSProperty_border_left_color_ltr_source,
1483 eCSSProperty_border_right_color_rtl_source,
1484 eCSSProperty_UNKNOWN
1487 static const nsCSSProperty gBorderStyleSubpropTable[] = {
1488 // Code relies on these being in top-right-bottom-left order.
1489 eCSSProperty_border_top_style,
1490 eCSSProperty_border_right_style_value,
1491 eCSSProperty_border_bottom_style,
1492 eCSSProperty_border_left_style_value,
1493 // extras:
1494 eCSSProperty_border_left_style_ltr_source,
1495 eCSSProperty_border_left_style_rtl_source,
1496 eCSSProperty_border_right_style_ltr_source,
1497 eCSSProperty_border_right_style_rtl_source,
1498 eCSSProperty_UNKNOWN
1501 static const nsCSSProperty gBorderLeftStyleSubpropTable[] = {
1502 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1503 eCSSProperty_border_left_style_value,
1504 eCSSProperty_border_left_style_ltr_source,
1505 eCSSProperty_border_left_style_rtl_source,
1506 eCSSProperty_UNKNOWN
1509 static const nsCSSProperty gBorderRightStyleSubpropTable[] = {
1510 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1511 eCSSProperty_border_right_style_value,
1512 eCSSProperty_border_right_style_ltr_source,
1513 eCSSProperty_border_right_style_rtl_source,
1514 eCSSProperty_UNKNOWN
1517 static const nsCSSProperty gMozBorderStartStyleSubpropTable[] = {
1518 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1519 eCSSProperty_border_start_style_value,
1520 eCSSProperty_border_left_style_ltr_source,
1521 eCSSProperty_border_right_style_rtl_source,
1522 eCSSProperty_UNKNOWN
1525 static const nsCSSProperty gMozBorderEndStyleSubpropTable[] = {
1526 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1527 eCSSProperty_border_end_style_value,
1528 eCSSProperty_border_right_style_ltr_source,
1529 eCSSProperty_border_left_style_rtl_source,
1530 eCSSProperty_UNKNOWN
1533 static const nsCSSProperty gBorderTopSubpropTable[] = {
1534 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1535 eCSSProperty_border_top_width,
1536 eCSSProperty_border_top_style,
1537 eCSSProperty_border_top_color,
1538 eCSSProperty_UNKNOWN
1541 static const nsCSSProperty gBorderWidthSubpropTable[] = {
1542 // Code relies on these being in top-right-bottom-left order.
1543 eCSSProperty_border_top_width,
1544 eCSSProperty_border_right_width_value,
1545 eCSSProperty_border_bottom_width,
1546 eCSSProperty_border_left_width_value,
1547 // extras:
1548 eCSSProperty_border_left_width_ltr_source,
1549 eCSSProperty_border_left_width_rtl_source,
1550 eCSSProperty_border_right_width_ltr_source,
1551 eCSSProperty_border_right_width_rtl_source,
1552 eCSSProperty_UNKNOWN
1555 static const nsCSSProperty gBorderLeftWidthSubpropTable[] = {
1556 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1557 eCSSProperty_border_left_width_value,
1558 eCSSProperty_border_left_width_ltr_source,
1559 eCSSProperty_border_left_width_rtl_source,
1560 eCSSProperty_UNKNOWN
1563 static const nsCSSProperty gBorderRightWidthSubpropTable[] = {
1564 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1565 eCSSProperty_border_right_width_value,
1566 eCSSProperty_border_right_width_ltr_source,
1567 eCSSProperty_border_right_width_rtl_source,
1568 eCSSProperty_UNKNOWN
1571 static const nsCSSProperty gMozBorderStartWidthSubpropTable[] = {
1572 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1573 eCSSProperty_border_start_width_value,
1574 eCSSProperty_border_left_width_ltr_source,
1575 eCSSProperty_border_right_width_rtl_source,
1576 eCSSProperty_UNKNOWN
1579 static const nsCSSProperty gMozBorderEndWidthSubpropTable[] = {
1580 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1581 eCSSProperty_border_end_width_value,
1582 eCSSProperty_border_right_width_ltr_source,
1583 eCSSProperty_border_left_width_rtl_source,
1584 eCSSProperty_UNKNOWN
1587 static const nsCSSProperty gCueSubpropTable[] = {
1588 eCSSProperty_cue_after,
1589 eCSSProperty_cue_before,
1590 eCSSProperty_UNKNOWN
1593 static const nsCSSProperty gFontSubpropTable[] = {
1594 eCSSProperty_font_family,
1595 eCSSProperty_font_style,
1596 eCSSProperty_font_variant,
1597 eCSSProperty_font_weight,
1598 eCSSProperty_font_size,
1599 eCSSProperty_line_height,
1600 eCSSProperty_font_size_adjust, // XXX Added LDB.
1601 eCSSProperty_font_stretch, // XXX Added LDB.
1602 eCSSProperty__x_system_font,
1603 eCSSProperty_UNKNOWN
1606 static const nsCSSProperty gListStyleSubpropTable[] = {
1607 eCSSProperty_list_style_type,
1608 eCSSProperty_list_style_image,
1609 eCSSProperty_list_style_position,
1610 eCSSProperty_UNKNOWN
1613 static const nsCSSProperty gMarginSubpropTable[] = {
1614 // Code relies on these being in top-right-bottom-left order.
1615 eCSSProperty_margin_top,
1616 eCSSProperty_margin_right_value,
1617 eCSSProperty_margin_bottom,
1618 eCSSProperty_margin_left_value,
1619 // extras:
1620 eCSSProperty_margin_left_ltr_source,
1621 eCSSProperty_margin_left_rtl_source,
1622 eCSSProperty_margin_right_ltr_source,
1623 eCSSProperty_margin_right_rtl_source,
1624 eCSSProperty_UNKNOWN
1627 static const nsCSSProperty gMarginLeftSubpropTable[] = {
1628 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1629 eCSSProperty_margin_left_value,
1630 eCSSProperty_margin_left_ltr_source,
1631 eCSSProperty_margin_left_rtl_source,
1632 eCSSProperty_UNKNOWN
1635 static const nsCSSProperty gMarginRightSubpropTable[] = {
1636 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1637 eCSSProperty_margin_right_value,
1638 eCSSProperty_margin_right_ltr_source,
1639 eCSSProperty_margin_right_rtl_source,
1640 eCSSProperty_UNKNOWN
1643 static const nsCSSProperty gMozMarginStartSubpropTable[] = {
1644 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1645 eCSSProperty_margin_start_value,
1646 eCSSProperty_margin_left_ltr_source,
1647 eCSSProperty_margin_right_rtl_source,
1648 eCSSProperty_UNKNOWN
1651 static const nsCSSProperty gMozMarginEndSubpropTable[] = {
1652 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1653 eCSSProperty_margin_end_value,
1654 eCSSProperty_margin_right_ltr_source,
1655 eCSSProperty_margin_left_rtl_source,
1656 eCSSProperty_UNKNOWN
1660 static const nsCSSProperty gOutlineSubpropTable[] = {
1661 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1662 eCSSProperty_outline_color,
1663 eCSSProperty_outline_style,
1664 eCSSProperty_outline_width,
1665 eCSSProperty_UNKNOWN
1668 static const nsCSSProperty gMozColumnRuleSubpropTable[] = {
1669 eCSSProperty__moz_column_rule_width,
1670 eCSSProperty__moz_column_rule_style,
1671 eCSSProperty__moz_column_rule_color,
1672 eCSSProperty_UNKNOWN
1675 static const nsCSSProperty gOverflowSubpropTable[] = {
1676 eCSSProperty_overflow_x,
1677 eCSSProperty_overflow_y,
1678 eCSSProperty_UNKNOWN
1681 static const nsCSSProperty gPaddingSubpropTable[] = {
1682 // Code relies on these being in top-right-bottom-left order.
1683 eCSSProperty_padding_top,
1684 eCSSProperty_padding_right_value,
1685 eCSSProperty_padding_bottom,
1686 eCSSProperty_padding_left_value,
1687 // extras:
1688 eCSSProperty_padding_left_ltr_source,
1689 eCSSProperty_padding_left_rtl_source,
1690 eCSSProperty_padding_right_ltr_source,
1691 eCSSProperty_padding_right_rtl_source,
1692 eCSSProperty_UNKNOWN
1695 static const nsCSSProperty gPaddingLeftSubpropTable[] = {
1696 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1697 eCSSProperty_padding_left_value,
1698 eCSSProperty_padding_left_ltr_source,
1699 eCSSProperty_padding_left_rtl_source,
1700 eCSSProperty_UNKNOWN
1703 static const nsCSSProperty gPaddingRightSubpropTable[] = {
1704 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1705 eCSSProperty_padding_right_value,
1706 eCSSProperty_padding_right_ltr_source,
1707 eCSSProperty_padding_right_rtl_source,
1708 eCSSProperty_UNKNOWN
1711 static const nsCSSProperty gMozPaddingStartSubpropTable[] = {
1712 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1713 eCSSProperty_padding_start_value,
1714 eCSSProperty_padding_left_ltr_source,
1715 eCSSProperty_padding_right_rtl_source,
1716 eCSSProperty_UNKNOWN
1719 static const nsCSSProperty gMozPaddingEndSubpropTable[] = {
1720 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1721 eCSSProperty_padding_end_value,
1722 eCSSProperty_padding_right_ltr_source,
1723 eCSSProperty_padding_left_rtl_source,
1724 eCSSProperty_UNKNOWN
1727 static const nsCSSProperty gPauseSubpropTable[] = {
1728 eCSSProperty_pause_after,
1729 eCSSProperty_pause_before,
1730 eCSSProperty_UNKNOWN
1733 #ifdef MOZ_SVG
1734 static const nsCSSProperty gMarkerSubpropTable[] = {
1735 eCSSProperty_marker_start,
1736 eCSSProperty_marker_mid,
1737 eCSSProperty_marker_end,
1738 eCSSProperty_UNKNOWN
1740 #endif
1742 const nsCSSProperty *const
1743 nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = {
1744 #define CSS_PROP_SHORTHAND(name_, id_, method_) g##method_##SubpropTable,
1745 #include "nsCSSPropList.h"
1746 #undef CSS_PROP_SHORTHAND