Bug 439354 - OS X toolbar background doesn't have a good gradient. Part 1 (widget...
[mozilla-central.git] / layout / style / nsCSSProps.cpp
blob08ecc5f8c05fe76385f384f9db6ed9d748cd2de6
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::kBackgroundColorKTable[] = {
359 eCSSKeyword_transparent, NS_STYLE_BG_COLOR_TRANSPARENT,
360 eCSSKeyword_UNKNOWN,-1
363 const PRInt32 nsCSSProps::kBackgroundClipKTable[] = {
364 eCSSKeyword_border, NS_STYLE_BG_CLIP_BORDER,
365 eCSSKeyword_padding, NS_STYLE_BG_CLIP_PADDING,
366 eCSSKeyword_UNKNOWN,-1
369 const PRInt32 nsCSSProps::kBackgroundInlinePolicyKTable[] = {
370 eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX,
371 eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS,
372 eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX,
373 eCSSKeyword_UNKNOWN,-1
376 const PRInt32 nsCSSProps::kBackgroundOriginKTable[] = {
377 eCSSKeyword_border, NS_STYLE_BG_ORIGIN_BORDER,
378 eCSSKeyword_padding, NS_STYLE_BG_ORIGIN_PADDING,
379 eCSSKeyword_content, NS_STYLE_BG_ORIGIN_CONTENT,
380 eCSSKeyword_UNKNOWN,-1
383 // Note: Don't change this table unless you update
384 // parseBackgroundPosition!
386 const PRInt32 nsCSSProps::kBackgroundPositionKTable[] = {
387 eCSSKeyword_center, NS_STYLE_BG_POSITION_CENTER,
388 eCSSKeyword_top, NS_STYLE_BG_POSITION_TOP,
389 eCSSKeyword_bottom, NS_STYLE_BG_POSITION_BOTTOM,
390 eCSSKeyword_left, NS_STYLE_BG_POSITION_LEFT,
391 eCSSKeyword_right, NS_STYLE_BG_POSITION_RIGHT,
392 eCSSKeyword_UNKNOWN,-1
395 const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
396 eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_OFF,
397 eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_XY,
398 eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_X,
399 eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_Y,
400 eCSSKeyword_UNKNOWN,-1
403 const PRInt32 nsCSSProps::kBorderCollapseKTable[] = {
404 eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE,
405 eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE,
406 eCSSKeyword_UNKNOWN,-1
409 const PRInt32 nsCSSProps::kBorderColorKTable[] = {
410 eCSSKeyword_transparent, NS_STYLE_COLOR_TRANSPARENT,
411 eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
412 eCSSKeyword_UNKNOWN,-1
415 const PRInt32 nsCSSProps::kBorderImageKTable[] = {
416 eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_STRETCH,
417 eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT,
418 eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_ROUND,
419 eCSSKeyword_UNKNOWN,-1
422 const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
423 eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN,
424 eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
425 eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
426 eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
427 eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
428 eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
429 eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
430 eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
431 eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
432 eCSSKeyword_UNKNOWN,-1
435 const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
436 eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
437 eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
438 eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
439 eCSSKeyword_UNKNOWN,-1
442 const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
443 eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL,
444 eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL,
445 eCSSKeyword_UNKNOWN,-1
448 const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
449 eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT,
450 eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER,
451 eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING,
452 eCSSKeyword_UNKNOWN,-1
455 const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
456 eCSSKeyword_top, NS_STYLE_CAPTION_SIDE_TOP,
457 eCSSKeyword_right, NS_STYLE_CAPTION_SIDE_RIGHT,
458 eCSSKeyword_bottom, NS_STYLE_CAPTION_SIDE_BOTTOM,
459 eCSSKeyword_left, NS_STYLE_CAPTION_SIDE_LEFT,
460 eCSSKeyword_top_outside, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE,
461 eCSSKeyword_bottom_outside, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
462 eCSSKeyword_UNKNOWN, -1
465 const PRInt32 nsCSSProps::kClearKTable[] = {
466 eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
467 eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
468 eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
469 eCSSKeyword_UNKNOWN,-1
472 const PRInt32 nsCSSProps::kColorKTable[] = {
473 eCSSKeyword_activeborder, nsILookAndFeel::eColor_activeborder,
474 eCSSKeyword_activecaption, nsILookAndFeel::eColor_activecaption,
475 eCSSKeyword_appworkspace, nsILookAndFeel::eColor_appworkspace,
476 eCSSKeyword_background, nsILookAndFeel::eColor_background,
477 eCSSKeyword_buttonface, nsILookAndFeel::eColor_buttonface,
478 eCSSKeyword_buttonhighlight, nsILookAndFeel::eColor_buttonhighlight,
479 eCSSKeyword_buttonshadow, nsILookAndFeel::eColor_buttonshadow,
480 eCSSKeyword_buttontext, nsILookAndFeel::eColor_buttontext,
481 eCSSKeyword_captiontext, nsILookAndFeel::eColor_captiontext,
482 eCSSKeyword_graytext, nsILookAndFeel::eColor_graytext,
483 eCSSKeyword_highlight, nsILookAndFeel::eColor_highlight,
484 eCSSKeyword_highlighttext, nsILookAndFeel::eColor_highlighttext,
485 eCSSKeyword_inactiveborder, nsILookAndFeel::eColor_inactiveborder,
486 eCSSKeyword_inactivecaption, nsILookAndFeel::eColor_inactivecaption,
487 eCSSKeyword_inactivecaptiontext, nsILookAndFeel::eColor_inactivecaptiontext,
488 eCSSKeyword_infobackground, nsILookAndFeel::eColor_infobackground,
489 eCSSKeyword_infotext, nsILookAndFeel::eColor_infotext,
490 eCSSKeyword_menu, nsILookAndFeel::eColor_menu,
491 eCSSKeyword_menutext, nsILookAndFeel::eColor_menutext,
492 eCSSKeyword_scrollbar, nsILookAndFeel::eColor_scrollbar,
493 eCSSKeyword_threeddarkshadow, nsILookAndFeel::eColor_threeddarkshadow,
494 eCSSKeyword_threedface, nsILookAndFeel::eColor_threedface,
495 eCSSKeyword_threedhighlight, nsILookAndFeel::eColor_threedhighlight,
496 eCSSKeyword_threedlightshadow, nsILookAndFeel::eColor_threedlightshadow,
497 eCSSKeyword_threedshadow, nsILookAndFeel::eColor_threedshadow,
498 eCSSKeyword_window, nsILookAndFeel::eColor_window,
499 eCSSKeyword_windowframe, nsILookAndFeel::eColor_windowframe,
500 eCSSKeyword_windowtext, nsILookAndFeel::eColor_windowtext,
501 eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT,
502 eCSSKeyword__moz_buttondefault, nsILookAndFeel::eColor__moz_buttondefault,
503 eCSSKeyword__moz_buttonhoverface, nsILookAndFeel::eColor__moz_buttonhoverface,
504 eCSSKeyword__moz_buttonhovertext, nsILookAndFeel::eColor__moz_buttonhovertext,
505 eCSSKeyword__moz_cellhighlight, nsILookAndFeel::eColor__moz_cellhighlight,
506 eCSSKeyword__moz_cellhighlighttext, nsILookAndFeel::eColor__moz_cellhighlighttext,
507 eCSSKeyword__moz_eventreerow, nsILookAndFeel::eColor__moz_eventreerow,
508 eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field,
509 eCSSKeyword__moz_fieldtext, nsILookAndFeel::eColor__moz_fieldtext,
510 eCSSKeyword__moz_dialog, nsILookAndFeel::eColor__moz_dialog,
511 eCSSKeyword__moz_dialogtext, nsILookAndFeel::eColor__moz_dialogtext,
512 eCSSKeyword__moz_dragtargetzone, nsILookAndFeel::eColor__moz_dragtargetzone,
513 eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT,
514 eCSSKeyword__moz_html_cellhighlight, nsILookAndFeel::eColor__moz_html_cellhighlight,
515 eCSSKeyword__moz_html_cellhighlighttext, nsILookAndFeel::eColor__moz_html_cellhighlighttext,
516 eCSSKeyword__moz_mac_focusring, nsILookAndFeel::eColor__moz_mac_focusring,
517 eCSSKeyword__moz_mac_menuselect, nsILookAndFeel::eColor__moz_mac_menuselect,
518 eCSSKeyword__moz_mac_menushadow, nsILookAndFeel::eColor__moz_mac_menushadow,
519 eCSSKeyword__moz_mac_menutextdisable, nsILookAndFeel::eColor__moz_mac_menutextdisable,
520 eCSSKeyword__moz_mac_menutextselect, nsILookAndFeel::eColor__moz_mac_menutextselect,
521 eCSSKeyword__moz_mac_accentlightesthighlight, nsILookAndFeel::eColor__moz_mac_accentlightesthighlight,
522 eCSSKeyword__moz_mac_accentregularhighlight, nsILookAndFeel::eColor__moz_mac_accentregularhighlight,
523 eCSSKeyword__moz_mac_accentface, nsILookAndFeel::eColor__moz_mac_accentface,
524 eCSSKeyword__moz_mac_accentlightshadow, nsILookAndFeel::eColor__moz_mac_accentlightshadow,
525 eCSSKeyword__moz_mac_accentregularshadow, nsILookAndFeel::eColor__moz_mac_accentregularshadow,
526 eCSSKeyword__moz_mac_accentdarkshadow, nsILookAndFeel::eColor__moz_mac_accentdarkshadow,
527 eCSSKeyword__moz_mac_accentdarkestshadow, nsILookAndFeel::eColor__moz_mac_accentdarkestshadow,
528 eCSSKeyword__moz_mac_alternateprimaryhighlight, nsILookAndFeel::eColor__moz_mac_alternateprimaryhighlight,
529 eCSSKeyword__moz_mac_secondaryhighlight, nsILookAndFeel::eColor__moz_mac_secondaryhighlight,
530 eCSSKeyword__moz_menuhover, nsILookAndFeel::eColor__moz_menuhover,
531 eCSSKeyword__moz_menuhovertext, nsILookAndFeel::eColor__moz_menuhovertext,
532 eCSSKeyword__moz_menubarhovertext, nsILookAndFeel::eColor__moz_menubarhovertext,
533 eCSSKeyword__moz_oddtreerow, nsILookAndFeel::eColor__moz_oddtreerow,
534 eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
535 eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR,
536 eCSSKeyword__moz_win_mediatext, nsILookAndFeel::eColor__moz_win_mediatext,
537 eCSSKeyword__moz_win_communicationstext, nsILookAndFeel::eColor__moz_win_communicationstext,
538 eCSSKeyword__moz_nativehyperlinktext, nsILookAndFeel::eColor__moz_nativehyperlinktext,
539 eCSSKeyword_UNKNOWN,-1
542 const PRInt32 nsCSSProps::kContentKTable[] = {
543 eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE,
544 eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
545 eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
546 eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
547 eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT,
548 eCSSKeyword_UNKNOWN,-1
551 const PRInt32 nsCSSProps::kCursorKTable[] = {
552 // CSS 2.0
553 eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR,
554 eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT,
555 eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER,
556 eCSSKeyword_move, NS_STYLE_CURSOR_MOVE,
557 eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE,
558 eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE,
559 eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE,
560 eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE,
561 eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE,
562 eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE,
563 eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE,
564 eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE,
565 eCSSKeyword_text, NS_STYLE_CURSOR_TEXT,
566 eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT,
567 eCSSKeyword_help, NS_STYLE_CURSOR_HELP,
568 // CSS 2.1
569 eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING,
570 // CSS3 basic user interface module
571 eCSSKeyword_copy, NS_STYLE_CURSOR_COPY,
572 eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS,
573 eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
574 eCSSKeyword_cell, NS_STYLE_CURSOR_CELL,
575 eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED,
576 eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE,
577 eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE,
578 eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP,
579 eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT,
580 eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL,
581 eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE,
582 eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE,
583 eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE,
584 eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE,
585 eCSSKeyword_none, NS_STYLE_CURSOR_NONE,
586 // -moz- prefixed aliases for some CSS3 cursors for backward compat
587 eCSSKeyword__moz_copy, NS_STYLE_CURSOR_COPY,
588 eCSSKeyword__moz_alias, NS_STYLE_CURSOR_ALIAS,
589 eCSSKeyword__moz_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
590 eCSSKeyword__moz_cell, NS_STYLE_CURSOR_CELL,
591 // -moz- prefixed vendor specific
592 eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB,
593 eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING,
594 eCSSKeyword__moz_spinning, NS_STYLE_CURSOR_SPINNING,
595 eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
596 eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
597 eCSSKeyword_UNKNOWN,-1
600 const PRInt32 nsCSSProps::kDirectionKTable[] = {
601 eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR,
602 eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL,
603 eCSSKeyword_UNKNOWN,-1
606 const PRInt32 nsCSSProps::kDisplayKTable[] = {
607 eCSSKeyword_inline, NS_STYLE_DISPLAY_INLINE,
608 eCSSKeyword_block, NS_STYLE_DISPLAY_BLOCK,
609 eCSSKeyword_inline_block, NS_STYLE_DISPLAY_INLINE_BLOCK,
610 eCSSKeyword_list_item, NS_STYLE_DISPLAY_LIST_ITEM,
611 eCSSKeyword__moz_run_in, NS_STYLE_DISPLAY_RUN_IN,
612 eCSSKeyword__moz_compact, NS_STYLE_DISPLAY_COMPACT,
613 eCSSKeyword__moz_marker, NS_STYLE_DISPLAY_MARKER,
614 eCSSKeyword_table, NS_STYLE_DISPLAY_TABLE,
615 eCSSKeyword_inline_table, NS_STYLE_DISPLAY_INLINE_TABLE,
616 eCSSKeyword_table_row_group, NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
617 eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
618 eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
619 eCSSKeyword_table_row, NS_STYLE_DISPLAY_TABLE_ROW,
620 eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
621 eCSSKeyword_table_column, NS_STYLE_DISPLAY_TABLE_COLUMN,
622 eCSSKeyword_table_cell, NS_STYLE_DISPLAY_TABLE_CELL,
623 eCSSKeyword_table_caption, NS_STYLE_DISPLAY_TABLE_CAPTION,
624 // Make sure this is kept in sync with the code in
625 // nsCSSFrameConstructor::ConstructXULFrame
626 eCSSKeyword__moz_box, NS_STYLE_DISPLAY_BOX,
627 eCSSKeyword__moz_inline_box, NS_STYLE_DISPLAY_INLINE_BOX,
628 #ifdef MOZ_XUL
629 eCSSKeyword__moz_grid, NS_STYLE_DISPLAY_GRID,
630 eCSSKeyword__moz_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID,
631 eCSSKeyword__moz_grid_group, NS_STYLE_DISPLAY_GRID_GROUP,
632 eCSSKeyword__moz_grid_line, NS_STYLE_DISPLAY_GRID_LINE,
633 eCSSKeyword__moz_stack, NS_STYLE_DISPLAY_STACK,
634 eCSSKeyword__moz_inline_stack, NS_STYLE_DISPLAY_INLINE_STACK,
635 eCSSKeyword__moz_deck, NS_STYLE_DISPLAY_DECK,
636 eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP,
637 eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX,
638 #endif
639 eCSSKeyword_UNKNOWN,-1
642 const PRInt32 nsCSSProps::kElevationKTable[] = {
643 eCSSKeyword_below, NS_STYLE_ELEVATION_BELOW,
644 eCSSKeyword_level, NS_STYLE_ELEVATION_LEVEL,
645 eCSSKeyword_above, NS_STYLE_ELEVATION_ABOVE,
646 eCSSKeyword_higher, NS_STYLE_ELEVATION_HIGHER,
647 eCSSKeyword_lower, NS_STYLE_ELEVATION_LOWER,
648 eCSSKeyword_UNKNOWN,-1
651 const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
652 eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
653 eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
654 eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
655 eCSSKeyword_UNKNOWN,-1
658 const PRInt32 nsCSSProps::kFloatKTable[] = {
659 eCSSKeyword_left, NS_STYLE_FLOAT_LEFT,
660 eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
661 eCSSKeyword_UNKNOWN,-1
664 const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
665 eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT,
666 eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN,
667 eCSSKeyword_UNKNOWN,-1
670 const PRInt32 nsCSSProps::kFontKTable[] = {
671 // CSS2.
672 eCSSKeyword_caption, NS_STYLE_FONT_CAPTION,
673 eCSSKeyword_icon, NS_STYLE_FONT_ICON,
674 eCSSKeyword_menu, NS_STYLE_FONT_MENU,
675 eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX,
676 eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION,
677 eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR,
679 // Proposed for CSS3.
680 eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW,
681 eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT,
682 eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE,
683 eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP,
684 eCSSKeyword__moz_info, NS_STYLE_FONT_INFO,
685 eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG,
686 eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON,
687 eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
688 eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
689 eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
690 eCSSKeyword_UNKNOWN,-1
693 const PRInt32 nsCSSProps::kFontSizeKTable[] = {
694 eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL,
695 eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL,
696 eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL,
697 eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM,
698 eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE,
699 eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE,
700 eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
701 eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
702 eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
703 eCSSKeyword_UNKNOWN,-1
706 const PRInt32 nsCSSProps::kFontStretchKTable[] = {
707 eCSSKeyword_wider, NS_STYLE_FONT_STRETCH_WIDER,
708 eCSSKeyword_narrower, NS_STYLE_FONT_STRETCH_NARROWER,
709 eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED,
710 eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED,
711 eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED,
712 eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED,
713 eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED,
714 eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
715 eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
716 eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
717 eCSSKeyword_UNKNOWN,-1
720 const PRInt32 nsCSSProps::kFontStyleKTable[] = {
721 eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
722 eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
723 eCSSKeyword_UNKNOWN,-1
726 const PRInt32 nsCSSProps::kFontVariantKTable[] = {
727 eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
728 eCSSKeyword_UNKNOWN,-1
731 const PRInt32 nsCSSProps::kFontWeightKTable[] = {
732 eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
733 eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
734 eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
735 eCSSKeyword_UNKNOWN,-1
738 const PRInt32 nsCSSProps::kIMEModeKTable[] = {
739 eCSSKeyword_active, NS_STYLE_IME_MODE_ACTIVE,
740 eCSSKeyword_disabled, NS_STYLE_IME_MODE_DISABLED,
741 eCSSKeyword_inactive, NS_STYLE_IME_MODE_INACTIVE,
742 eCSSKeyword_UNKNOWN,-1
745 // XXX What's the point?
746 const PRInt32 nsCSSProps::kKeyEquivalentKTable[] = {
747 eCSSKeyword_UNKNOWN,-1
750 const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
751 eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
752 eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
753 eCSSKeyword_UNKNOWN,-1
756 const PRInt32 nsCSSProps::kListStyleKTable[] = {
757 eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC,
758 eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE,
759 eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE,
760 eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL,
761 eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO,
762 eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN,
763 eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN,
764 eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK,
765 eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA,
766 eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN,
767 eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA,
768 eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN,
769 eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW,
770 eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN,
771 eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN,
772 eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC,
773 eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA,
774 eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA,
775 eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA,
776 eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA,
777 eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM,
778 eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH,
779 eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL,
780 eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL,
781 eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL,
782 eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL,
783 eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL,
784 eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL,
785 eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC,
786 eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN,
787 eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU,
788 eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI,
789 eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI,
790 eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI,
791 eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA,
792 eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA,
793 eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM,
794 eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI,
795 eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL,
796 eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU,
797 eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI,
798 eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO,
799 eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR,
800 eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER,
801 eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL,
802 eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT,
803 eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME,
804 eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC,
805 eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
806 eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
807 eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
808 eCSSKeyword_UNKNOWN,-1
811 // Same as kBorderStyleKTable except 'hidden'.
812 const PRInt32 nsCSSProps::kOutlineStyleKTable[] = {
813 eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
814 eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
815 eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
816 eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
817 eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
818 eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
819 eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
820 eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
821 eCSSKeyword_UNKNOWN,-1
824 const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
825 #ifdef GFX_HAS_INVERT
826 eCSSKeyword_invert, NS_STYLE_COLOR_INVERT,
827 #else
828 eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
829 #endif
830 eCSSKeyword_UNKNOWN,-1
833 const PRInt32 nsCSSProps::kOverflowKTable[] = {
834 eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
835 eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
836 eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
837 // Deprecated:
838 eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
839 eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
840 eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
841 eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
842 eCSSKeyword_UNKNOWN,-1
845 const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
846 eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
847 eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
848 eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
849 // Deprecated:
850 eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
851 eCSSKeyword_UNKNOWN,-1
854 const PRInt32 nsCSSProps::kPageBreakKTable[] = {
855 eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
856 eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
857 eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
858 eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
859 eCSSKeyword_UNKNOWN,-1
862 const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
863 eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
864 eCSSKeyword_UNKNOWN,-1
867 const PRInt32 nsCSSProps::kPageMarksKTable[] = {
868 eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
869 eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
870 eCSSKeyword_UNKNOWN,-1
873 const PRInt32 nsCSSProps::kPageSizeKTable[] = {
874 eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
875 eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
876 eCSSKeyword_UNKNOWN,-1
879 const PRInt32 nsCSSProps::kPitchKTable[] = {
880 eCSSKeyword_x_low, NS_STYLE_PITCH_X_LOW,
881 eCSSKeyword_low, NS_STYLE_PITCH_LOW,
882 eCSSKeyword_medium, NS_STYLE_PITCH_MEDIUM,
883 eCSSKeyword_high, NS_STYLE_PITCH_HIGH,
884 eCSSKeyword_x_high, NS_STYLE_PITCH_X_HIGH,
885 eCSSKeyword_UNKNOWN,-1
888 const PRInt32 nsCSSProps::kPositionKTable[] = {
889 eCSSKeyword_static, NS_STYLE_POSITION_STATIC,
890 eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
891 eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
892 eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
893 eCSSKeyword_UNKNOWN,-1
896 const PRInt32 nsCSSProps::kSpeakKTable[] = {
897 eCSSKeyword_spell_out, NS_STYLE_SPEAK_SPELL_OUT,
898 eCSSKeyword_UNKNOWN,-1
901 const PRInt32 nsCSSProps::kSpeakHeaderKTable[] = {
902 eCSSKeyword_once, NS_STYLE_SPEAK_HEADER_ONCE,
903 eCSSKeyword_always, NS_STYLE_SPEAK_HEADER_ALWAYS,
904 eCSSKeyword_UNKNOWN,-1
907 const PRInt32 nsCSSProps::kSpeakNumeralKTable[] = {
908 eCSSKeyword_digits, NS_STYLE_SPEAK_NUMERAL_DIGITS,
909 eCSSKeyword_continuous, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS,
910 eCSSKeyword_UNKNOWN,-1
913 const PRInt32 nsCSSProps::kSpeakPunctuationKTable[] = {
914 eCSSKeyword_code, NS_STYLE_SPEAK_PUNCTUATION_CODE,
915 eCSSKeyword_UNKNOWN,-1
918 const PRInt32 nsCSSProps::kSpeechRateKTable[] = {
919 eCSSKeyword_x_slow, NS_STYLE_SPEECH_RATE_X_SLOW,
920 eCSSKeyword_slow, NS_STYLE_SPEECH_RATE_SLOW,
921 eCSSKeyword_medium, NS_STYLE_SPEECH_RATE_MEDIUM,
922 eCSSKeyword_fast, NS_STYLE_SPEECH_RATE_FAST,
923 eCSSKeyword_x_fast, NS_STYLE_SPEECH_RATE_X_FAST,
924 eCSSKeyword_faster, NS_STYLE_SPEECH_RATE_FASTER,
925 eCSSKeyword_slower, NS_STYLE_SPEECH_RATE_SLOWER,
926 eCSSKeyword_UNKNOWN,-1
929 const PRInt32 nsCSSProps::kStackSizingKTable[] = {
930 eCSSKeyword_ignore, NS_STYLE_STACK_SIZING_IGNORE,
931 eCSSKeyword_stretch_to_fit, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT,
932 eCSSKeyword_UNKNOWN,-1
935 const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
936 eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
937 eCSSKeyword_UNKNOWN,-1
940 const PRInt32 nsCSSProps::kTextAlignKTable[] = {
941 eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
942 eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
943 eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
944 eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
945 eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
946 eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
947 eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT,
948 eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
949 eCSSKeyword_UNKNOWN,-1
952 const PRInt32 nsCSSProps::kTextDecorationKTable[] = {
953 eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_UNDERLINE,
954 eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_OVERLINE,
955 eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_THROUGH,
956 eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_BLINK,
957 eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS,
958 eCSSKeyword_UNKNOWN,-1
961 const PRInt32 nsCSSProps::kTextTransformKTable[] = {
962 eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
963 eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
964 eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
965 eCSSKeyword_UNKNOWN,-1
968 const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
969 eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
970 eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
971 eCSSKeyword_UNKNOWN,-1
974 const PRInt32 nsCSSProps::kUserFocusKTable[] = {
975 eCSSKeyword_ignore, NS_STYLE_USER_FOCUS_IGNORE,
976 eCSSKeyword_select_all, NS_STYLE_USER_FOCUS_SELECT_ALL,
977 eCSSKeyword_select_before, NS_STYLE_USER_FOCUS_SELECT_BEFORE,
978 eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER,
979 eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME,
980 eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU,
981 eCSSKeyword_UNKNOWN,-1
984 const PRInt32 nsCSSProps::kUserInputKTable[] = {
985 eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED,
986 eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
987 eCSSKeyword_UNKNOWN,-1
990 const PRInt32 nsCSSProps::kUserModifyKTable[] = {
991 eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY,
992 eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
993 eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
994 eCSSKeyword_UNKNOWN,-1
997 const PRInt32 nsCSSProps::kUserSelectKTable[] = {
998 eCSSKeyword_text, NS_STYLE_USER_SELECT_TEXT,
999 eCSSKeyword_element, NS_STYLE_USER_SELECT_ELEMENT,
1000 eCSSKeyword_elements, NS_STYLE_USER_SELECT_ELEMENTS,
1001 eCSSKeyword_all, NS_STYLE_USER_SELECT_ALL,
1002 eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE,
1003 eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE,
1004 eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL,
1005 eCSSKeyword__moz_none, NS_STYLE_USER_SELECT_MOZ_NONE,
1006 eCSSKeyword_UNKNOWN,-1
1009 const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
1010 eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE,
1011 eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB,
1012 eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER,
1013 eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP,
1014 eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP,
1015 eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
1016 eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE,
1017 eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
1018 eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
1019 eCSSKeyword_UNKNOWN,-1
1022 const PRInt32 nsCSSProps::kVisibilityKTable[] = {
1023 eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
1024 eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
1025 eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
1026 eCSSKeyword_UNKNOWN,-1
1029 const PRInt32 nsCSSProps::kVolumeKTable[] = {
1030 eCSSKeyword_silent, NS_STYLE_VOLUME_SILENT,
1031 eCSSKeyword_x_soft, NS_STYLE_VOLUME_X_SOFT,
1032 eCSSKeyword_soft, NS_STYLE_VOLUME_SOFT,
1033 eCSSKeyword_medium, NS_STYLE_VOLUME_MEDIUM,
1034 eCSSKeyword_loud, NS_STYLE_VOLUME_LOUD,
1035 eCSSKeyword_x_loud, NS_STYLE_VOLUME_X_LOUD,
1036 eCSSKeyword_UNKNOWN,-1
1039 const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
1040 eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
1041 eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
1042 eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP,
1043 eCSSKeyword__moz_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP,
1044 eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE,
1045 eCSSKeyword_UNKNOWN,-1
1048 const PRInt32 nsCSSProps::kWidthKTable[] = {
1049 eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT,
1050 eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT,
1051 eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT,
1052 eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE,
1053 eCSSKeyword_UNKNOWN,-1
1056 const PRInt32 nsCSSProps::kWordwrapKTable[] = {
1057 eCSSKeyword_normal, NS_STYLE_WORDWRAP_NORMAL,
1058 eCSSKeyword_break_word, NS_STYLE_WORDWRAP_BREAK_WORD,
1059 eCSSKeyword_UNKNOWN,-1
1062 // Specific keyword tables for XUL.properties
1063 const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
1064 eCSSKeyword_stretch, NS_STYLE_BOX_ALIGN_STRETCH,
1065 eCSSKeyword_start, NS_STYLE_BOX_ALIGN_START,
1066 eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
1067 eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE,
1068 eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END,
1069 eCSSKeyword_UNKNOWN,-1
1072 const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
1073 eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL,
1074 eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE,
1075 eCSSKeyword_UNKNOWN,-1
1078 const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
1079 eCSSKeyword_horizontal, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1080 eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL,
1081 eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1082 eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL,
1083 eCSSKeyword_UNKNOWN,-1
1086 const PRInt32 nsCSSProps::kBoxPackKTable[] = {
1087 eCSSKeyword_start, NS_STYLE_BOX_PACK_START,
1088 eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER,
1089 eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
1090 eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY,
1091 eCSSKeyword_UNKNOWN,-1
1094 #ifdef MOZ_SVG
1095 // keyword tables for SVG properties
1097 const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
1098 eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT,
1099 eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE,
1100 eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE,
1101 eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC,
1102 eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING,
1103 eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC,
1104 eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL,
1105 eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL,
1106 eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
1107 eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
1108 eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
1109 eCSSKeyword_UNKNOWN, -1
1112 const PRInt32 nsCSSProps::kFillRuleKTable[] = {
1113 eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
1114 eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
1115 eCSSKeyword_UNKNOWN, -1
1118 const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
1119 eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
1120 eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
1121 eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
1122 eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
1123 eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
1124 eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
1125 eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
1126 eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
1127 eCSSKeyword_UNKNOWN, -1
1130 const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
1131 eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
1132 eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
1133 eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
1134 eCSSKeyword_UNKNOWN, -1
1137 const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
1138 eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
1139 eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
1140 eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
1141 eCSSKeyword_UNKNOWN, -1
1144 const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
1145 eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
1146 eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
1147 eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
1148 eCSSKeyword_UNKNOWN, -1
1151 const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
1152 eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
1153 eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
1154 eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
1155 eCSSKeyword_UNKNOWN, -1
1158 const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
1159 eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
1160 eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
1161 eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
1162 eCSSKeyword_UNKNOWN, -1
1165 const PRInt32 nsCSSProps::kColorInterpolationKTable[] = {
1166 eCSSKeyword_srgb, NS_STYLE_COLOR_INTERPOLATION_SRGB,
1167 eCSSKeyword_linearrgb, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB,
1168 eCSSKeyword_UNKNOWN, -1
1171 #endif
1173 PRBool
1174 nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
1176 PRInt32 index = 0;
1177 while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
1178 if (aKeyword == nsCSSKeyword(aTable[index])) {
1179 aResult = aTable[index+1];
1180 return PR_TRUE;
1182 index += 2;
1184 return PR_FALSE;
1187 nsCSSKeyword
1188 nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
1190 PRInt32 i = 1;
1191 for (;;) {
1192 if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
1193 break;
1195 if (aValue == aTable[i]) {
1196 return nsCSSKeyword(aTable[i-1]);
1198 i += 2;
1200 return eCSSKeyword_UNKNOWN;
1203 const nsAFlatCString&
1204 nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
1206 nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
1207 if (keyword == eCSSKeyword_UNKNOWN) {
1208 static nsDependentCString sNullStr("");
1209 return sNullStr;
1210 } else {
1211 return nsCSSKeywords::GetStringValue(keyword);
1215 /* static */ const PRInt32* const
1216 nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = {
1217 #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) kwtable_,
1218 #include "nsCSSPropList.h"
1219 #undef CSS_PROP
1222 const nsAFlatCString&
1223 nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
1225 NS_ASSERTION(aProp >= 0 && aProp < eCSSProperty_COUNT, "property out of range");
1227 const PRInt32* kwtable = nsnull;
1228 if (aProp < eCSSProperty_COUNT_no_shorthands)
1229 kwtable = kKeywordTableTable[aProp];
1231 if (kwtable)
1232 return ValueToKeyword(aValue, kwtable);
1234 static nsDependentCString sNullStr("");
1235 return sNullStr;
1238 PRBool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
1240 PRBool rv = PR_FALSE;
1242 // first get the keyword corresponding to the property Value from the color table
1243 nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
1245 // next get the name as a string from the keywords table
1246 if (keyword != eCSSKeyword_UNKNOWN) {
1247 nsCSSKeywords::AddRefTable();
1248 aStr = nsCSSKeywords::GetStringValue(keyword);
1249 nsCSSKeywords::ReleaseTable();
1250 rv = PR_TRUE;
1252 return rv;
1255 // define array of all CSS property types
1256 const nsCSSType nsCSSProps::kTypeTable[eCSSProperty_COUNT_no_shorthands] = {
1257 #define CSS_PROP(name_, id_, method_, datastruct_, member_, type_, kwtable_) type_,
1258 #include "nsCSSPropList.h"
1259 #undef CSS_PROP
1262 const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = {
1263 #define CSS_PROP_FONT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Font,
1264 #define CSS_PROP_COLOR(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Color,
1265 #define CSS_PROP_BACKGROUND(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Background,
1266 #define CSS_PROP_LIST(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_List,
1267 #define CSS_PROP_POSITION(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Position,
1268 #define CSS_PROP_TEXT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Text,
1269 #define CSS_PROP_TEXTRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_TextReset,
1270 #define CSS_PROP_DISPLAY(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Display,
1271 #define CSS_PROP_VISIBILITY(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Visibility,
1272 #define CSS_PROP_CONTENT(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Content,
1273 #define CSS_PROP_QUOTES(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Quotes,
1274 #define CSS_PROP_USERINTERFACE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_UserInterface,
1275 #define CSS_PROP_UIRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_UIReset,
1276 #define CSS_PROP_TABLE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Table,
1277 #define CSS_PROP_TABLEBORDER(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_TableBorder,
1278 #define CSS_PROP_MARGIN(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Margin,
1279 #define CSS_PROP_PADDING(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Padding,
1280 #define CSS_PROP_BORDER(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Border,
1281 #define CSS_PROP_OUTLINE(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Outline,
1282 #define CSS_PROP_XUL(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_XUL,
1283 #define CSS_PROP_SVG(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVG,
1284 #define CSS_PROP_SVGRESET(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVGReset,
1285 #define CSS_PROP_COLUMN(name_, id_, method_, datastruct_, member_, type_, kwtable_) eStyleStruct_Column,
1286 // This shouldn't matter, but we need something to go here.
1287 #define CSS_PROP_BACKENDONLY(name_, id_, method_, datastruct_, member_, type_, kwtable_) nsStyleStructID(-1),
1289 #include "nsCSSPropList.h"
1291 #undef CSS_PROP_FONT
1292 #undef CSS_PROP_COLOR
1293 #undef CSS_PROP_BACKGROUND
1294 #undef CSS_PROP_LIST
1295 #undef CSS_PROP_POSITION
1296 #undef CSS_PROP_TEXT
1297 #undef CSS_PROP_TEXTRESET
1298 #undef CSS_PROP_DISPLAY
1299 #undef CSS_PROP_VISIBILITY
1300 #undef CSS_PROP_CONTENT
1301 #undef CSS_PROP_QUOTES
1302 #undef CSS_PROP_USERINTERFACE
1303 #undef CSS_PROP_UIRESET
1304 #undef CSS_PROP_TABLE
1305 #undef CSS_PROP_TABLEBORDER
1306 #undef CSS_PROP_MARGIN
1307 #undef CSS_PROP_PADDING
1308 #undef CSS_PROP_BORDER
1309 #undef CSS_PROP_OUTLINE
1310 #undef CSS_PROP_XUL
1311 #undef CSS_PROP_SVG
1312 #undef CSS_PROP_SVGRESET
1313 #undef CSS_PROP_COLUMN
1314 #undef CSS_PROP_BACKENDONLY
1317 static const nsCSSProperty gMozBorderRadiusSubpropTable[] = {
1318 // Code relies on these being in topleft-topright-bottomright-bottomleft
1319 // order.
1320 eCSSProperty__moz_border_radius_topLeft,
1321 eCSSProperty__moz_border_radius_topRight,
1322 eCSSProperty__moz_border_radius_bottomRight,
1323 eCSSProperty__moz_border_radius_bottomLeft,
1324 eCSSProperty_UNKNOWN
1327 static const nsCSSProperty gMozOutlineRadiusSubpropTable[] = {
1328 // Code relies on these being in topleft-topright-bottomright-bottomleft
1329 // order.
1330 eCSSProperty__moz_outline_radius_topLeft,
1331 eCSSProperty__moz_outline_radius_topRight,
1332 eCSSProperty__moz_outline_radius_bottomRight,
1333 eCSSProperty__moz_outline_radius_bottomLeft,
1334 eCSSProperty_UNKNOWN
1337 static const nsCSSProperty gBackgroundSubpropTable[] = {
1338 eCSSProperty_background_color,
1339 eCSSProperty_background_image,
1340 eCSSProperty_background_repeat,
1341 eCSSProperty_background_attachment,
1342 eCSSProperty_background_position,
1343 eCSSProperty__moz_background_clip, // XXX Added LDB.
1344 eCSSProperty__moz_background_origin, // XXX Added LDB.
1345 eCSSProperty__moz_background_inline_policy, // XXX Added LDB.
1346 eCSSProperty_UNKNOWN
1349 static const nsCSSProperty gBorderSubpropTable[] = {
1350 eCSSProperty_border_top_width,
1351 eCSSProperty_border_right_width_value,
1352 eCSSProperty_border_right_width_ltr_source,
1353 eCSSProperty_border_right_width_rtl_source,
1354 eCSSProperty_border_bottom_width,
1355 eCSSProperty_border_left_width_value,
1356 eCSSProperty_border_left_width_ltr_source,
1357 eCSSProperty_border_left_width_rtl_source,
1358 eCSSProperty_border_top_style,
1359 eCSSProperty_border_right_style_value,
1360 eCSSProperty_border_right_style_ltr_source,
1361 eCSSProperty_border_right_style_rtl_source,
1362 eCSSProperty_border_bottom_style,
1363 eCSSProperty_border_left_style_value,
1364 eCSSProperty_border_left_style_ltr_source,
1365 eCSSProperty_border_left_style_rtl_source,
1366 eCSSProperty_border_top_color,
1367 eCSSProperty_border_right_color_value,
1368 eCSSProperty_border_right_color_ltr_source,
1369 eCSSProperty_border_right_color_rtl_source,
1370 eCSSProperty_border_bottom_color,
1371 eCSSProperty_border_left_color_value,
1372 eCSSProperty_border_left_color_ltr_source,
1373 eCSSProperty_border_left_color_rtl_source,
1374 eCSSProperty_UNKNOWN
1377 static const nsCSSProperty gBorderBottomSubpropTable[] = {
1378 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1379 eCSSProperty_border_bottom_width,
1380 eCSSProperty_border_bottom_style,
1381 eCSSProperty_border_bottom_color,
1382 eCSSProperty_UNKNOWN
1385 static const nsCSSProperty gBorderColorSubpropTable[] = {
1386 // Code relies on these being in top-right-bottom-left order.
1387 eCSSProperty_border_top_color,
1388 eCSSProperty_border_right_color_value,
1389 eCSSProperty_border_bottom_color,
1390 eCSSProperty_border_left_color_value,
1391 // extras:
1392 eCSSProperty_border_left_color_ltr_source,
1393 eCSSProperty_border_left_color_rtl_source,
1394 eCSSProperty_border_right_color_ltr_source,
1395 eCSSProperty_border_right_color_rtl_source,
1396 eCSSProperty_UNKNOWN
1399 static const nsCSSProperty gMozBorderEndColorSubpropTable[] = {
1400 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1401 eCSSProperty_border_end_color_value,
1402 eCSSProperty_border_right_color_ltr_source,
1403 eCSSProperty_border_left_color_rtl_source,
1404 eCSSProperty_UNKNOWN
1407 static const nsCSSProperty gBorderLeftColorSubpropTable[] = {
1408 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1409 eCSSProperty_border_left_color_value,
1410 eCSSProperty_border_left_color_ltr_source,
1411 eCSSProperty_border_left_color_rtl_source,
1412 eCSSProperty_UNKNOWN
1415 static const nsCSSProperty gBorderRightColorSubpropTable[] = {
1416 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1417 eCSSProperty_border_right_color_value,
1418 eCSSProperty_border_right_color_ltr_source,
1419 eCSSProperty_border_right_color_rtl_source,
1420 eCSSProperty_UNKNOWN
1423 static const nsCSSProperty gMozBorderStartColorSubpropTable[] = {
1424 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1425 eCSSProperty_border_start_color_value,
1426 eCSSProperty_border_left_color_ltr_source,
1427 eCSSProperty_border_right_color_rtl_source,
1428 eCSSProperty_UNKNOWN
1431 static const nsCSSProperty gMozBorderEndSubpropTable[] = {
1432 // nsCSSDeclaration.cpp output the subproperties in this order.
1433 eCSSProperty_border_end_width_value,
1434 eCSSProperty_border_end_style_value,
1435 eCSSProperty_border_end_color_value,
1436 // extras:
1437 eCSSProperty_border_right_width_ltr_source,
1438 eCSSProperty_border_left_width_rtl_source,
1439 eCSSProperty_border_right_style_ltr_source,
1440 eCSSProperty_border_left_style_rtl_source,
1441 eCSSProperty_border_right_color_ltr_source,
1442 eCSSProperty_border_left_color_rtl_source,
1443 eCSSProperty_UNKNOWN
1446 static const nsCSSProperty gBorderLeftSubpropTable[] = {
1447 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1448 eCSSProperty_border_left_width_value,
1449 eCSSProperty_border_left_style_value,
1450 eCSSProperty_border_left_color_value,
1451 // extras:
1452 eCSSProperty_border_left_width_ltr_source,
1453 eCSSProperty_border_left_width_rtl_source,
1454 eCSSProperty_border_left_style_ltr_source,
1455 eCSSProperty_border_left_style_rtl_source,
1456 eCSSProperty_border_left_color_ltr_source,
1457 eCSSProperty_border_left_color_rtl_source,
1458 eCSSProperty_UNKNOWN
1461 static const nsCSSProperty gBorderRightSubpropTable[] = {
1462 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1463 eCSSProperty_border_right_width_value,
1464 eCSSProperty_border_right_style_value,
1465 eCSSProperty_border_right_color_value,
1466 // extras:
1467 eCSSProperty_border_right_width_ltr_source,
1468 eCSSProperty_border_right_width_rtl_source,
1469 eCSSProperty_border_right_style_ltr_source,
1470 eCSSProperty_border_right_style_rtl_source,
1471 eCSSProperty_border_right_color_ltr_source,
1472 eCSSProperty_border_right_color_rtl_source,
1473 eCSSProperty_UNKNOWN
1476 static const nsCSSProperty gMozBorderStartSubpropTable[] = {
1477 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1478 eCSSProperty_border_start_width_value,
1479 eCSSProperty_border_start_style_value,
1480 eCSSProperty_border_start_color_value,
1481 // extras:
1482 eCSSProperty_border_left_width_ltr_source,
1483 eCSSProperty_border_right_width_rtl_source,
1484 eCSSProperty_border_left_style_ltr_source,
1485 eCSSProperty_border_right_style_rtl_source,
1486 eCSSProperty_border_left_color_ltr_source,
1487 eCSSProperty_border_right_color_rtl_source,
1488 eCSSProperty_UNKNOWN
1491 static const nsCSSProperty gBorderStyleSubpropTable[] = {
1492 // Code relies on these being in top-right-bottom-left order.
1493 eCSSProperty_border_top_style,
1494 eCSSProperty_border_right_style_value,
1495 eCSSProperty_border_bottom_style,
1496 eCSSProperty_border_left_style_value,
1497 // extras:
1498 eCSSProperty_border_left_style_ltr_source,
1499 eCSSProperty_border_left_style_rtl_source,
1500 eCSSProperty_border_right_style_ltr_source,
1501 eCSSProperty_border_right_style_rtl_source,
1502 eCSSProperty_UNKNOWN
1505 static const nsCSSProperty gBorderLeftStyleSubpropTable[] = {
1506 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1507 eCSSProperty_border_left_style_value,
1508 eCSSProperty_border_left_style_ltr_source,
1509 eCSSProperty_border_left_style_rtl_source,
1510 eCSSProperty_UNKNOWN
1513 static const nsCSSProperty gBorderRightStyleSubpropTable[] = {
1514 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1515 eCSSProperty_border_right_style_value,
1516 eCSSProperty_border_right_style_ltr_source,
1517 eCSSProperty_border_right_style_rtl_source,
1518 eCSSProperty_UNKNOWN
1521 static const nsCSSProperty gMozBorderStartStyleSubpropTable[] = {
1522 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1523 eCSSProperty_border_start_style_value,
1524 eCSSProperty_border_left_style_ltr_source,
1525 eCSSProperty_border_right_style_rtl_source,
1526 eCSSProperty_UNKNOWN
1529 static const nsCSSProperty gMozBorderEndStyleSubpropTable[] = {
1530 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1531 eCSSProperty_border_end_style_value,
1532 eCSSProperty_border_right_style_ltr_source,
1533 eCSSProperty_border_left_style_rtl_source,
1534 eCSSProperty_UNKNOWN
1537 static const nsCSSProperty gBorderTopSubpropTable[] = {
1538 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1539 eCSSProperty_border_top_width,
1540 eCSSProperty_border_top_style,
1541 eCSSProperty_border_top_color,
1542 eCSSProperty_UNKNOWN
1545 static const nsCSSProperty gBorderWidthSubpropTable[] = {
1546 // Code relies on these being in top-right-bottom-left order.
1547 eCSSProperty_border_top_width,
1548 eCSSProperty_border_right_width_value,
1549 eCSSProperty_border_bottom_width,
1550 eCSSProperty_border_left_width_value,
1551 // extras:
1552 eCSSProperty_border_left_width_ltr_source,
1553 eCSSProperty_border_left_width_rtl_source,
1554 eCSSProperty_border_right_width_ltr_source,
1555 eCSSProperty_border_right_width_rtl_source,
1556 eCSSProperty_UNKNOWN
1559 static const nsCSSProperty gBorderLeftWidthSubpropTable[] = {
1560 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1561 eCSSProperty_border_left_width_value,
1562 eCSSProperty_border_left_width_ltr_source,
1563 eCSSProperty_border_left_width_rtl_source,
1564 eCSSProperty_UNKNOWN
1567 static const nsCSSProperty gBorderRightWidthSubpropTable[] = {
1568 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1569 eCSSProperty_border_right_width_value,
1570 eCSSProperty_border_right_width_ltr_source,
1571 eCSSProperty_border_right_width_rtl_source,
1572 eCSSProperty_UNKNOWN
1575 static const nsCSSProperty gMozBorderStartWidthSubpropTable[] = {
1576 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1577 eCSSProperty_border_start_width_value,
1578 eCSSProperty_border_left_width_ltr_source,
1579 eCSSProperty_border_right_width_rtl_source,
1580 eCSSProperty_UNKNOWN
1583 static const nsCSSProperty gMozBorderEndWidthSubpropTable[] = {
1584 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1585 eCSSProperty_border_end_width_value,
1586 eCSSProperty_border_right_width_ltr_source,
1587 eCSSProperty_border_left_width_rtl_source,
1588 eCSSProperty_UNKNOWN
1591 static const nsCSSProperty gCueSubpropTable[] = {
1592 eCSSProperty_cue_after,
1593 eCSSProperty_cue_before,
1594 eCSSProperty_UNKNOWN
1597 static const nsCSSProperty gFontSubpropTable[] = {
1598 eCSSProperty_font_family,
1599 eCSSProperty_font_style,
1600 eCSSProperty_font_variant,
1601 eCSSProperty_font_weight,
1602 eCSSProperty_font_size,
1603 eCSSProperty_line_height,
1604 eCSSProperty_font_size_adjust, // XXX Added LDB.
1605 eCSSProperty_font_stretch, // XXX Added LDB.
1606 eCSSProperty__x_system_font,
1607 eCSSProperty_UNKNOWN
1610 static const nsCSSProperty gListStyleSubpropTable[] = {
1611 eCSSProperty_list_style_type,
1612 eCSSProperty_list_style_image,
1613 eCSSProperty_list_style_position,
1614 eCSSProperty_UNKNOWN
1617 static const nsCSSProperty gMarginSubpropTable[] = {
1618 // Code relies on these being in top-right-bottom-left order.
1619 eCSSProperty_margin_top,
1620 eCSSProperty_margin_right_value,
1621 eCSSProperty_margin_bottom,
1622 eCSSProperty_margin_left_value,
1623 // extras:
1624 eCSSProperty_margin_left_ltr_source,
1625 eCSSProperty_margin_left_rtl_source,
1626 eCSSProperty_margin_right_ltr_source,
1627 eCSSProperty_margin_right_rtl_source,
1628 eCSSProperty_UNKNOWN
1631 static const nsCSSProperty gMarginLeftSubpropTable[] = {
1632 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1633 eCSSProperty_margin_left_value,
1634 eCSSProperty_margin_left_ltr_source,
1635 eCSSProperty_margin_left_rtl_source,
1636 eCSSProperty_UNKNOWN
1639 static const nsCSSProperty gMarginRightSubpropTable[] = {
1640 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1641 eCSSProperty_margin_right_value,
1642 eCSSProperty_margin_right_ltr_source,
1643 eCSSProperty_margin_right_rtl_source,
1644 eCSSProperty_UNKNOWN
1647 static const nsCSSProperty gMozMarginStartSubpropTable[] = {
1648 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1649 eCSSProperty_margin_start_value,
1650 eCSSProperty_margin_left_ltr_source,
1651 eCSSProperty_margin_right_rtl_source,
1652 eCSSProperty_UNKNOWN
1655 static const nsCSSProperty gMozMarginEndSubpropTable[] = {
1656 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1657 eCSSProperty_margin_end_value,
1658 eCSSProperty_margin_right_ltr_source,
1659 eCSSProperty_margin_left_rtl_source,
1660 eCSSProperty_UNKNOWN
1664 static const nsCSSProperty gOutlineSubpropTable[] = {
1665 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1666 eCSSProperty_outline_color,
1667 eCSSProperty_outline_style,
1668 eCSSProperty_outline_width,
1669 eCSSProperty_UNKNOWN
1672 static const nsCSSProperty gMozColumnRuleSubpropTable[] = {
1673 eCSSProperty__moz_column_rule_width,
1674 eCSSProperty__moz_column_rule_style,
1675 eCSSProperty__moz_column_rule_color,
1676 eCSSProperty_UNKNOWN
1679 static const nsCSSProperty gOverflowSubpropTable[] = {
1680 eCSSProperty_overflow_x,
1681 eCSSProperty_overflow_y,
1682 eCSSProperty_UNKNOWN
1685 static const nsCSSProperty gPaddingSubpropTable[] = {
1686 // Code relies on these being in top-right-bottom-left order.
1687 eCSSProperty_padding_top,
1688 eCSSProperty_padding_right_value,
1689 eCSSProperty_padding_bottom,
1690 eCSSProperty_padding_left_value,
1691 // extras:
1692 eCSSProperty_padding_left_ltr_source,
1693 eCSSProperty_padding_left_rtl_source,
1694 eCSSProperty_padding_right_ltr_source,
1695 eCSSProperty_padding_right_rtl_source,
1696 eCSSProperty_UNKNOWN
1699 static const nsCSSProperty gPaddingLeftSubpropTable[] = {
1700 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1701 eCSSProperty_padding_left_value,
1702 eCSSProperty_padding_left_ltr_source,
1703 eCSSProperty_padding_left_rtl_source,
1704 eCSSProperty_UNKNOWN
1707 static const nsCSSProperty gPaddingRightSubpropTable[] = {
1708 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1709 eCSSProperty_padding_right_value,
1710 eCSSProperty_padding_right_ltr_source,
1711 eCSSProperty_padding_right_rtl_source,
1712 eCSSProperty_UNKNOWN
1715 static const nsCSSProperty gMozPaddingStartSubpropTable[] = {
1716 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1717 eCSSProperty_padding_start_value,
1718 eCSSProperty_padding_left_ltr_source,
1719 eCSSProperty_padding_right_rtl_source,
1720 eCSSProperty_UNKNOWN
1723 static const nsCSSProperty gMozPaddingEndSubpropTable[] = {
1724 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1725 eCSSProperty_padding_end_value,
1726 eCSSProperty_padding_right_ltr_source,
1727 eCSSProperty_padding_left_rtl_source,
1728 eCSSProperty_UNKNOWN
1731 static const nsCSSProperty gPauseSubpropTable[] = {
1732 eCSSProperty_pause_after,
1733 eCSSProperty_pause_before,
1734 eCSSProperty_UNKNOWN
1737 #ifdef MOZ_SVG
1738 static const nsCSSProperty gMarkerSubpropTable[] = {
1739 eCSSProperty_marker_start,
1740 eCSSProperty_marker_mid,
1741 eCSSProperty_marker_end,
1742 eCSSProperty_UNKNOWN
1744 #endif
1746 const nsCSSProperty *const
1747 nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = {
1748 #define CSS_PROP_SHORTHAND(name_, id_, method_) g##method_##SubpropTable,
1749 #include "nsCSSPropList.h"
1750 #undef CSS_PROP_SHORTHAND