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
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.
23 * Mats Palmgren <mats.palmgren@bredband.net>
24 * Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>, Collabora Ltd.
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
41 * methods for dealing with CSS properties and tables of the keyword
45 #include "nsCSSProps.h"
46 #include "nsCSSKeywords.h"
47 #include "nsStyleConsts.h"
48 #include "nsIWidget.h"
49 #include "nsThemeConstants.h" // For system widget appearance types
51 #include "nsILookAndFeel.h" // for system colors
54 #include "nsReadableUtils.h"
55 #include "nsStaticNameTable.h"
56 #include "prlog.h" // for PR_STATIC_ASSERT
58 // required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it
59 extern const char* const kCSSRawProperties
[];
61 // define an array of all CSS properties
62 const char* const kCSSRawProperties
[] = {
63 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
64 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
66 #include "nsCSSPropList.h"
68 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) #name_,
69 #include "nsCSSPropList.h"
70 #undef CSS_PROP_SHORTHAND
74 static PRInt32 gTableRefCount
;
75 static nsStaticCaseInsensitiveNameTable
* gPropertyTable
;
76 static nsStaticCaseInsensitiveNameTable
* gFontDescTable
;
78 /* static */ nsCSSProperty
*
79 nsCSSProps::gShorthandsContainingTable
[eCSSProperty_COUNT_no_shorthands
];
80 /* static */ nsCSSProperty
* nsCSSProps::gShorthandsContainingPool
= nsnull
;
82 // Keep in sync with enum nsCSSFontDesc in nsCSSProperty.h.
83 static const char* const kCSSRawFontDescs
[] = {
90 "-moz-font-feature-settings",
91 "-moz-font-language-override"
94 struct PropertyAndCount
{
95 nsCSSProperty property
;
100 SortPropertyAndCount(const void* s1
, const void* s2
, void *closure
)
102 const PropertyAndCount
*pc1
= static_cast<const PropertyAndCount
*>(s1
);
103 const PropertyAndCount
*pc2
= static_cast<const PropertyAndCount
*>(s2
);
104 // Primary sort by count (lowest to highest)
105 if (pc1
->count
!= pc2
->count
)
106 return pc1
->count
- pc2
->count
;
107 // Secondary sort by property index (highest to lowest)
108 return pc2
->property
- pc1
->property
;
112 nsCSSProps::AddRefTable(void)
114 if (0 == gTableRefCount
++) {
115 NS_ASSERTION(!gPropertyTable
, "pre existing array!");
116 NS_ASSERTION(!gFontDescTable
, "pre existing array!");
118 gPropertyTable
= new nsStaticCaseInsensitiveNameTable();
119 if (gPropertyTable
) {
122 // let's verify the table...
123 for (PRInt32 index
= 0; index
< eCSSProperty_COUNT
; ++index
) {
124 nsCAutoString
temp1(kCSSRawProperties
[index
]);
125 nsCAutoString
temp2(kCSSRawProperties
[index
]);
127 NS_ASSERTION(temp1
.Equals(temp2
), "upper case char in prop table");
128 NS_ASSERTION(-1 == temp1
.FindChar('_'), "underscore char in prop table");
132 gPropertyTable
->Init(kCSSRawProperties
, eCSSProperty_COUNT
);
135 gFontDescTable
= new nsStaticCaseInsensitiveNameTable();
136 if (gFontDescTable
) {
139 // let's verify the table...
140 for (PRInt32 index
= 0; index
< eCSSFontDesc_COUNT
; ++index
) {
141 nsCAutoString
temp1(kCSSRawFontDescs
[index
]);
142 nsCAutoString
temp2(kCSSRawFontDescs
[index
]);
144 NS_ASSERTION(temp1
.Equals(temp2
), "upper case char in desc table");
145 NS_ASSERTION(-1 == temp1
.FindChar('_'), "underscore char in desc table");
149 gFontDescTable
->Init(kCSSRawFontDescs
, eCSSFontDesc_COUNT
);
152 BuildShorthandsContainingTable();
156 #undef DEBUG_SHORTHANDS_CONTAINING
159 nsCSSProps::BuildShorthandsContainingTable()
161 PRUint32 occurrenceCounts
[eCSSProperty_COUNT_no_shorthands
];
162 memset(occurrenceCounts
, 0, sizeof(occurrenceCounts
));
163 PropertyAndCount subpropCounts
[eCSSProperty_COUNT
-
164 eCSSProperty_COUNT_no_shorthands
];
165 for (nsCSSProperty shorthand
= eCSSProperty_COUNT_no_shorthands
;
166 shorthand
< eCSSProperty_COUNT
;
167 shorthand
= nsCSSProperty(shorthand
+ 1)) {
168 #ifdef DEBUG_SHORTHANDS_CONTAINING
169 printf("Considering shorthand property '%s'.\n",
170 nsCSSProps::GetStringValue(shorthand
).get());
172 PropertyAndCount
&subpropCountsEntry
=
173 subpropCounts
[shorthand
- eCSSProperty_COUNT_no_shorthands
];
174 subpropCountsEntry
.property
= shorthand
;
175 subpropCountsEntry
.count
= 0;
176 for (const nsCSSProperty
* subprops
= SubpropertyEntryFor(shorthand
);
177 *subprops
!= eCSSProperty_UNKNOWN
;
179 NS_ASSERTION(0 < *subprops
&&
180 *subprops
< eCSSProperty_COUNT_no_shorthands
,
181 "subproperty must be a longhand");
182 ++occurrenceCounts
[*subprops
];
183 ++subpropCountsEntry
.count
;
187 PRUint32 poolEntries
= 0;
188 for (nsCSSProperty longhand
= nsCSSProperty(0);
189 longhand
< eCSSProperty_COUNT_no_shorthands
;
190 longhand
= nsCSSProperty(longhand
+ 1)) {
191 PRUint32 count
= occurrenceCounts
[longhand
];
193 // leave room for terminator
194 poolEntries
+= count
+ 1;
197 gShorthandsContainingPool
= new nsCSSProperty
[poolEntries
];
198 if (!gShorthandsContainingPool
)
201 // Initialize all entries to point to their null-terminator.
203 nsCSSProperty
*poolCursor
= gShorthandsContainingPool
- 1;
204 nsCSSProperty
*lastTerminator
=
205 gShorthandsContainingPool
+ poolEntries
- 1;
206 for (nsCSSProperty longhand
= nsCSSProperty(0);
207 longhand
< eCSSProperty_COUNT_no_shorthands
;
208 longhand
= nsCSSProperty(longhand
+ 1)) {
209 PRUint32 count
= occurrenceCounts
[longhand
];
211 poolCursor
+= count
+ 1;
212 gShorthandsContainingTable
[longhand
] = poolCursor
;
213 *poolCursor
= eCSSProperty_UNKNOWN
;
215 gShorthandsContainingTable
[longhand
] = lastTerminator
;
218 NS_ASSERTION(poolCursor
== lastTerminator
, "miscalculation");
221 // Sort with lowest count at the start and highest at the end, and
222 // within counts sort in reverse property index order.
223 NS_QuickSort(&subpropCounts
, NS_ARRAY_LENGTH(subpropCounts
),
224 sizeof(subpropCounts
[0]), SortPropertyAndCount
, nsnull
);
226 // Fill in all the entries in gShorthandsContainingTable
227 for (const PropertyAndCount
*shorthandAndCount
= subpropCounts
,
228 *shorthandAndCountEnd
=
229 subpropCounts
+ NS_ARRAY_LENGTH(subpropCounts
);
230 shorthandAndCount
< shorthandAndCountEnd
;
231 ++shorthandAndCount
) {
232 #ifdef DEBUG_SHORTHANDS_CONTAINING
233 printf("Entering %u subprops for '%s'.\n",
234 shorthandAndCount
->count
,
235 nsCSSProps::GetStringValue(shorthandAndCount
->property
).get());
237 for (const nsCSSProperty
* subprops
=
238 SubpropertyEntryFor(shorthandAndCount
->property
);
239 *subprops
!= eCSSProperty_UNKNOWN
;
241 *(--gShorthandsContainingTable
[*subprops
]) = shorthandAndCount
->property
;
245 #ifdef DEBUG_SHORTHANDS_CONTAINING
246 for (nsCSSProperty longhand
= nsCSSProperty(0);
247 longhand
< eCSSProperty_COUNT_no_shorthands
;
248 longhand
= nsCSSProperty(longhand
+ 1)) {
249 printf("Property %s is in %d shorthands.\n",
250 nsCSSProps::GetStringValue(longhand
).get(),
251 occurrenceCounts
[longhand
]);
252 for (const nsCSSProperty
*shorthands
= ShorthandsContaining(longhand
);
253 *shorthands
!= eCSSProperty_UNKNOWN
;
255 printf(" %s\n", nsCSSProps::GetStringValue(*shorthands
).get());
261 // Verify that all values that should be are present.
262 for (nsCSSProperty shorthand
= eCSSProperty_COUNT_no_shorthands
;
263 shorthand
< eCSSProperty_COUNT
;
264 shorthand
= nsCSSProperty(shorthand
+ 1)) {
265 for (const nsCSSProperty
* subprops
= SubpropertyEntryFor(shorthand
);
266 *subprops
!= eCSSProperty_UNKNOWN
;
269 for (const nsCSSProperty
*shcont
= ShorthandsContaining(*subprops
);
270 *shcont
!= eCSSProperty_UNKNOWN
;
272 if (*shcont
== shorthand
)
275 NS_ASSERTION(count
== 1, "subproperty of shorthand should have shorthand"
276 " in its ShorthandsContaining() table");
280 // Verify that there are no extra values
281 for (nsCSSProperty longhand
= nsCSSProperty(0);
282 longhand
< eCSSProperty_COUNT_no_shorthands
;
283 longhand
= nsCSSProperty(longhand
+ 1)) {
284 for (const nsCSSProperty
*shorthands
= ShorthandsContaining(longhand
);
285 *shorthands
!= eCSSProperty_UNKNOWN
;
288 for (const nsCSSProperty
* subprops
= SubpropertyEntryFor(*shorthands
);
289 *subprops
!= eCSSProperty_UNKNOWN
;
291 if (*subprops
== longhand
)
294 NS_ASSERTION(count
== 1, "longhand should be in subproperty table of "
295 "property in its ShorthandsContaining() table");
304 nsCSSProps::ReleaseTable(void)
306 if (0 == --gTableRefCount
) {
307 delete gPropertyTable
;
308 gPropertyTable
= nsnull
;
310 delete gFontDescTable
;
311 gFontDescTable
= nsnull
;
313 delete [] gShorthandsContainingPool
;
314 gShorthandsContainingPool
= nsnull
;
319 nsCSSProps::LookupProperty(const nsACString
& aProperty
)
321 NS_ASSERTION(gPropertyTable
, "no lookup table, needs addref");
323 nsCSSProperty res
= nsCSSProperty(gPropertyTable
->Lookup(aProperty
));
328 nsCSSProps::LookupProperty(const nsAString
& aProperty
)
330 // This is faster than converting and calling
331 // LookupProperty(nsACString&). The table will do its own
332 // converting and avoid a PromiseFlatCString() call.
333 NS_ASSERTION(gPropertyTable
, "no lookup table, needs addref");
334 nsCSSProperty res
= nsCSSProperty(gPropertyTable
->Lookup(aProperty
));
339 nsCSSProps::LookupFontDesc(const nsACString
& aFontDesc
)
341 NS_ASSERTION(gFontDescTable
, "no lookup table, needs addref");
342 return nsCSSFontDesc(gFontDescTable
->Lookup(aFontDesc
));
346 nsCSSProps::LookupFontDesc(const nsAString
& aFontDesc
)
348 NS_ASSERTION(gFontDescTable
, "no lookup table, needs addref");
349 return nsCSSFontDesc(gFontDescTable
->Lookup(aFontDesc
));
352 const nsAFlatCString
&
353 nsCSSProps::GetStringValue(nsCSSProperty aProperty
)
355 NS_ASSERTION(gPropertyTable
, "no lookup table, needs addref");
356 if (gPropertyTable
) {
357 return gPropertyTable
->GetStringValue(PRInt32(aProperty
));
359 static nsDependentCString
sNullStr("");
364 const nsAFlatCString
&
365 nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID
)
367 NS_ASSERTION(gFontDescTable
, "no lookup table, needs addref");
368 if (gFontDescTable
) {
369 return gFontDescTable
->GetStringValue(PRInt32(aFontDescID
));
371 static nsDependentCString
sNullStr("");
377 nsCSSProps::OtherNameFor(nsCSSProperty aProperty
)
380 case eCSSProperty_border_left_color_value
:
381 return eCSSProperty_border_left_color
;
382 case eCSSProperty_border_left_style_value
:
383 return eCSSProperty_border_left_style
;
384 case eCSSProperty_border_left_width_value
:
385 return eCSSProperty_border_left_width
;
386 case eCSSProperty_border_right_color_value
:
387 return eCSSProperty_border_right_color
;
388 case eCSSProperty_border_right_style_value
:
389 return eCSSProperty_border_right_style
;
390 case eCSSProperty_border_right_width_value
:
391 return eCSSProperty_border_right_width
;
392 case eCSSProperty_margin_left_value
:
393 return eCSSProperty_margin_left
;
394 case eCSSProperty_margin_right_value
:
395 return eCSSProperty_margin_right
;
396 case eCSSProperty_padding_left_value
:
397 return eCSSProperty_padding_left
;
398 case eCSSProperty_padding_right_value
:
399 return eCSSProperty_padding_right
;
401 NS_ABORT_IF_FALSE(PR_FALSE
, "bad caller");
403 return eCSSProperty_UNKNOWN
;
406 /***************************************************************************/
408 const PRInt32
nsCSSProps::kAppearanceKTable
[] = {
409 eCSSKeyword_none
, NS_THEME_NONE
,
410 eCSSKeyword_button
, NS_THEME_BUTTON
,
411 eCSSKeyword_radio
, NS_THEME_RADIO
,
412 eCSSKeyword_checkbox
, NS_THEME_CHECKBOX
,
413 eCSSKeyword_button_bevel
, NS_THEME_BUTTON_BEVEL
,
414 eCSSKeyword_toolbox
, NS_THEME_TOOLBOX
,
415 eCSSKeyword_toolbar
, NS_THEME_TOOLBAR
,
416 eCSSKeyword_toolbarbutton
, NS_THEME_TOOLBAR_BUTTON
,
417 eCSSKeyword_toolbargripper
, NS_THEME_TOOLBAR_GRIPPER
,
418 eCSSKeyword_dualbutton
, NS_THEME_TOOLBAR_DUAL_BUTTON
,
419 eCSSKeyword_toolbarbutton_dropdown
, NS_THEME_TOOLBAR_BUTTON_DROPDOWN
,
420 eCSSKeyword_button_arrow_up
, NS_THEME_BUTTON_ARROW_UP
,
421 eCSSKeyword_button_arrow_down
, NS_THEME_BUTTON_ARROW_DOWN
,
422 eCSSKeyword_button_arrow_next
, NS_THEME_BUTTON_ARROW_NEXT
,
423 eCSSKeyword_button_arrow_previous
, NS_THEME_BUTTON_ARROW_PREVIOUS
,
424 eCSSKeyword_separator
, NS_THEME_TOOLBAR_SEPARATOR
,
425 eCSSKeyword_splitter
, NS_THEME_SPLITTER
,
426 eCSSKeyword_statusbar
, NS_THEME_STATUSBAR
,
427 eCSSKeyword_statusbarpanel
, NS_THEME_STATUSBAR_PANEL
,
428 eCSSKeyword_resizerpanel
, NS_THEME_STATUSBAR_RESIZER_PANEL
,
429 eCSSKeyword_resizer
, NS_THEME_RESIZER
,
430 eCSSKeyword_listbox
, NS_THEME_LISTBOX
,
431 eCSSKeyword_listitem
, NS_THEME_LISTBOX_LISTITEM
,
432 eCSSKeyword_treeview
, NS_THEME_TREEVIEW
,
433 eCSSKeyword_treeitem
, NS_THEME_TREEVIEW_TREEITEM
,
434 eCSSKeyword_treetwisty
, NS_THEME_TREEVIEW_TWISTY
,
435 eCSSKeyword_treetwistyopen
, NS_THEME_TREEVIEW_TWISTY_OPEN
,
436 eCSSKeyword_treeline
, NS_THEME_TREEVIEW_LINE
,
437 eCSSKeyword_treeheader
, NS_THEME_TREEVIEW_HEADER
,
438 eCSSKeyword_treeheadercell
, NS_THEME_TREEVIEW_HEADER_CELL
,
439 eCSSKeyword_treeheadersortarrow
, NS_THEME_TREEVIEW_HEADER_SORTARROW
,
440 eCSSKeyword_progressbar
, NS_THEME_PROGRESSBAR
,
441 eCSSKeyword_progresschunk
, NS_THEME_PROGRESSBAR_CHUNK
,
442 eCSSKeyword_progressbar_vertical
, NS_THEME_PROGRESSBAR_VERTICAL
,
443 eCSSKeyword_progresschunk_vertical
, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL
,
444 eCSSKeyword_tab
, NS_THEME_TAB
,
445 eCSSKeyword_tabpanels
, NS_THEME_TAB_PANELS
,
446 eCSSKeyword_tabpanel
, NS_THEME_TAB_PANEL
,
447 eCSSKeyword_tabscrollarrow_back
, NS_THEME_TAB_SCROLLARROW_BACK
,
448 eCSSKeyword_tabscrollarrow_forward
, NS_THEME_TAB_SCROLLARROW_FORWARD
,
449 eCSSKeyword_tooltip
, NS_THEME_TOOLTIP
,
450 eCSSKeyword_spinner
, NS_THEME_SPINNER
,
451 eCSSKeyword_spinner_upbutton
, NS_THEME_SPINNER_UP_BUTTON
,
452 eCSSKeyword_spinner_downbutton
, NS_THEME_SPINNER_DOWN_BUTTON
,
453 eCSSKeyword_spinner_textfield
, NS_THEME_SPINNER_TEXTFIELD
,
454 eCSSKeyword_scrollbar
, NS_THEME_SCROLLBAR
,
455 eCSSKeyword_scrollbar_small
, NS_THEME_SCROLLBAR_SMALL
,
456 eCSSKeyword_scrollbarbutton_up
, NS_THEME_SCROLLBAR_BUTTON_UP
,
457 eCSSKeyword_scrollbarbutton_down
, NS_THEME_SCROLLBAR_BUTTON_DOWN
,
458 eCSSKeyword_scrollbarbutton_left
, NS_THEME_SCROLLBAR_BUTTON_LEFT
,
459 eCSSKeyword_scrollbarbutton_right
, NS_THEME_SCROLLBAR_BUTTON_RIGHT
,
460 eCSSKeyword_scrollbartrack_horizontal
, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL
,
461 eCSSKeyword_scrollbartrack_vertical
, NS_THEME_SCROLLBAR_TRACK_VERTICAL
,
462 eCSSKeyword_scrollbarthumb_horizontal
, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL
,
463 eCSSKeyword_scrollbarthumb_vertical
, NS_THEME_SCROLLBAR_THUMB_VERTICAL
,
464 eCSSKeyword_textfield
, NS_THEME_TEXTFIELD
,
465 eCSSKeyword_textfield_multiline
, NS_THEME_TEXTFIELD_MULTILINE
,
466 eCSSKeyword_caret
, NS_THEME_TEXTFIELD_CARET
,
467 eCSSKeyword_searchfield
, NS_THEME_SEARCHFIELD
,
468 eCSSKeyword_menulist
, NS_THEME_DROPDOWN
,
469 eCSSKeyword_menulistbutton
, NS_THEME_DROPDOWN_BUTTON
,
470 eCSSKeyword_menulisttext
, NS_THEME_DROPDOWN_TEXT
,
471 eCSSKeyword_menulisttextfield
, NS_THEME_DROPDOWN_TEXTFIELD
,
472 eCSSKeyword_scale_horizontal
, NS_THEME_SCALE_HORIZONTAL
,
473 eCSSKeyword_scale_vertical
, NS_THEME_SCALE_VERTICAL
,
474 eCSSKeyword_scalethumb_horizontal
, NS_THEME_SCALE_THUMB_HORIZONTAL
,
475 eCSSKeyword_scalethumb_vertical
, NS_THEME_SCALE_THUMB_VERTICAL
,
476 eCSSKeyword_scalethumbstart
, NS_THEME_SCALE_THUMB_START
,
477 eCSSKeyword_scalethumbend
, NS_THEME_SCALE_THUMB_END
,
478 eCSSKeyword_scalethumbtick
, NS_THEME_SCALE_TICK
,
479 eCSSKeyword_groupbox
, NS_THEME_GROUPBOX
,
480 eCSSKeyword_checkboxcontainer
, NS_THEME_CHECKBOX_CONTAINER
,
481 eCSSKeyword_radiocontainer
, NS_THEME_RADIO_CONTAINER
,
482 eCSSKeyword_checkboxlabel
, NS_THEME_CHECKBOX_LABEL
,
483 eCSSKeyword_radiolabel
, NS_THEME_RADIO_LABEL
,
484 eCSSKeyword_buttonfocus
, NS_THEME_BUTTON_FOCUS
,
485 eCSSKeyword_window
, NS_THEME_WINDOW
,
486 eCSSKeyword_dialog
, NS_THEME_DIALOG
,
487 eCSSKeyword_menubar
, NS_THEME_MENUBAR
,
488 eCSSKeyword_menupopup
, NS_THEME_MENUPOPUP
,
489 eCSSKeyword_menuitem
, NS_THEME_MENUITEM
,
490 eCSSKeyword_checkmenuitem
, NS_THEME_CHECKMENUITEM
,
491 eCSSKeyword_radiomenuitem
, NS_THEME_RADIOMENUITEM
,
492 eCSSKeyword_menucheckbox
, NS_THEME_MENUCHECKBOX
,
493 eCSSKeyword_menuradio
, NS_THEME_MENURADIO
,
494 eCSSKeyword_menuseparator
, NS_THEME_MENUSEPARATOR
,
495 eCSSKeyword_menuarrow
, NS_THEME_MENUARROW
,
496 eCSSKeyword_menuimage
, NS_THEME_MENUIMAGE
,
497 eCSSKeyword_menuitemtext
, NS_THEME_MENUITEMTEXT
,
498 eCSSKeyword__moz_win_media_toolbox
, NS_THEME_WIN_MEDIA_TOOLBOX
,
499 eCSSKeyword__moz_win_communications_toolbox
, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX
,
500 eCSSKeyword__moz_win_browsertabbar_toolbox
, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX
,
501 eCSSKeyword__moz_win_glass
, NS_THEME_WIN_GLASS
,
502 eCSSKeyword__moz_mac_unified_toolbar
, NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR
,
503 eCSSKeyword__moz_window_titlebar
, NS_THEME_WINDOW_TITLEBAR
,
504 eCSSKeyword__moz_window_titlebar_maximized
, NS_THEME_WINDOW_TITLEBAR_MAXIMIZED
,
505 eCSSKeyword__moz_window_frame_left
, NS_THEME_WINDOW_FRAME_LEFT
,
506 eCSSKeyword__moz_window_frame_right
, NS_THEME_WINDOW_FRAME_RIGHT
,
507 eCSSKeyword__moz_window_frame_bottom
, NS_THEME_WINDOW_FRAME_BOTTOM
,
508 eCSSKeyword__moz_window_button_close
, NS_THEME_WINDOW_BUTTON_CLOSE
,
509 eCSSKeyword__moz_window_button_minimize
, NS_THEME_WINDOW_BUTTON_MINIMIZE
,
510 eCSSKeyword__moz_window_button_maximize
, NS_THEME_WINDOW_BUTTON_MAXIMIZE
,
511 eCSSKeyword__moz_window_button_restore
, NS_THEME_WINDOW_BUTTON_RESTORE
,
512 eCSSKeyword_UNKNOWN
,-1
515 // Keyword id tables for variant/enum parsing
516 const PRInt32
nsCSSProps::kAzimuthKTable
[] = {
517 eCSSKeyword_left_side
, NS_STYLE_AZIMUTH_LEFT_SIDE
,
518 eCSSKeyword_far_left
, NS_STYLE_AZIMUTH_FAR_LEFT
,
519 eCSSKeyword_left
, NS_STYLE_AZIMUTH_LEFT
,
520 eCSSKeyword_center_left
, NS_STYLE_AZIMUTH_CENTER_LEFT
,
521 eCSSKeyword_center
, NS_STYLE_AZIMUTH_CENTER
,
522 eCSSKeyword_center_right
, NS_STYLE_AZIMUTH_CENTER_RIGHT
,
523 eCSSKeyword_right
, NS_STYLE_AZIMUTH_RIGHT
,
524 eCSSKeyword_far_right
, NS_STYLE_AZIMUTH_FAR_RIGHT
,
525 eCSSKeyword_right_side
, NS_STYLE_AZIMUTH_RIGHT_SIDE
,
526 eCSSKeyword_behind
, NS_STYLE_AZIMUTH_BEHIND
,
527 eCSSKeyword_leftwards
, NS_STYLE_AZIMUTH_LEFTWARDS
,
528 eCSSKeyword_rightwards
, NS_STYLE_AZIMUTH_RIGHTWARDS
,
529 eCSSKeyword_UNKNOWN
,-1
532 const PRInt32
nsCSSProps::kBackgroundAttachmentKTable
[] = {
533 eCSSKeyword_fixed
, NS_STYLE_BG_ATTACHMENT_FIXED
,
534 eCSSKeyword_scroll
, NS_STYLE_BG_ATTACHMENT_SCROLL
,
535 eCSSKeyword_UNKNOWN
,-1
538 const PRInt32
nsCSSProps::kBackgroundInlinePolicyKTable
[] = {
539 eCSSKeyword_each_box
, NS_STYLE_BG_INLINE_POLICY_EACH_BOX
,
540 eCSSKeyword_continuous
, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS
,
541 eCSSKeyword_bounding_box
, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX
,
542 eCSSKeyword_UNKNOWN
,-1
545 PR_STATIC_ASSERT(NS_STYLE_BG_CLIP_BORDER
== NS_STYLE_BG_ORIGIN_BORDER
);
546 PR_STATIC_ASSERT(NS_STYLE_BG_CLIP_PADDING
== NS_STYLE_BG_ORIGIN_PADDING
);
547 PR_STATIC_ASSERT(NS_STYLE_BG_CLIP_CONTENT
== NS_STYLE_BG_ORIGIN_CONTENT
);
548 const PRInt32
nsCSSProps::kBackgroundOriginKTable
[] = {
549 eCSSKeyword_border_box
, NS_STYLE_BG_ORIGIN_BORDER
,
550 eCSSKeyword_padding_box
, NS_STYLE_BG_ORIGIN_PADDING
,
551 eCSSKeyword_content_box
, NS_STYLE_BG_ORIGIN_CONTENT
,
552 eCSSKeyword_UNKNOWN
,-1
555 // Note: Don't change this table unless you update
556 // parseBackgroundPosition!
558 const PRInt32
nsCSSProps::kBackgroundPositionKTable
[] = {
559 eCSSKeyword_center
, NS_STYLE_BG_POSITION_CENTER
,
560 eCSSKeyword_top
, NS_STYLE_BG_POSITION_TOP
,
561 eCSSKeyword_bottom
, NS_STYLE_BG_POSITION_BOTTOM
,
562 eCSSKeyword_left
, NS_STYLE_BG_POSITION_LEFT
,
563 eCSSKeyword_right
, NS_STYLE_BG_POSITION_RIGHT
,
564 eCSSKeyword_UNKNOWN
,-1
567 const PRInt32
nsCSSProps::kBackgroundRepeatKTable
[] = {
568 eCSSKeyword_no_repeat
, NS_STYLE_BG_REPEAT_OFF
,
569 eCSSKeyword_repeat
, NS_STYLE_BG_REPEAT_XY
,
570 eCSSKeyword_repeat_x
, NS_STYLE_BG_REPEAT_X
,
571 eCSSKeyword_repeat_y
, NS_STYLE_BG_REPEAT_Y
,
572 eCSSKeyword_UNKNOWN
,-1
575 const PRInt32
nsCSSProps::kBackgroundSizeKTable
[] = {
576 eCSSKeyword_contain
, NS_STYLE_BG_SIZE_CONTAIN
,
577 eCSSKeyword_cover
, NS_STYLE_BG_SIZE_COVER
,
578 eCSSKeyword_UNKNOWN
,-1
581 const PRInt32
nsCSSProps::kBorderCollapseKTable
[] = {
582 eCSSKeyword_collapse
, NS_STYLE_BORDER_COLLAPSE
,
583 eCSSKeyword_separate
, NS_STYLE_BORDER_SEPARATE
,
584 eCSSKeyword_UNKNOWN
,-1
587 const PRInt32
nsCSSProps::kBorderColorKTable
[] = {
588 eCSSKeyword__moz_use_text_color
, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR
,
589 eCSSKeyword_UNKNOWN
,-1
592 const PRInt32
nsCSSProps::kBorderImageKTable
[] = {
593 eCSSKeyword_stretch
, NS_STYLE_BORDER_IMAGE_STRETCH
,
594 eCSSKeyword_repeat
, NS_STYLE_BORDER_IMAGE_REPEAT
,
595 eCSSKeyword_round
, NS_STYLE_BORDER_IMAGE_ROUND
,
596 eCSSKeyword_UNKNOWN
,-1
599 const PRInt32
nsCSSProps::kBorderStyleKTable
[] = {
600 eCSSKeyword_none
, NS_STYLE_BORDER_STYLE_NONE
,
601 eCSSKeyword_hidden
, NS_STYLE_BORDER_STYLE_HIDDEN
,
602 eCSSKeyword_dotted
, NS_STYLE_BORDER_STYLE_DOTTED
,
603 eCSSKeyword_dashed
, NS_STYLE_BORDER_STYLE_DASHED
,
604 eCSSKeyword_solid
, NS_STYLE_BORDER_STYLE_SOLID
,
605 eCSSKeyword_double
, NS_STYLE_BORDER_STYLE_DOUBLE
,
606 eCSSKeyword_groove
, NS_STYLE_BORDER_STYLE_GROOVE
,
607 eCSSKeyword_ridge
, NS_STYLE_BORDER_STYLE_RIDGE
,
608 eCSSKeyword_inset
, NS_STYLE_BORDER_STYLE_INSET
,
609 eCSSKeyword_outset
, NS_STYLE_BORDER_STYLE_OUTSET
,
610 eCSSKeyword_UNKNOWN
,-1
613 const PRInt32
nsCSSProps::kBorderWidthKTable
[] = {
614 eCSSKeyword_thin
, NS_STYLE_BORDER_WIDTH_THIN
,
615 eCSSKeyword_medium
, NS_STYLE_BORDER_WIDTH_MEDIUM
,
616 eCSSKeyword_thick
, NS_STYLE_BORDER_WIDTH_THICK
,
617 eCSSKeyword_UNKNOWN
,-1
620 const PRInt32
nsCSSProps::kBoxPropSourceKTable
[] = {
621 eCSSKeyword_physical
, NS_BOXPROP_SOURCE_PHYSICAL
,
622 eCSSKeyword_logical
, NS_BOXPROP_SOURCE_LOGICAL
,
623 eCSSKeyword_UNKNOWN
,-1
626 const PRInt32
nsCSSProps::kBoxShadowTypeKTable
[] = {
627 eCSSKeyword_inset
, NS_STYLE_BOX_SHADOW_INSET
,
628 eCSSKeyword_UNKNOWN
,-1
631 const PRInt32
nsCSSProps::kBoxSizingKTable
[] = {
632 eCSSKeyword_content_box
, NS_STYLE_BOX_SIZING_CONTENT
,
633 eCSSKeyword_border_box
, NS_STYLE_BOX_SIZING_BORDER
,
634 eCSSKeyword_padding_box
, NS_STYLE_BOX_SIZING_PADDING
,
635 eCSSKeyword_UNKNOWN
,-1
638 const PRInt32
nsCSSProps::kCaptionSideKTable
[] = {
639 eCSSKeyword_top
, NS_STYLE_CAPTION_SIDE_TOP
,
640 eCSSKeyword_right
, NS_STYLE_CAPTION_SIDE_RIGHT
,
641 eCSSKeyword_bottom
, NS_STYLE_CAPTION_SIDE_BOTTOM
,
642 eCSSKeyword_left
, NS_STYLE_CAPTION_SIDE_LEFT
,
643 eCSSKeyword_top_outside
, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE
,
644 eCSSKeyword_bottom_outside
, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE
,
645 eCSSKeyword_UNKNOWN
, -1
648 const PRInt32
nsCSSProps::kClearKTable
[] = {
649 eCSSKeyword_none
, NS_STYLE_CLEAR_NONE
,
650 eCSSKeyword_left
, NS_STYLE_CLEAR_LEFT
,
651 eCSSKeyword_right
, NS_STYLE_CLEAR_RIGHT
,
652 eCSSKeyword_both
, NS_STYLE_CLEAR_LEFT_AND_RIGHT
,
653 eCSSKeyword_UNKNOWN
,-1
656 const PRInt32
nsCSSProps::kColorKTable
[] = {
657 eCSSKeyword_activeborder
, nsILookAndFeel::eColor_activeborder
,
658 eCSSKeyword_activecaption
, nsILookAndFeel::eColor_activecaption
,
659 eCSSKeyword_appworkspace
, nsILookAndFeel::eColor_appworkspace
,
660 eCSSKeyword_background
, nsILookAndFeel::eColor_background
,
661 eCSSKeyword_buttonface
, nsILookAndFeel::eColor_buttonface
,
662 eCSSKeyword_buttonhighlight
, nsILookAndFeel::eColor_buttonhighlight
,
663 eCSSKeyword_buttonshadow
, nsILookAndFeel::eColor_buttonshadow
,
664 eCSSKeyword_buttontext
, nsILookAndFeel::eColor_buttontext
,
665 eCSSKeyword_captiontext
, nsILookAndFeel::eColor_captiontext
,
666 eCSSKeyword_graytext
, nsILookAndFeel::eColor_graytext
,
667 eCSSKeyword_highlight
, nsILookAndFeel::eColor_highlight
,
668 eCSSKeyword_highlighttext
, nsILookAndFeel::eColor_highlighttext
,
669 eCSSKeyword_inactiveborder
, nsILookAndFeel::eColor_inactiveborder
,
670 eCSSKeyword_inactivecaption
, nsILookAndFeel::eColor_inactivecaption
,
671 eCSSKeyword_inactivecaptiontext
, nsILookAndFeel::eColor_inactivecaptiontext
,
672 eCSSKeyword_infobackground
, nsILookAndFeel::eColor_infobackground
,
673 eCSSKeyword_infotext
, nsILookAndFeel::eColor_infotext
,
674 eCSSKeyword_menu
, nsILookAndFeel::eColor_menu
,
675 eCSSKeyword_menutext
, nsILookAndFeel::eColor_menutext
,
676 eCSSKeyword_scrollbar
, nsILookAndFeel::eColor_scrollbar
,
677 eCSSKeyword_threeddarkshadow
, nsILookAndFeel::eColor_threeddarkshadow
,
678 eCSSKeyword_threedface
, nsILookAndFeel::eColor_threedface
,
679 eCSSKeyword_threedhighlight
, nsILookAndFeel::eColor_threedhighlight
,
680 eCSSKeyword_threedlightshadow
, nsILookAndFeel::eColor_threedlightshadow
,
681 eCSSKeyword_threedshadow
, nsILookAndFeel::eColor_threedshadow
,
682 eCSSKeyword_window
, nsILookAndFeel::eColor_window
,
683 eCSSKeyword_windowframe
, nsILookAndFeel::eColor_windowframe
,
684 eCSSKeyword_windowtext
, nsILookAndFeel::eColor_windowtext
,
685 eCSSKeyword__moz_activehyperlinktext
, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT
,
686 eCSSKeyword__moz_buttondefault
, nsILookAndFeel::eColor__moz_buttondefault
,
687 eCSSKeyword__moz_buttonhoverface
, nsILookAndFeel::eColor__moz_buttonhoverface
,
688 eCSSKeyword__moz_buttonhovertext
, nsILookAndFeel::eColor__moz_buttonhovertext
,
689 eCSSKeyword__moz_cellhighlight
, nsILookAndFeel::eColor__moz_cellhighlight
,
690 eCSSKeyword__moz_cellhighlighttext
, nsILookAndFeel::eColor__moz_cellhighlighttext
,
691 eCSSKeyword__moz_eventreerow
, nsILookAndFeel::eColor__moz_eventreerow
,
692 eCSSKeyword__moz_field
, nsILookAndFeel::eColor__moz_field
,
693 eCSSKeyword__moz_fieldtext
, nsILookAndFeel::eColor__moz_fieldtext
,
694 eCSSKeyword__moz_dialog
, nsILookAndFeel::eColor__moz_dialog
,
695 eCSSKeyword__moz_dialogtext
, nsILookAndFeel::eColor__moz_dialogtext
,
696 eCSSKeyword__moz_dragtargetzone
, nsILookAndFeel::eColor__moz_dragtargetzone
,
697 eCSSKeyword__moz_hyperlinktext
, NS_COLOR_MOZ_HYPERLINKTEXT
,
698 eCSSKeyword__moz_html_cellhighlight
, nsILookAndFeel::eColor__moz_html_cellhighlight
,
699 eCSSKeyword__moz_html_cellhighlighttext
, nsILookAndFeel::eColor__moz_html_cellhighlighttext
,
700 eCSSKeyword__moz_mac_chrome_active
, nsILookAndFeel::eColor__moz_mac_chrome_active
,
701 eCSSKeyword__moz_mac_chrome_inactive
, nsILookAndFeel::eColor__moz_mac_chrome_inactive
,
702 eCSSKeyword__moz_mac_focusring
, nsILookAndFeel::eColor__moz_mac_focusring
,
703 eCSSKeyword__moz_mac_menuselect
, nsILookAndFeel::eColor__moz_mac_menuselect
,
704 eCSSKeyword__moz_mac_menushadow
, nsILookAndFeel::eColor__moz_mac_menushadow
,
705 eCSSKeyword__moz_mac_menutextdisable
, nsILookAndFeel::eColor__moz_mac_menutextdisable
,
706 eCSSKeyword__moz_mac_menutextselect
, nsILookAndFeel::eColor__moz_mac_menutextselect
,
707 eCSSKeyword__moz_mac_disabledtoolbartext
, nsILookAndFeel::eColor__moz_mac_disabledtoolbartext
,
708 eCSSKeyword__moz_mac_alternateprimaryhighlight
, nsILookAndFeel::eColor__moz_mac_alternateprimaryhighlight
,
709 eCSSKeyword__moz_mac_secondaryhighlight
, nsILookAndFeel::eColor__moz_mac_secondaryhighlight
,
710 eCSSKeyword__moz_menuhover
, nsILookAndFeel::eColor__moz_menuhover
,
711 eCSSKeyword__moz_menuhovertext
, nsILookAndFeel::eColor__moz_menuhovertext
,
712 eCSSKeyword__moz_menubartext
, nsILookAndFeel::eColor__moz_menubartext
,
713 eCSSKeyword__moz_menubarhovertext
, nsILookAndFeel::eColor__moz_menubarhovertext
,
714 eCSSKeyword__moz_oddtreerow
, nsILookAndFeel::eColor__moz_oddtreerow
,
715 eCSSKeyword__moz_visitedhyperlinktext
, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT
,
716 eCSSKeyword_currentcolor
, NS_COLOR_CURRENTCOLOR
,
717 eCSSKeyword__moz_win_mediatext
, nsILookAndFeel::eColor__moz_win_mediatext
,
718 eCSSKeyword__moz_win_communicationstext
, nsILookAndFeel::eColor__moz_win_communicationstext
,
719 eCSSKeyword__moz_nativehyperlinktext
, nsILookAndFeel::eColor__moz_nativehyperlinktext
,
720 eCSSKeyword__moz_comboboxtext
, nsILookAndFeel::eColor__moz_comboboxtext
,
721 eCSSKeyword__moz_combobox
, nsILookAndFeel::eColor__moz_combobox
,
722 eCSSKeyword_UNKNOWN
,-1
725 const PRInt32
nsCSSProps::kContentKTable
[] = {
726 eCSSKeyword_open_quote
, NS_STYLE_CONTENT_OPEN_QUOTE
,
727 eCSSKeyword_close_quote
, NS_STYLE_CONTENT_CLOSE_QUOTE
,
728 eCSSKeyword_no_open_quote
, NS_STYLE_CONTENT_NO_OPEN_QUOTE
,
729 eCSSKeyword_no_close_quote
, NS_STYLE_CONTENT_NO_CLOSE_QUOTE
,
730 eCSSKeyword__moz_alt_content
, NS_STYLE_CONTENT_ALT_CONTENT
,
731 eCSSKeyword_UNKNOWN
,-1
734 const PRInt32
nsCSSProps::kCursorKTable
[] = {
736 eCSSKeyword_auto
, NS_STYLE_CURSOR_AUTO
,
737 eCSSKeyword_crosshair
, NS_STYLE_CURSOR_CROSSHAIR
,
738 eCSSKeyword_default
, NS_STYLE_CURSOR_DEFAULT
,
739 eCSSKeyword_pointer
, NS_STYLE_CURSOR_POINTER
,
740 eCSSKeyword_move
, NS_STYLE_CURSOR_MOVE
,
741 eCSSKeyword_e_resize
, NS_STYLE_CURSOR_E_RESIZE
,
742 eCSSKeyword_ne_resize
, NS_STYLE_CURSOR_NE_RESIZE
,
743 eCSSKeyword_nw_resize
, NS_STYLE_CURSOR_NW_RESIZE
,
744 eCSSKeyword_n_resize
, NS_STYLE_CURSOR_N_RESIZE
,
745 eCSSKeyword_se_resize
, NS_STYLE_CURSOR_SE_RESIZE
,
746 eCSSKeyword_sw_resize
, NS_STYLE_CURSOR_SW_RESIZE
,
747 eCSSKeyword_s_resize
, NS_STYLE_CURSOR_S_RESIZE
,
748 eCSSKeyword_w_resize
, NS_STYLE_CURSOR_W_RESIZE
,
749 eCSSKeyword_text
, NS_STYLE_CURSOR_TEXT
,
750 eCSSKeyword_wait
, NS_STYLE_CURSOR_WAIT
,
751 eCSSKeyword_help
, NS_STYLE_CURSOR_HELP
,
753 eCSSKeyword_progress
, NS_STYLE_CURSOR_SPINNING
,
754 // CSS3 basic user interface module
755 eCSSKeyword_copy
, NS_STYLE_CURSOR_COPY
,
756 eCSSKeyword_alias
, NS_STYLE_CURSOR_ALIAS
,
757 eCSSKeyword_context_menu
, NS_STYLE_CURSOR_CONTEXT_MENU
,
758 eCSSKeyword_cell
, NS_STYLE_CURSOR_CELL
,
759 eCSSKeyword_not_allowed
, NS_STYLE_CURSOR_NOT_ALLOWED
,
760 eCSSKeyword_col_resize
, NS_STYLE_CURSOR_COL_RESIZE
,
761 eCSSKeyword_row_resize
, NS_STYLE_CURSOR_ROW_RESIZE
,
762 eCSSKeyword_no_drop
, NS_STYLE_CURSOR_NO_DROP
,
763 eCSSKeyword_vertical_text
, NS_STYLE_CURSOR_VERTICAL_TEXT
,
764 eCSSKeyword_all_scroll
, NS_STYLE_CURSOR_ALL_SCROLL
,
765 eCSSKeyword_nesw_resize
, NS_STYLE_CURSOR_NESW_RESIZE
,
766 eCSSKeyword_nwse_resize
, NS_STYLE_CURSOR_NWSE_RESIZE
,
767 eCSSKeyword_ns_resize
, NS_STYLE_CURSOR_NS_RESIZE
,
768 eCSSKeyword_ew_resize
, NS_STYLE_CURSOR_EW_RESIZE
,
769 eCSSKeyword_none
, NS_STYLE_CURSOR_NONE
,
770 // -moz- prefixed vendor specific
771 eCSSKeyword__moz_grab
, NS_STYLE_CURSOR_GRAB
,
772 eCSSKeyword__moz_grabbing
, NS_STYLE_CURSOR_GRABBING
,
773 eCSSKeyword__moz_zoom_in
, NS_STYLE_CURSOR_MOZ_ZOOM_IN
,
774 eCSSKeyword__moz_zoom_out
, NS_STYLE_CURSOR_MOZ_ZOOM_OUT
,
775 eCSSKeyword_UNKNOWN
,-1
778 const PRInt32
nsCSSProps::kDirectionKTable
[] = {
779 eCSSKeyword_ltr
, NS_STYLE_DIRECTION_LTR
,
780 eCSSKeyword_rtl
, NS_STYLE_DIRECTION_RTL
,
781 eCSSKeyword_UNKNOWN
,-1
784 const PRInt32
nsCSSProps::kDisplayKTable
[] = {
785 eCSSKeyword_none
, NS_STYLE_DISPLAY_NONE
,
786 eCSSKeyword_inline
, NS_STYLE_DISPLAY_INLINE
,
787 eCSSKeyword_block
, NS_STYLE_DISPLAY_BLOCK
,
788 eCSSKeyword_inline_block
, NS_STYLE_DISPLAY_INLINE_BLOCK
,
789 eCSSKeyword_list_item
, NS_STYLE_DISPLAY_LIST_ITEM
,
790 eCSSKeyword__moz_run_in
, NS_STYLE_DISPLAY_RUN_IN
,
791 eCSSKeyword__moz_compact
, NS_STYLE_DISPLAY_COMPACT
,
792 eCSSKeyword__moz_marker
, NS_STYLE_DISPLAY_MARKER
,
793 eCSSKeyword_table
, NS_STYLE_DISPLAY_TABLE
,
794 eCSSKeyword_inline_table
, NS_STYLE_DISPLAY_INLINE_TABLE
,
795 eCSSKeyword_table_row_group
, NS_STYLE_DISPLAY_TABLE_ROW_GROUP
,
796 eCSSKeyword_table_header_group
, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP
,
797 eCSSKeyword_table_footer_group
, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP
,
798 eCSSKeyword_table_row
, NS_STYLE_DISPLAY_TABLE_ROW
,
799 eCSSKeyword_table_column_group
, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP
,
800 eCSSKeyword_table_column
, NS_STYLE_DISPLAY_TABLE_COLUMN
,
801 eCSSKeyword_table_cell
, NS_STYLE_DISPLAY_TABLE_CELL
,
802 eCSSKeyword_table_caption
, NS_STYLE_DISPLAY_TABLE_CAPTION
,
803 // Make sure this is kept in sync with the code in
804 // nsCSSFrameConstructor::ConstructXULFrame
805 eCSSKeyword__moz_box
, NS_STYLE_DISPLAY_BOX
,
806 eCSSKeyword__moz_inline_box
, NS_STYLE_DISPLAY_INLINE_BOX
,
808 eCSSKeyword__moz_grid
, NS_STYLE_DISPLAY_GRID
,
809 eCSSKeyword__moz_inline_grid
, NS_STYLE_DISPLAY_INLINE_GRID
,
810 eCSSKeyword__moz_grid_group
, NS_STYLE_DISPLAY_GRID_GROUP
,
811 eCSSKeyword__moz_grid_line
, NS_STYLE_DISPLAY_GRID_LINE
,
812 eCSSKeyword__moz_stack
, NS_STYLE_DISPLAY_STACK
,
813 eCSSKeyword__moz_inline_stack
, NS_STYLE_DISPLAY_INLINE_STACK
,
814 eCSSKeyword__moz_deck
, NS_STYLE_DISPLAY_DECK
,
815 eCSSKeyword__moz_popup
, NS_STYLE_DISPLAY_POPUP
,
816 eCSSKeyword__moz_groupbox
, NS_STYLE_DISPLAY_GROUPBOX
,
818 eCSSKeyword_UNKNOWN
,-1
821 const PRInt32
nsCSSProps::kElevationKTable
[] = {
822 eCSSKeyword_below
, NS_STYLE_ELEVATION_BELOW
,
823 eCSSKeyword_level
, NS_STYLE_ELEVATION_LEVEL
,
824 eCSSKeyword_above
, NS_STYLE_ELEVATION_ABOVE
,
825 eCSSKeyword_higher
, NS_STYLE_ELEVATION_HIGHER
,
826 eCSSKeyword_lower
, NS_STYLE_ELEVATION_LOWER
,
827 eCSSKeyword_UNKNOWN
,-1
830 const PRInt32
nsCSSProps::kEmptyCellsKTable
[] = {
831 eCSSKeyword_show
, NS_STYLE_TABLE_EMPTY_CELLS_SHOW
,
832 eCSSKeyword_hide
, NS_STYLE_TABLE_EMPTY_CELLS_HIDE
,
833 eCSSKeyword__moz_show_background
, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND
,
834 eCSSKeyword_UNKNOWN
,-1
837 const PRInt32
nsCSSProps::kFloatKTable
[] = {
838 eCSSKeyword_none
, NS_STYLE_FLOAT_NONE
,
839 eCSSKeyword_left
, NS_STYLE_FLOAT_LEFT
,
840 eCSSKeyword_right
, NS_STYLE_FLOAT_RIGHT
,
841 eCSSKeyword_UNKNOWN
,-1
844 const PRInt32
nsCSSProps::kFloatEdgeKTable
[] = {
845 eCSSKeyword_content_box
, NS_STYLE_FLOAT_EDGE_CONTENT
,
846 eCSSKeyword_margin_box
, NS_STYLE_FLOAT_EDGE_MARGIN
,
847 eCSSKeyword_UNKNOWN
,-1
850 const PRInt32
nsCSSProps::kFontKTable
[] = {
852 eCSSKeyword_caption
, NS_STYLE_FONT_CAPTION
,
853 eCSSKeyword_icon
, NS_STYLE_FONT_ICON
,
854 eCSSKeyword_menu
, NS_STYLE_FONT_MENU
,
855 eCSSKeyword_message_box
, NS_STYLE_FONT_MESSAGE_BOX
,
856 eCSSKeyword_small_caption
, NS_STYLE_FONT_SMALL_CAPTION
,
857 eCSSKeyword_status_bar
, NS_STYLE_FONT_STATUS_BAR
,
859 // Proposed for CSS3.
860 eCSSKeyword__moz_window
, NS_STYLE_FONT_WINDOW
,
861 eCSSKeyword__moz_document
, NS_STYLE_FONT_DOCUMENT
,
862 eCSSKeyword__moz_workspace
, NS_STYLE_FONT_WORKSPACE
,
863 eCSSKeyword__moz_desktop
, NS_STYLE_FONT_DESKTOP
,
864 eCSSKeyword__moz_info
, NS_STYLE_FONT_INFO
,
865 eCSSKeyword__moz_dialog
, NS_STYLE_FONT_DIALOG
,
866 eCSSKeyword__moz_button
, NS_STYLE_FONT_BUTTON
,
867 eCSSKeyword__moz_pull_down_menu
, NS_STYLE_FONT_PULL_DOWN_MENU
,
868 eCSSKeyword__moz_list
, NS_STYLE_FONT_LIST
,
869 eCSSKeyword__moz_field
, NS_STYLE_FONT_FIELD
,
870 eCSSKeyword_UNKNOWN
,-1
873 const PRInt32
nsCSSProps::kFontSizeKTable
[] = {
874 eCSSKeyword_xx_small
, NS_STYLE_FONT_SIZE_XXSMALL
,
875 eCSSKeyword_x_small
, NS_STYLE_FONT_SIZE_XSMALL
,
876 eCSSKeyword_small
, NS_STYLE_FONT_SIZE_SMALL
,
877 eCSSKeyword_medium
, NS_STYLE_FONT_SIZE_MEDIUM
,
878 eCSSKeyword_large
, NS_STYLE_FONT_SIZE_LARGE
,
879 eCSSKeyword_x_large
, NS_STYLE_FONT_SIZE_XLARGE
,
880 eCSSKeyword_xx_large
, NS_STYLE_FONT_SIZE_XXLARGE
,
881 eCSSKeyword_larger
, NS_STYLE_FONT_SIZE_LARGER
,
882 eCSSKeyword_smaller
, NS_STYLE_FONT_SIZE_SMALLER
,
883 eCSSKeyword_UNKNOWN
,-1
886 const PRInt32
nsCSSProps::kFontStretchKTable
[] = {
887 eCSSKeyword_wider
, NS_STYLE_FONT_STRETCH_WIDER
,
888 eCSSKeyword_narrower
, NS_STYLE_FONT_STRETCH_NARROWER
,
889 eCSSKeyword_ultra_condensed
, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED
,
890 eCSSKeyword_extra_condensed
, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED
,
891 eCSSKeyword_condensed
, NS_STYLE_FONT_STRETCH_CONDENSED
,
892 eCSSKeyword_semi_condensed
, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED
,
893 eCSSKeyword_normal
, NS_STYLE_FONT_STRETCH_NORMAL
,
894 eCSSKeyword_semi_expanded
, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED
,
895 eCSSKeyword_expanded
, NS_STYLE_FONT_STRETCH_EXPANDED
,
896 eCSSKeyword_extra_expanded
, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED
,
897 eCSSKeyword_ultra_expanded
, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED
,
898 eCSSKeyword_UNKNOWN
,-1
901 const PRInt32
nsCSSProps::kFontStyleKTable
[] = {
902 eCSSKeyword_normal
, NS_STYLE_FONT_STYLE_NORMAL
,
903 eCSSKeyword_italic
, NS_STYLE_FONT_STYLE_ITALIC
,
904 eCSSKeyword_oblique
, NS_STYLE_FONT_STYLE_OBLIQUE
,
905 eCSSKeyword_UNKNOWN
,-1
908 const PRInt32
nsCSSProps::kFontVariantKTable
[] = {
909 eCSSKeyword_normal
, NS_STYLE_FONT_VARIANT_NORMAL
,
910 eCSSKeyword_small_caps
, NS_STYLE_FONT_VARIANT_SMALL_CAPS
,
911 eCSSKeyword_UNKNOWN
,-1
914 const PRInt32
nsCSSProps::kFontWeightKTable
[] = {
915 eCSSKeyword_normal
, NS_STYLE_FONT_WEIGHT_NORMAL
,
916 eCSSKeyword_bold
, NS_STYLE_FONT_WEIGHT_BOLD
,
917 eCSSKeyword_bolder
, NS_STYLE_FONT_WEIGHT_BOLDER
,
918 eCSSKeyword_lighter
, NS_STYLE_FONT_WEIGHT_LIGHTER
,
919 eCSSKeyword_UNKNOWN
,-1
922 const PRInt32
nsCSSProps::kIMEModeKTable
[] = {
923 eCSSKeyword_normal
, NS_STYLE_IME_MODE_NORMAL
,
924 eCSSKeyword_auto
, NS_STYLE_IME_MODE_AUTO
,
925 eCSSKeyword_active
, NS_STYLE_IME_MODE_ACTIVE
,
926 eCSSKeyword_disabled
, NS_STYLE_IME_MODE_DISABLED
,
927 eCSSKeyword_inactive
, NS_STYLE_IME_MODE_INACTIVE
,
928 eCSSKeyword_UNKNOWN
,-1
931 const PRInt32
nsCSSProps::kLineHeightKTable
[] = {
932 // -moz- prefixed, intended for internal use for single-line controls
933 eCSSKeyword__moz_block_height
, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT
,
934 eCSSKeyword_UNKNOWN
,-1
937 const PRInt32
nsCSSProps::kListStylePositionKTable
[] = {
938 eCSSKeyword_inside
, NS_STYLE_LIST_STYLE_POSITION_INSIDE
,
939 eCSSKeyword_outside
, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE
,
940 eCSSKeyword_UNKNOWN
,-1
943 const PRInt32
nsCSSProps::kListStyleKTable
[] = {
944 eCSSKeyword_none
, NS_STYLE_LIST_STYLE_NONE
,
945 eCSSKeyword_disc
, NS_STYLE_LIST_STYLE_DISC
,
946 eCSSKeyword_circle
, NS_STYLE_LIST_STYLE_CIRCLE
,
947 eCSSKeyword_square
, NS_STYLE_LIST_STYLE_SQUARE
,
948 eCSSKeyword_decimal
, NS_STYLE_LIST_STYLE_DECIMAL
,
949 eCSSKeyword_decimal_leading_zero
, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO
,
950 eCSSKeyword_lower_roman
, NS_STYLE_LIST_STYLE_LOWER_ROMAN
,
951 eCSSKeyword_upper_roman
, NS_STYLE_LIST_STYLE_UPPER_ROMAN
,
952 eCSSKeyword_lower_greek
, NS_STYLE_LIST_STYLE_LOWER_GREEK
,
953 eCSSKeyword_lower_alpha
, NS_STYLE_LIST_STYLE_LOWER_ALPHA
,
954 eCSSKeyword_lower_latin
, NS_STYLE_LIST_STYLE_LOWER_LATIN
,
955 eCSSKeyword_upper_alpha
, NS_STYLE_LIST_STYLE_UPPER_ALPHA
,
956 eCSSKeyword_upper_latin
, NS_STYLE_LIST_STYLE_UPPER_LATIN
,
957 eCSSKeyword_hebrew
, NS_STYLE_LIST_STYLE_HEBREW
,
958 eCSSKeyword_armenian
, NS_STYLE_LIST_STYLE_ARMENIAN
,
959 eCSSKeyword_georgian
, NS_STYLE_LIST_STYLE_GEORGIAN
,
960 eCSSKeyword_cjk_ideographic
, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC
,
961 eCSSKeyword_hiragana
, NS_STYLE_LIST_STYLE_HIRAGANA
,
962 eCSSKeyword_katakana
, NS_STYLE_LIST_STYLE_KATAKANA
,
963 eCSSKeyword_hiragana_iroha
, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA
,
964 eCSSKeyword_katakana_iroha
, NS_STYLE_LIST_STYLE_KATAKANA_IROHA
,
965 eCSSKeyword__moz_cjk_heavenly_stem
, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM
,
966 eCSSKeyword__moz_cjk_earthly_branch
, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH
,
967 eCSSKeyword__moz_trad_chinese_informal
, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL
,
968 eCSSKeyword__moz_trad_chinese_formal
, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL
,
969 eCSSKeyword__moz_simp_chinese_informal
, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL
,
970 eCSSKeyword__moz_simp_chinese_formal
, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL
,
971 eCSSKeyword__moz_japanese_informal
, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL
,
972 eCSSKeyword__moz_japanese_formal
, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL
,
973 eCSSKeyword__moz_arabic_indic
, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC
,
974 eCSSKeyword__moz_persian
, NS_STYLE_LIST_STYLE_MOZ_PERSIAN
,
975 eCSSKeyword__moz_urdu
, NS_STYLE_LIST_STYLE_MOZ_URDU
,
976 eCSSKeyword__moz_devanagari
, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI
,
977 eCSSKeyword__moz_gurmukhi
, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI
,
978 eCSSKeyword__moz_gujarati
, NS_STYLE_LIST_STYLE_MOZ_GUJARATI
,
979 eCSSKeyword__moz_oriya
, NS_STYLE_LIST_STYLE_MOZ_ORIYA
,
980 eCSSKeyword__moz_kannada
, NS_STYLE_LIST_STYLE_MOZ_KANNADA
,
981 eCSSKeyword__moz_malayalam
, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM
,
982 eCSSKeyword__moz_bengali
, NS_STYLE_LIST_STYLE_MOZ_BENGALI
,
983 eCSSKeyword__moz_tamil
, NS_STYLE_LIST_STYLE_MOZ_TAMIL
,
984 eCSSKeyword__moz_telugu
, NS_STYLE_LIST_STYLE_MOZ_TELUGU
,
985 eCSSKeyword__moz_thai
, NS_STYLE_LIST_STYLE_MOZ_THAI
,
986 eCSSKeyword__moz_lao
, NS_STYLE_LIST_STYLE_MOZ_LAO
,
987 eCSSKeyword__moz_myanmar
, NS_STYLE_LIST_STYLE_MOZ_MYANMAR
,
988 eCSSKeyword__moz_khmer
, NS_STYLE_LIST_STYLE_MOZ_KHMER
,
989 eCSSKeyword__moz_hangul
, NS_STYLE_LIST_STYLE_MOZ_HANGUL
,
990 eCSSKeyword__moz_hangul_consonant
, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT
,
991 eCSSKeyword__moz_ethiopic_halehame
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME
,
992 eCSSKeyword__moz_ethiopic_numeric
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC
,
993 eCSSKeyword__moz_ethiopic_halehame_am
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM
,
994 eCSSKeyword__moz_ethiopic_halehame_ti_er
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER
,
995 eCSSKeyword__moz_ethiopic_halehame_ti_et
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET
,
996 eCSSKeyword_UNKNOWN
,-1
999 // Same as kBorderStyleKTable except 'hidden'.
1000 const PRInt32
nsCSSProps::kOutlineStyleKTable
[] = {
1001 eCSSKeyword_none
, NS_STYLE_BORDER_STYLE_NONE
,
1002 eCSSKeyword_auto
, NS_STYLE_BORDER_STYLE_AUTO
,
1003 eCSSKeyword_dotted
, NS_STYLE_BORDER_STYLE_DOTTED
,
1004 eCSSKeyword_dashed
, NS_STYLE_BORDER_STYLE_DASHED
,
1005 eCSSKeyword_solid
, NS_STYLE_BORDER_STYLE_SOLID
,
1006 eCSSKeyword_double
, NS_STYLE_BORDER_STYLE_DOUBLE
,
1007 eCSSKeyword_groove
, NS_STYLE_BORDER_STYLE_GROOVE
,
1008 eCSSKeyword_ridge
, NS_STYLE_BORDER_STYLE_RIDGE
,
1009 eCSSKeyword_inset
, NS_STYLE_BORDER_STYLE_INSET
,
1010 eCSSKeyword_outset
, NS_STYLE_BORDER_STYLE_OUTSET
,
1011 eCSSKeyword_UNKNOWN
,-1
1014 const PRInt32
nsCSSProps::kOutlineColorKTable
[] = {
1015 #ifdef GFX_HAS_INVERT
1016 eCSSKeyword_invert
, NS_STYLE_COLOR_INVERT
,
1018 eCSSKeyword__moz_use_text_color
, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR
,
1020 eCSSKeyword_UNKNOWN
,-1
1023 const PRInt32
nsCSSProps::kOverflowKTable
[] = {
1024 eCSSKeyword_auto
, NS_STYLE_OVERFLOW_AUTO
,
1025 eCSSKeyword_visible
, NS_STYLE_OVERFLOW_VISIBLE
,
1026 eCSSKeyword_hidden
, NS_STYLE_OVERFLOW_HIDDEN
,
1027 eCSSKeyword_scroll
, NS_STYLE_OVERFLOW_SCROLL
,
1029 eCSSKeyword__moz_scrollbars_none
, NS_STYLE_OVERFLOW_HIDDEN
,
1030 eCSSKeyword__moz_scrollbars_horizontal
, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL
,
1031 eCSSKeyword__moz_scrollbars_vertical
, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL
,
1032 eCSSKeyword__moz_hidden_unscrollable
, NS_STYLE_OVERFLOW_CLIP
,
1033 eCSSKeyword_UNKNOWN
,-1
1036 const PRInt32
nsCSSProps::kOverflowSubKTable
[] = {
1037 eCSSKeyword_auto
, NS_STYLE_OVERFLOW_AUTO
,
1038 eCSSKeyword_visible
, NS_STYLE_OVERFLOW_VISIBLE
,
1039 eCSSKeyword_hidden
, NS_STYLE_OVERFLOW_HIDDEN
,
1040 eCSSKeyword_scroll
, NS_STYLE_OVERFLOW_SCROLL
,
1042 eCSSKeyword__moz_hidden_unscrollable
, NS_STYLE_OVERFLOW_CLIP
,
1043 eCSSKeyword_UNKNOWN
,-1
1046 const PRInt32
nsCSSProps::kPageBreakKTable
[] = {
1047 eCSSKeyword_auto
, NS_STYLE_PAGE_BREAK_AUTO
,
1048 eCSSKeyword_always
, NS_STYLE_PAGE_BREAK_ALWAYS
,
1049 eCSSKeyword_avoid
, NS_STYLE_PAGE_BREAK_AVOID
,
1050 eCSSKeyword_left
, NS_STYLE_PAGE_BREAK_LEFT
,
1051 eCSSKeyword_right
, NS_STYLE_PAGE_BREAK_RIGHT
,
1052 eCSSKeyword_UNKNOWN
,-1
1055 const PRInt32
nsCSSProps::kPageBreakInsideKTable
[] = {
1056 eCSSKeyword_auto
, NS_STYLE_PAGE_BREAK_AUTO
,
1057 eCSSKeyword_avoid
, NS_STYLE_PAGE_BREAK_AVOID
,
1058 eCSSKeyword_UNKNOWN
,-1
1061 const PRInt32
nsCSSProps::kPageMarksKTable
[] = {
1062 eCSSKeyword_none
, NS_STYLE_PAGE_MARKS_NONE
,
1063 eCSSKeyword_crop
, NS_STYLE_PAGE_MARKS_CROP
,
1064 eCSSKeyword_cross
, NS_STYLE_PAGE_MARKS_REGISTER
,
1065 eCSSKeyword_UNKNOWN
,-1
1068 const PRInt32
nsCSSProps::kPageSizeKTable
[] = {
1069 eCSSKeyword_landscape
, NS_STYLE_PAGE_SIZE_LANDSCAPE
,
1070 eCSSKeyword_portrait
, NS_STYLE_PAGE_SIZE_PORTRAIT
,
1071 eCSSKeyword_UNKNOWN
,-1
1074 const PRInt32
nsCSSProps::kPitchKTable
[] = {
1075 eCSSKeyword_x_low
, NS_STYLE_PITCH_X_LOW
,
1076 eCSSKeyword_low
, NS_STYLE_PITCH_LOW
,
1077 eCSSKeyword_medium
, NS_STYLE_PITCH_MEDIUM
,
1078 eCSSKeyword_high
, NS_STYLE_PITCH_HIGH
,
1079 eCSSKeyword_x_high
, NS_STYLE_PITCH_X_HIGH
,
1080 eCSSKeyword_UNKNOWN
,-1
1083 const PRInt32
nsCSSProps::kPointerEventsKTable
[] = {
1084 eCSSKeyword_none
, NS_STYLE_POINTER_EVENTS_NONE
,
1085 eCSSKeyword_visiblepainted
, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED
,
1086 eCSSKeyword_visiblefill
, NS_STYLE_POINTER_EVENTS_VISIBLEFILL
,
1087 eCSSKeyword_visiblestroke
, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE
,
1088 eCSSKeyword_visible
, NS_STYLE_POINTER_EVENTS_VISIBLE
,
1089 eCSSKeyword_painted
, NS_STYLE_POINTER_EVENTS_PAINTED
,
1090 eCSSKeyword_fill
, NS_STYLE_POINTER_EVENTS_FILL
,
1091 eCSSKeyword_stroke
, NS_STYLE_POINTER_EVENTS_STROKE
,
1092 eCSSKeyword_all
, NS_STYLE_POINTER_EVENTS_ALL
,
1093 eCSSKeyword_auto
, NS_STYLE_POINTER_EVENTS_AUTO
,
1094 eCSSKeyword_UNKNOWN
, -1
1097 const PRInt32
nsCSSProps::kPositionKTable
[] = {
1098 eCSSKeyword_static
, NS_STYLE_POSITION_STATIC
,
1099 eCSSKeyword_relative
, NS_STYLE_POSITION_RELATIVE
,
1100 eCSSKeyword_absolute
, NS_STYLE_POSITION_ABSOLUTE
,
1101 eCSSKeyword_fixed
, NS_STYLE_POSITION_FIXED
,
1102 eCSSKeyword_UNKNOWN
,-1
1105 const PRInt32
nsCSSProps::kRadialGradientShapeKTable
[] = {
1106 eCSSKeyword_circle
, NS_STYLE_GRADIENT_SHAPE_CIRCULAR
,
1107 eCSSKeyword_ellipse
, NS_STYLE_GRADIENT_SHAPE_ELLIPTICAL
,
1108 eCSSKeyword_UNKNOWN
,-1
1111 const PRInt32
nsCSSProps::kRadialGradientSizeKTable
[] = {
1112 eCSSKeyword_closest_side
, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE
,
1113 eCSSKeyword_closest_corner
, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER
,
1114 eCSSKeyword_farthest_side
, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE
,
1115 eCSSKeyword_farthest_corner
, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER
,
1117 eCSSKeyword_contain
, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE
,
1118 eCSSKeyword_cover
, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER
,
1119 eCSSKeyword_UNKNOWN
,-1
1122 const PRInt32
nsCSSProps::kResizeKTable
[] = {
1123 eCSSKeyword_none
, NS_STYLE_RESIZE_NONE
,
1124 eCSSKeyword_both
, NS_STYLE_RESIZE_BOTH
,
1125 eCSSKeyword_horizontal
, NS_STYLE_RESIZE_HORIZONTAL
,
1126 eCSSKeyword_vertical
, NS_STYLE_RESIZE_VERTICAL
,
1127 eCSSKeyword_UNKNOWN
,-1
1130 const PRInt32
nsCSSProps::kSpeakKTable
[] = {
1131 eCSSKeyword_none
, NS_STYLE_SPEAK_NONE
,
1132 eCSSKeyword_normal
, NS_STYLE_SPEAK_NORMAL
,
1133 eCSSKeyword_spell_out
, NS_STYLE_SPEAK_SPELL_OUT
,
1134 eCSSKeyword_UNKNOWN
,-1
1137 const PRInt32
nsCSSProps::kSpeakHeaderKTable
[] = {
1138 eCSSKeyword_once
, NS_STYLE_SPEAK_HEADER_ONCE
,
1139 eCSSKeyword_always
, NS_STYLE_SPEAK_HEADER_ALWAYS
,
1140 eCSSKeyword_UNKNOWN
,-1
1143 const PRInt32
nsCSSProps::kSpeakNumeralKTable
[] = {
1144 eCSSKeyword_digits
, NS_STYLE_SPEAK_NUMERAL_DIGITS
,
1145 eCSSKeyword_continuous
, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS
,
1146 eCSSKeyword_UNKNOWN
,-1
1149 const PRInt32
nsCSSProps::kSpeakPunctuationKTable
[] = {
1150 eCSSKeyword_none
, NS_STYLE_SPEAK_PUNCTUATION_NONE
,
1151 eCSSKeyword_code
, NS_STYLE_SPEAK_PUNCTUATION_CODE
,
1152 eCSSKeyword_UNKNOWN
,-1
1155 const PRInt32
nsCSSProps::kSpeechRateKTable
[] = {
1156 eCSSKeyword_x_slow
, NS_STYLE_SPEECH_RATE_X_SLOW
,
1157 eCSSKeyword_slow
, NS_STYLE_SPEECH_RATE_SLOW
,
1158 eCSSKeyword_medium
, NS_STYLE_SPEECH_RATE_MEDIUM
,
1159 eCSSKeyword_fast
, NS_STYLE_SPEECH_RATE_FAST
,
1160 eCSSKeyword_x_fast
, NS_STYLE_SPEECH_RATE_X_FAST
,
1161 eCSSKeyword_faster
, NS_STYLE_SPEECH_RATE_FASTER
,
1162 eCSSKeyword_slower
, NS_STYLE_SPEECH_RATE_SLOWER
,
1163 eCSSKeyword_UNKNOWN
,-1
1166 const PRInt32
nsCSSProps::kStackSizingKTable
[] = {
1167 eCSSKeyword_ignore
, NS_STYLE_STACK_SIZING_IGNORE
,
1168 eCSSKeyword_stretch_to_fit
, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT
,
1169 eCSSKeyword_UNKNOWN
,-1
1172 const PRInt32
nsCSSProps::kTableLayoutKTable
[] = {
1173 eCSSKeyword_auto
, NS_STYLE_TABLE_LAYOUT_AUTO
,
1174 eCSSKeyword_fixed
, NS_STYLE_TABLE_LAYOUT_FIXED
,
1175 eCSSKeyword_UNKNOWN
,-1
1178 const PRInt32
nsCSSProps::kTextAlignKTable
[] = {
1179 eCSSKeyword_left
, NS_STYLE_TEXT_ALIGN_LEFT
,
1180 eCSSKeyword_right
, NS_STYLE_TEXT_ALIGN_RIGHT
,
1181 eCSSKeyword_center
, NS_STYLE_TEXT_ALIGN_CENTER
,
1182 eCSSKeyword_justify
, NS_STYLE_TEXT_ALIGN_JUSTIFY
,
1183 eCSSKeyword__moz_center
, NS_STYLE_TEXT_ALIGN_MOZ_CENTER
,
1184 eCSSKeyword__moz_right
, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT
,
1185 eCSSKeyword__moz_left
, NS_STYLE_TEXT_ALIGN_MOZ_LEFT
,
1186 eCSSKeyword_start
, NS_STYLE_TEXT_ALIGN_DEFAULT
,
1187 eCSSKeyword_end
, NS_STYLE_TEXT_ALIGN_END
,
1188 eCSSKeyword_UNKNOWN
,-1
1191 const PRInt32
nsCSSProps::kTextDecorationKTable
[] = {
1192 eCSSKeyword_none
, NS_STYLE_TEXT_DECORATION_NONE
,
1193 eCSSKeyword_underline
, NS_STYLE_TEXT_DECORATION_UNDERLINE
,
1194 eCSSKeyword_overline
, NS_STYLE_TEXT_DECORATION_OVERLINE
,
1195 eCSSKeyword_line_through
, NS_STYLE_TEXT_DECORATION_LINE_THROUGH
,
1196 eCSSKeyword_blink
, NS_STYLE_TEXT_DECORATION_BLINK
,
1197 eCSSKeyword__moz_anchor_decoration
, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS
,
1198 eCSSKeyword_UNKNOWN
,-1
1201 const PRInt32
nsCSSProps::kTextTransformKTable
[] = {
1202 eCSSKeyword_none
, NS_STYLE_TEXT_TRANSFORM_NONE
,
1203 eCSSKeyword_capitalize
, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE
,
1204 eCSSKeyword_lowercase
, NS_STYLE_TEXT_TRANSFORM_LOWERCASE
,
1205 eCSSKeyword_uppercase
, NS_STYLE_TEXT_TRANSFORM_UPPERCASE
,
1206 eCSSKeyword_UNKNOWN
,-1
1209 const PRInt32
nsCSSProps::kTransitionTimingFunctionKTable
[] = {
1210 eCSSKeyword_ease
, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE
,
1211 eCSSKeyword_linear
, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR
,
1212 eCSSKeyword_ease_in
, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN
,
1213 eCSSKeyword_ease_out
, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_OUT
,
1214 eCSSKeyword_ease_in_out
, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT
,
1215 eCSSKeyword_UNKNOWN
,-1
1218 const PRInt32
nsCSSProps::kUnicodeBidiKTable
[] = {
1219 eCSSKeyword_normal
, NS_STYLE_UNICODE_BIDI_NORMAL
,
1220 eCSSKeyword_embed
, NS_STYLE_UNICODE_BIDI_EMBED
,
1221 eCSSKeyword_bidi_override
, NS_STYLE_UNICODE_BIDI_OVERRIDE
,
1222 eCSSKeyword_UNKNOWN
,-1
1225 const PRInt32
nsCSSProps::kUserFocusKTable
[] = {
1226 eCSSKeyword_none
, NS_STYLE_USER_FOCUS_NONE
,
1227 eCSSKeyword_normal
, NS_STYLE_USER_FOCUS_NORMAL
,
1228 eCSSKeyword_ignore
, NS_STYLE_USER_FOCUS_IGNORE
,
1229 eCSSKeyword_select_all
, NS_STYLE_USER_FOCUS_SELECT_ALL
,
1230 eCSSKeyword_select_before
, NS_STYLE_USER_FOCUS_SELECT_BEFORE
,
1231 eCSSKeyword_select_after
, NS_STYLE_USER_FOCUS_SELECT_AFTER
,
1232 eCSSKeyword_select_same
, NS_STYLE_USER_FOCUS_SELECT_SAME
,
1233 eCSSKeyword_select_menu
, NS_STYLE_USER_FOCUS_SELECT_MENU
,
1234 eCSSKeyword_UNKNOWN
,-1
1237 const PRInt32
nsCSSProps::kUserInputKTable
[] = {
1238 eCSSKeyword_none
, NS_STYLE_USER_INPUT_NONE
,
1239 eCSSKeyword_auto
, NS_STYLE_USER_INPUT_AUTO
,
1240 eCSSKeyword_enabled
, NS_STYLE_USER_INPUT_ENABLED
,
1241 eCSSKeyword_disabled
, NS_STYLE_USER_INPUT_DISABLED
,
1242 eCSSKeyword_UNKNOWN
,-1
1245 const PRInt32
nsCSSProps::kUserModifyKTable
[] = {
1246 eCSSKeyword_read_only
, NS_STYLE_USER_MODIFY_READ_ONLY
,
1247 eCSSKeyword_read_write
, NS_STYLE_USER_MODIFY_READ_WRITE
,
1248 eCSSKeyword_write_only
, NS_STYLE_USER_MODIFY_WRITE_ONLY
,
1249 eCSSKeyword_UNKNOWN
,-1
1252 const PRInt32
nsCSSProps::kUserSelectKTable
[] = {
1253 eCSSKeyword_none
, NS_STYLE_USER_SELECT_NONE
,
1254 eCSSKeyword_auto
, NS_STYLE_USER_SELECT_AUTO
,
1255 eCSSKeyword_text
, NS_STYLE_USER_SELECT_TEXT
,
1256 eCSSKeyword_element
, NS_STYLE_USER_SELECT_ELEMENT
,
1257 eCSSKeyword_elements
, NS_STYLE_USER_SELECT_ELEMENTS
,
1258 eCSSKeyword_all
, NS_STYLE_USER_SELECT_ALL
,
1259 eCSSKeyword_toggle
, NS_STYLE_USER_SELECT_TOGGLE
,
1260 eCSSKeyword_tri_state
, NS_STYLE_USER_SELECT_TRI_STATE
,
1261 eCSSKeyword__moz_all
, NS_STYLE_USER_SELECT_MOZ_ALL
,
1262 eCSSKeyword__moz_none
, NS_STYLE_USER_SELECT_MOZ_NONE
,
1263 eCSSKeyword_UNKNOWN
,-1
1266 const PRInt32
nsCSSProps::kVerticalAlignKTable
[] = {
1267 eCSSKeyword_baseline
, NS_STYLE_VERTICAL_ALIGN_BASELINE
,
1268 eCSSKeyword_sub
, NS_STYLE_VERTICAL_ALIGN_SUB
,
1269 eCSSKeyword_super
, NS_STYLE_VERTICAL_ALIGN_SUPER
,
1270 eCSSKeyword_top
, NS_STYLE_VERTICAL_ALIGN_TOP
,
1271 eCSSKeyword_text_top
, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP
,
1272 eCSSKeyword_middle
, NS_STYLE_VERTICAL_ALIGN_MIDDLE
,
1273 eCSSKeyword__moz_middle_with_baseline
, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE
,
1274 eCSSKeyword_bottom
, NS_STYLE_VERTICAL_ALIGN_BOTTOM
,
1275 eCSSKeyword_text_bottom
, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM
,
1276 eCSSKeyword_UNKNOWN
,-1
1279 const PRInt32
nsCSSProps::kVisibilityKTable
[] = {
1280 eCSSKeyword_visible
, NS_STYLE_VISIBILITY_VISIBLE
,
1281 eCSSKeyword_hidden
, NS_STYLE_VISIBILITY_HIDDEN
,
1282 eCSSKeyword_collapse
, NS_STYLE_VISIBILITY_COLLAPSE
,
1283 eCSSKeyword_UNKNOWN
,-1
1286 const PRInt32
nsCSSProps::kVolumeKTable
[] = {
1287 eCSSKeyword_silent
, NS_STYLE_VOLUME_SILENT
,
1288 eCSSKeyword_x_soft
, NS_STYLE_VOLUME_X_SOFT
,
1289 eCSSKeyword_soft
, NS_STYLE_VOLUME_SOFT
,
1290 eCSSKeyword_medium
, NS_STYLE_VOLUME_MEDIUM
,
1291 eCSSKeyword_loud
, NS_STYLE_VOLUME_LOUD
,
1292 eCSSKeyword_x_loud
, NS_STYLE_VOLUME_X_LOUD
,
1293 eCSSKeyword_UNKNOWN
,-1
1296 const PRInt32
nsCSSProps::kWhitespaceKTable
[] = {
1297 eCSSKeyword_normal
, NS_STYLE_WHITESPACE_NORMAL
,
1298 eCSSKeyword_pre
, NS_STYLE_WHITESPACE_PRE
,
1299 eCSSKeyword_nowrap
, NS_STYLE_WHITESPACE_NOWRAP
,
1300 eCSSKeyword_pre_wrap
, NS_STYLE_WHITESPACE_PRE_WRAP
,
1301 eCSSKeyword_pre_line
, NS_STYLE_WHITESPACE_PRE_LINE
,
1302 eCSSKeyword_UNKNOWN
,-1
1305 const PRInt32
nsCSSProps::kWidthKTable
[] = {
1306 eCSSKeyword__moz_max_content
, NS_STYLE_WIDTH_MAX_CONTENT
,
1307 eCSSKeyword__moz_min_content
, NS_STYLE_WIDTH_MIN_CONTENT
,
1308 eCSSKeyword__moz_fit_content
, NS_STYLE_WIDTH_FIT_CONTENT
,
1309 eCSSKeyword__moz_available
, NS_STYLE_WIDTH_AVAILABLE
,
1310 eCSSKeyword_UNKNOWN
,-1
1313 const PRInt32
nsCSSProps::kWindowShadowKTable
[] = {
1314 eCSSKeyword_none
, NS_STYLE_WINDOW_SHADOW_NONE
,
1315 eCSSKeyword_default
, NS_STYLE_WINDOW_SHADOW_DEFAULT
,
1316 eCSSKeyword_menu
, NS_STYLE_WINDOW_SHADOW_MENU
,
1317 eCSSKeyword_tooltip
, NS_STYLE_WINDOW_SHADOW_TOOLTIP
,
1318 eCSSKeyword_sheet
, NS_STYLE_WINDOW_SHADOW_SHEET
,
1319 eCSSKeyword_UNKNOWN
,-1
1322 const PRInt32
nsCSSProps::kWordwrapKTable
[] = {
1323 eCSSKeyword_normal
, NS_STYLE_WORDWRAP_NORMAL
,
1324 eCSSKeyword_break_word
, NS_STYLE_WORDWRAP_BREAK_WORD
,
1325 eCSSKeyword_UNKNOWN
,-1
1328 // Specific keyword tables for XUL.properties
1329 const PRInt32
nsCSSProps::kBoxAlignKTable
[] = {
1330 eCSSKeyword_stretch
, NS_STYLE_BOX_ALIGN_STRETCH
,
1331 eCSSKeyword_start
, NS_STYLE_BOX_ALIGN_START
,
1332 eCSSKeyword_center
, NS_STYLE_BOX_ALIGN_CENTER
,
1333 eCSSKeyword_baseline
, NS_STYLE_BOX_ALIGN_BASELINE
,
1334 eCSSKeyword_end
, NS_STYLE_BOX_ALIGN_END
,
1335 eCSSKeyword_UNKNOWN
,-1
1338 const PRInt32
nsCSSProps::kBoxDirectionKTable
[] = {
1339 eCSSKeyword_normal
, NS_STYLE_BOX_DIRECTION_NORMAL
,
1340 eCSSKeyword_reverse
, NS_STYLE_BOX_DIRECTION_REVERSE
,
1341 eCSSKeyword_UNKNOWN
,-1
1344 const PRInt32
nsCSSProps::kBoxOrientKTable
[] = {
1345 eCSSKeyword_horizontal
, NS_STYLE_BOX_ORIENT_HORIZONTAL
,
1346 eCSSKeyword_vertical
, NS_STYLE_BOX_ORIENT_VERTICAL
,
1347 eCSSKeyword_inline_axis
, NS_STYLE_BOX_ORIENT_HORIZONTAL
,
1348 eCSSKeyword_block_axis
, NS_STYLE_BOX_ORIENT_VERTICAL
,
1349 eCSSKeyword_UNKNOWN
,-1
1352 const PRInt32
nsCSSProps::kBoxPackKTable
[] = {
1353 eCSSKeyword_start
, NS_STYLE_BOX_PACK_START
,
1354 eCSSKeyword_center
, NS_STYLE_BOX_PACK_CENTER
,
1355 eCSSKeyword_end
, NS_STYLE_BOX_PACK_END
,
1356 eCSSKeyword_justify
, NS_STYLE_BOX_PACK_JUSTIFY
,
1357 eCSSKeyword_UNKNOWN
,-1
1360 // keyword tables for SVG properties
1362 const PRInt32
nsCSSProps::kDominantBaselineKTable
[] = {
1363 eCSSKeyword_auto
, NS_STYLE_DOMINANT_BASELINE_AUTO
,
1364 eCSSKeyword_use_script
, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT
,
1365 eCSSKeyword_no_change
, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE
,
1366 eCSSKeyword_reset_size
, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE
,
1367 eCSSKeyword_alphabetic
, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC
,
1368 eCSSKeyword_hanging
, NS_STYLE_DOMINANT_BASELINE_HANGING
,
1369 eCSSKeyword_ideographic
, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC
,
1370 eCSSKeyword_mathematical
, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL
,
1371 eCSSKeyword_central
, NS_STYLE_DOMINANT_BASELINE_CENTRAL
,
1372 eCSSKeyword_middle
, NS_STYLE_DOMINANT_BASELINE_MIDDLE
,
1373 eCSSKeyword_text_after_edge
, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE
,
1374 eCSSKeyword_text_before_edge
, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE
,
1375 eCSSKeyword_UNKNOWN
, -1
1378 const PRInt32
nsCSSProps::kFillRuleKTable
[] = {
1379 eCSSKeyword_nonzero
, NS_STYLE_FILL_RULE_NONZERO
,
1380 eCSSKeyword_evenodd
, NS_STYLE_FILL_RULE_EVENODD
,
1381 eCSSKeyword_UNKNOWN
, -1
1384 const PRInt32
nsCSSProps::kImageRenderingKTable
[] = {
1385 eCSSKeyword_auto
, NS_STYLE_IMAGE_RENDERING_AUTO
,
1386 eCSSKeyword_optimizespeed
, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED
,
1387 eCSSKeyword_optimizequality
, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY
,
1388 eCSSKeyword__moz_crisp_edges
, NS_STYLE_IMAGE_RENDERING_CRISPEDGES
,
1389 eCSSKeyword_UNKNOWN
, -1
1392 const PRInt32
nsCSSProps::kShapeRenderingKTable
[] = {
1393 eCSSKeyword_auto
, NS_STYLE_SHAPE_RENDERING_AUTO
,
1394 eCSSKeyword_optimizespeed
, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED
,
1395 eCSSKeyword_crispedges
, NS_STYLE_SHAPE_RENDERING_CRISPEDGES
,
1396 eCSSKeyword_geometricprecision
, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION
,
1397 eCSSKeyword_UNKNOWN
, -1
1400 const PRInt32
nsCSSProps::kStrokeLinecapKTable
[] = {
1401 eCSSKeyword_butt
, NS_STYLE_STROKE_LINECAP_BUTT
,
1402 eCSSKeyword_round
, NS_STYLE_STROKE_LINECAP_ROUND
,
1403 eCSSKeyword_square
, NS_STYLE_STROKE_LINECAP_SQUARE
,
1404 eCSSKeyword_UNKNOWN
, -1
1407 const PRInt32
nsCSSProps::kStrokeLinejoinKTable
[] = {
1408 eCSSKeyword_miter
, NS_STYLE_STROKE_LINEJOIN_MITER
,
1409 eCSSKeyword_round
, NS_STYLE_STROKE_LINEJOIN_ROUND
,
1410 eCSSKeyword_bevel
, NS_STYLE_STROKE_LINEJOIN_BEVEL
,
1411 eCSSKeyword_UNKNOWN
, -1
1414 const PRInt32
nsCSSProps::kTextAnchorKTable
[] = {
1415 eCSSKeyword_start
, NS_STYLE_TEXT_ANCHOR_START
,
1416 eCSSKeyword_middle
, NS_STYLE_TEXT_ANCHOR_MIDDLE
,
1417 eCSSKeyword_end
, NS_STYLE_TEXT_ANCHOR_END
,
1418 eCSSKeyword_UNKNOWN
, -1
1421 const PRInt32
nsCSSProps::kTextRenderingKTable
[] = {
1422 eCSSKeyword_auto
, NS_STYLE_TEXT_RENDERING_AUTO
,
1423 eCSSKeyword_optimizespeed
, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED
,
1424 eCSSKeyword_optimizelegibility
, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY
,
1425 eCSSKeyword_geometricprecision
, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION
,
1426 eCSSKeyword_UNKNOWN
, -1
1429 const PRInt32
nsCSSProps::kColorInterpolationKTable
[] = {
1430 eCSSKeyword_auto
, NS_STYLE_COLOR_INTERPOLATION_AUTO
,
1431 eCSSKeyword_srgb
, NS_STYLE_COLOR_INTERPOLATION_SRGB
,
1432 eCSSKeyword_linearrgb
, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB
,
1433 eCSSKeyword_UNKNOWN
, -1
1437 nsCSSProps::FindKeyword(nsCSSKeyword aKeyword
, const PRInt32 aTable
[], PRInt32
& aResult
)
1440 while (eCSSKeyword_UNKNOWN
!= nsCSSKeyword(aTable
[index
])) {
1441 if (aKeyword
== nsCSSKeyword(aTable
[index
])) {
1442 aResult
= aTable
[index
+1];
1451 nsCSSProps::ValueToKeywordEnum(PRInt32 aValue
, const PRInt32 aTable
[])
1455 if (aTable
[i
] == -1 && aTable
[i
-1] == eCSSKeyword_UNKNOWN
) {
1458 if (aValue
== aTable
[i
]) {
1459 return nsCSSKeyword(aTable
[i
-1]);
1463 return eCSSKeyword_UNKNOWN
;
1466 const nsAFlatCString
&
1467 nsCSSProps::ValueToKeyword(PRInt32 aValue
, const PRInt32 aTable
[])
1469 nsCSSKeyword keyword
= ValueToKeywordEnum(aValue
, aTable
);
1470 if (keyword
== eCSSKeyword_UNKNOWN
) {
1471 static nsDependentCString
sNullStr("");
1474 return nsCSSKeywords::GetStringValue(keyword
);
1478 /* static */ const PRInt32
* const
1479 nsCSSProps::kKeywordTableTable
[eCSSProperty_COUNT_no_shorthands
] = {
1480 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
1481 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
1483 #include "nsCSSPropList.h"
1487 const nsAFlatCString
&
1488 nsCSSProps::LookupPropertyValue(nsCSSProperty aProp
, PRInt32 aValue
)
1490 NS_ASSERTION(aProp
>= 0 && aProp
< eCSSProperty_COUNT
, "property out of range");
1492 const PRInt32
* kwtable
= nsnull
;
1493 if (aProp
< eCSSProperty_COUNT_no_shorthands
)
1494 kwtable
= kKeywordTableTable
[aProp
];
1497 return ValueToKeyword(aValue
, kwtable
);
1499 static nsDependentCString
sNullStr("");
1503 PRBool
nsCSSProps::GetColorName(PRInt32 aPropValue
, nsCString
&aStr
)
1505 PRBool rv
= PR_FALSE
;
1507 // first get the keyword corresponding to the property Value from the color table
1508 nsCSSKeyword keyword
= ValueToKeywordEnum(aPropValue
, kColorKTable
);
1510 // next get the name as a string from the keywords table
1511 if (keyword
!= eCSSKeyword_UNKNOWN
) {
1512 nsCSSKeywords::AddRefTable();
1513 aStr
= nsCSSKeywords::GetStringValue(keyword
);
1514 nsCSSKeywords::ReleaseTable();
1520 // define array of all CSS property types
1521 const nsCSSType
nsCSSProps::kTypeTable
[eCSSProperty_COUNT_no_shorthands
] = {
1522 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
1523 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
1525 #include "nsCSSPropList.h"
1529 const nsStyleStructID
nsCSSProps::kSIDTable
[eCSSProperty_COUNT_no_shorthands
] = {
1530 // Note that this uses the special BackendOnly style struct ID
1531 // (which does need to be valid for storing in the
1532 // nsCSSCompressedDataBlock::mStyleBits bitfield).
1533 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
1534 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
1535 eStyleStruct_##stylestruct_,
1537 #include "nsCSSPropList.h"
1542 const nsStyleAnimType
1543 nsCSSProps::kAnimTypeTable
[eCSSProperty_COUNT_no_shorthands
] = {
1544 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
1545 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
1547 #include "nsCSSPropList.h"
1552 nsCSSProps::kStyleStructOffsetTable
[eCSSProperty_COUNT_no_shorthands
] = {
1553 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
1554 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
1556 #include "nsCSSPropList.h"
1560 const PRUint32
nsCSSProps::kFlagsTable
[eCSSProperty_COUNT
] = {
1561 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, \
1562 kwtable_, stylestruct_, stylestructoffset_, animtype_) \
1564 #include "nsCSSPropList.h"
1566 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) flags_,
1567 #include "nsCSSPropList.h"
1568 #undef CSS_PROP_SHORTHAND
1571 static const nsCSSProperty gMozBorderRadiusSubpropTable
[] = {
1572 // Code relies on these being in topleft-topright-bottomright-bottomleft
1574 eCSSProperty__moz_border_radius_topLeft
,
1575 eCSSProperty__moz_border_radius_topRight
,
1576 eCSSProperty__moz_border_radius_bottomRight
,
1577 eCSSProperty__moz_border_radius_bottomLeft
,
1578 eCSSProperty_UNKNOWN
1581 static const nsCSSProperty gMozOutlineRadiusSubpropTable
[] = {
1582 // Code relies on these being in topleft-topright-bottomright-bottomleft
1584 eCSSProperty__moz_outline_radius_topLeft
,
1585 eCSSProperty__moz_outline_radius_topRight
,
1586 eCSSProperty__moz_outline_radius_bottomRight
,
1587 eCSSProperty__moz_outline_radius_bottomLeft
,
1588 eCSSProperty_UNKNOWN
1591 static const nsCSSProperty gBackgroundSubpropTable
[] = {
1592 eCSSProperty_background_color
,
1593 eCSSProperty_background_image
,
1594 eCSSProperty_background_repeat
,
1595 eCSSProperty_background_attachment
,
1596 eCSSProperty_background_position
,
1597 eCSSProperty_background_clip
,
1598 eCSSProperty_background_origin
,
1599 eCSSProperty_background_size
,
1600 eCSSProperty_UNKNOWN
1603 static const nsCSSProperty gBorderSubpropTable
[] = {
1604 eCSSProperty_border_top_width
,
1605 eCSSProperty_border_right_width_value
,
1606 eCSSProperty_border_right_width_ltr_source
,
1607 eCSSProperty_border_right_width_rtl_source
,
1608 eCSSProperty_border_bottom_width
,
1609 eCSSProperty_border_left_width_value
,
1610 eCSSProperty_border_left_width_ltr_source
,
1611 eCSSProperty_border_left_width_rtl_source
,
1612 eCSSProperty_border_top_style
,
1613 eCSSProperty_border_right_style_value
,
1614 eCSSProperty_border_right_style_ltr_source
,
1615 eCSSProperty_border_right_style_rtl_source
,
1616 eCSSProperty_border_bottom_style
,
1617 eCSSProperty_border_left_style_value
,
1618 eCSSProperty_border_left_style_ltr_source
,
1619 eCSSProperty_border_left_style_rtl_source
,
1620 eCSSProperty_border_top_color
,
1621 eCSSProperty_border_right_color_value
,
1622 eCSSProperty_border_right_color_ltr_source
,
1623 eCSSProperty_border_right_color_rtl_source
,
1624 eCSSProperty_border_bottom_color
,
1625 eCSSProperty_border_left_color_value
,
1626 eCSSProperty_border_left_color_ltr_source
,
1627 eCSSProperty_border_left_color_rtl_source
,
1628 eCSSProperty_border_top_colors
,
1629 eCSSProperty_border_right_colors
,
1630 eCSSProperty_border_bottom_colors
,
1631 eCSSProperty_border_left_colors
,
1632 eCSSProperty_border_image
,
1633 eCSSProperty_UNKNOWN
1636 static const nsCSSProperty gBorderBottomSubpropTable
[] = {
1637 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1638 // It also depends on the color being third.
1639 eCSSProperty_border_bottom_width
,
1640 eCSSProperty_border_bottom_style
,
1641 eCSSProperty_border_bottom_color
,
1642 eCSSProperty_UNKNOWN
1645 PR_STATIC_ASSERT(NS_SIDE_TOP
== 0);
1646 PR_STATIC_ASSERT(NS_SIDE_RIGHT
== 1);
1647 PR_STATIC_ASSERT(NS_SIDE_BOTTOM
== 2);
1648 PR_STATIC_ASSERT(NS_SIDE_LEFT
== 3);
1649 static const nsCSSProperty gBorderColorSubpropTable
[] = {
1650 // Code relies on these being in top-right-bottom-left order.
1651 // Code relies on these matching the NS_SIDE_* constants.
1652 eCSSProperty_border_top_color
,
1653 eCSSProperty_border_right_color_value
,
1654 eCSSProperty_border_bottom_color
,
1655 eCSSProperty_border_left_color_value
,
1657 eCSSProperty_border_left_color_ltr_source
,
1658 eCSSProperty_border_left_color_rtl_source
,
1659 eCSSProperty_border_right_color_ltr_source
,
1660 eCSSProperty_border_right_color_rtl_source
,
1661 eCSSProperty_UNKNOWN
1664 static const nsCSSProperty gMozBorderEndColorSubpropTable
[] = {
1665 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1666 eCSSProperty_border_end_color_value
,
1667 eCSSProperty_border_right_color_ltr_source
,
1668 eCSSProperty_border_left_color_rtl_source
,
1669 eCSSProperty_UNKNOWN
1672 static const nsCSSProperty gBorderLeftColorSubpropTable
[] = {
1673 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1674 eCSSProperty_border_left_color_value
,
1675 eCSSProperty_border_left_color_ltr_source
,
1676 eCSSProperty_border_left_color_rtl_source
,
1677 eCSSProperty_UNKNOWN
1680 static const nsCSSProperty gBorderRightColorSubpropTable
[] = {
1681 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1682 eCSSProperty_border_right_color_value
,
1683 eCSSProperty_border_right_color_ltr_source
,
1684 eCSSProperty_border_right_color_rtl_source
,
1685 eCSSProperty_UNKNOWN
1688 static const nsCSSProperty gMozBorderStartColorSubpropTable
[] = {
1689 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1690 eCSSProperty_border_start_color_value
,
1691 eCSSProperty_border_left_color_ltr_source
,
1692 eCSSProperty_border_right_color_rtl_source
,
1693 eCSSProperty_UNKNOWN
1696 static const nsCSSProperty gMozBorderEndSubpropTable
[] = {
1697 // nsCSSDeclaration.cpp output the subproperties in this order.
1698 // It also depends on the color being third.
1699 eCSSProperty_border_end_width_value
,
1700 eCSSProperty_border_end_style_value
,
1701 eCSSProperty_border_end_color_value
,
1703 eCSSProperty_border_right_width_ltr_source
,
1704 eCSSProperty_border_left_width_rtl_source
,
1705 eCSSProperty_border_right_style_ltr_source
,
1706 eCSSProperty_border_left_style_rtl_source
,
1707 eCSSProperty_border_right_color_ltr_source
,
1708 eCSSProperty_border_left_color_rtl_source
,
1709 eCSSProperty_UNKNOWN
1712 static const nsCSSProperty gBorderLeftSubpropTable
[] = {
1713 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1714 // It also depends on the color being third.
1715 eCSSProperty_border_left_width_value
,
1716 eCSSProperty_border_left_style_value
,
1717 eCSSProperty_border_left_color_value
,
1719 eCSSProperty_border_left_width_ltr_source
,
1720 eCSSProperty_border_left_width_rtl_source
,
1721 eCSSProperty_border_left_style_ltr_source
,
1722 eCSSProperty_border_left_style_rtl_source
,
1723 eCSSProperty_border_left_color_ltr_source
,
1724 eCSSProperty_border_left_color_rtl_source
,
1725 eCSSProperty_UNKNOWN
1728 static const nsCSSProperty gBorderRightSubpropTable
[] = {
1729 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1730 // It also depends on the color being third.
1731 eCSSProperty_border_right_width_value
,
1732 eCSSProperty_border_right_style_value
,
1733 eCSSProperty_border_right_color_value
,
1735 eCSSProperty_border_right_width_ltr_source
,
1736 eCSSProperty_border_right_width_rtl_source
,
1737 eCSSProperty_border_right_style_ltr_source
,
1738 eCSSProperty_border_right_style_rtl_source
,
1739 eCSSProperty_border_right_color_ltr_source
,
1740 eCSSProperty_border_right_color_rtl_source
,
1741 eCSSProperty_UNKNOWN
1744 static const nsCSSProperty gMozBorderStartSubpropTable
[] = {
1745 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1746 // It also depends on the color being third.
1747 eCSSProperty_border_start_width_value
,
1748 eCSSProperty_border_start_style_value
,
1749 eCSSProperty_border_start_color_value
,
1751 eCSSProperty_border_left_width_ltr_source
,
1752 eCSSProperty_border_right_width_rtl_source
,
1753 eCSSProperty_border_left_style_ltr_source
,
1754 eCSSProperty_border_right_style_rtl_source
,
1755 eCSSProperty_border_left_color_ltr_source
,
1756 eCSSProperty_border_right_color_rtl_source
,
1757 eCSSProperty_UNKNOWN
1760 static const nsCSSProperty gBorderStyleSubpropTable
[] = {
1761 // Code relies on these being in top-right-bottom-left order.
1762 eCSSProperty_border_top_style
,
1763 eCSSProperty_border_right_style_value
,
1764 eCSSProperty_border_bottom_style
,
1765 eCSSProperty_border_left_style_value
,
1767 eCSSProperty_border_left_style_ltr_source
,
1768 eCSSProperty_border_left_style_rtl_source
,
1769 eCSSProperty_border_right_style_ltr_source
,
1770 eCSSProperty_border_right_style_rtl_source
,
1771 eCSSProperty_UNKNOWN
1774 static const nsCSSProperty gBorderLeftStyleSubpropTable
[] = {
1775 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1776 eCSSProperty_border_left_style_value
,
1777 eCSSProperty_border_left_style_ltr_source
,
1778 eCSSProperty_border_left_style_rtl_source
,
1779 eCSSProperty_UNKNOWN
1782 static const nsCSSProperty gBorderRightStyleSubpropTable
[] = {
1783 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1784 eCSSProperty_border_right_style_value
,
1785 eCSSProperty_border_right_style_ltr_source
,
1786 eCSSProperty_border_right_style_rtl_source
,
1787 eCSSProperty_UNKNOWN
1790 static const nsCSSProperty gMozBorderStartStyleSubpropTable
[] = {
1791 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1792 eCSSProperty_border_start_style_value
,
1793 eCSSProperty_border_left_style_ltr_source
,
1794 eCSSProperty_border_right_style_rtl_source
,
1795 eCSSProperty_UNKNOWN
1798 static const nsCSSProperty gMozBorderEndStyleSubpropTable
[] = {
1799 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1800 eCSSProperty_border_end_style_value
,
1801 eCSSProperty_border_right_style_ltr_source
,
1802 eCSSProperty_border_left_style_rtl_source
,
1803 eCSSProperty_UNKNOWN
1806 static const nsCSSProperty gBorderTopSubpropTable
[] = {
1807 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1808 // It also depends on the color being third.
1809 eCSSProperty_border_top_width
,
1810 eCSSProperty_border_top_style
,
1811 eCSSProperty_border_top_color
,
1812 eCSSProperty_UNKNOWN
1815 static const nsCSSProperty gBorderWidthSubpropTable
[] = {
1816 // Code relies on these being in top-right-bottom-left order.
1817 eCSSProperty_border_top_width
,
1818 eCSSProperty_border_right_width_value
,
1819 eCSSProperty_border_bottom_width
,
1820 eCSSProperty_border_left_width_value
,
1822 eCSSProperty_border_left_width_ltr_source
,
1823 eCSSProperty_border_left_width_rtl_source
,
1824 eCSSProperty_border_right_width_ltr_source
,
1825 eCSSProperty_border_right_width_rtl_source
,
1826 eCSSProperty_UNKNOWN
1829 static const nsCSSProperty gBorderLeftWidthSubpropTable
[] = {
1830 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1831 eCSSProperty_border_left_width_value
,
1832 eCSSProperty_border_left_width_ltr_source
,
1833 eCSSProperty_border_left_width_rtl_source
,
1834 eCSSProperty_UNKNOWN
1837 static const nsCSSProperty gBorderRightWidthSubpropTable
[] = {
1838 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1839 eCSSProperty_border_right_width_value
,
1840 eCSSProperty_border_right_width_ltr_source
,
1841 eCSSProperty_border_right_width_rtl_source
,
1842 eCSSProperty_UNKNOWN
1845 static const nsCSSProperty gMozBorderStartWidthSubpropTable
[] = {
1846 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1847 eCSSProperty_border_start_width_value
,
1848 eCSSProperty_border_left_width_ltr_source
,
1849 eCSSProperty_border_right_width_rtl_source
,
1850 eCSSProperty_UNKNOWN
1853 static const nsCSSProperty gMozBorderEndWidthSubpropTable
[] = {
1854 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1855 eCSSProperty_border_end_width_value
,
1856 eCSSProperty_border_right_width_ltr_source
,
1857 eCSSProperty_border_left_width_rtl_source
,
1858 eCSSProperty_UNKNOWN
1861 static const nsCSSProperty gCueSubpropTable
[] = {
1862 eCSSProperty_cue_after
,
1863 eCSSProperty_cue_before
,
1864 eCSSProperty_UNKNOWN
1867 static const nsCSSProperty gFontSubpropTable
[] = {
1868 eCSSProperty_font_family
,
1869 eCSSProperty_font_style
,
1870 eCSSProperty_font_variant
,
1871 eCSSProperty_font_weight
,
1872 eCSSProperty_font_size
,
1873 eCSSProperty_line_height
,
1874 eCSSProperty_font_size_adjust
, // XXX Added LDB.
1875 eCSSProperty_font_stretch
, // XXX Added LDB.
1876 eCSSProperty__x_system_font
,
1877 eCSSProperty_font_feature_settings
,
1878 eCSSProperty_font_language_override
,
1879 eCSSProperty_UNKNOWN
1882 static const nsCSSProperty gListStyleSubpropTable
[] = {
1883 eCSSProperty_list_style_type
,
1884 eCSSProperty_list_style_image
,
1885 eCSSProperty_list_style_position
,
1886 eCSSProperty_UNKNOWN
1889 static const nsCSSProperty gMarginSubpropTable
[] = {
1890 // Code relies on these being in top-right-bottom-left order.
1891 eCSSProperty_margin_top
,
1892 eCSSProperty_margin_right_value
,
1893 eCSSProperty_margin_bottom
,
1894 eCSSProperty_margin_left_value
,
1896 eCSSProperty_margin_left_ltr_source
,
1897 eCSSProperty_margin_left_rtl_source
,
1898 eCSSProperty_margin_right_ltr_source
,
1899 eCSSProperty_margin_right_rtl_source
,
1900 eCSSProperty_UNKNOWN
1903 static const nsCSSProperty gMarginLeftSubpropTable
[] = {
1904 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1905 eCSSProperty_margin_left_value
,
1906 eCSSProperty_margin_left_ltr_source
,
1907 eCSSProperty_margin_left_rtl_source
,
1908 eCSSProperty_UNKNOWN
1911 static const nsCSSProperty gMarginRightSubpropTable
[] = {
1912 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1913 eCSSProperty_margin_right_value
,
1914 eCSSProperty_margin_right_ltr_source
,
1915 eCSSProperty_margin_right_rtl_source
,
1916 eCSSProperty_UNKNOWN
1919 static const nsCSSProperty gMozMarginStartSubpropTable
[] = {
1920 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1921 eCSSProperty_margin_start_value
,
1922 eCSSProperty_margin_left_ltr_source
,
1923 eCSSProperty_margin_right_rtl_source
,
1924 eCSSProperty_UNKNOWN
1927 static const nsCSSProperty gMozMarginEndSubpropTable
[] = {
1928 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1929 eCSSProperty_margin_end_value
,
1930 eCSSProperty_margin_right_ltr_source
,
1931 eCSSProperty_margin_left_rtl_source
,
1932 eCSSProperty_UNKNOWN
1936 static const nsCSSProperty gOutlineSubpropTable
[] = {
1937 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1938 // It also depends on the color being third.
1939 eCSSProperty_outline_width
,
1940 eCSSProperty_outline_style
,
1941 eCSSProperty_outline_color
,
1942 eCSSProperty_UNKNOWN
1945 static const nsCSSProperty gMozColumnRuleSubpropTable
[] = {
1946 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1947 // It also depends on the color being third.
1948 eCSSProperty__moz_column_rule_width
,
1949 eCSSProperty__moz_column_rule_style
,
1950 eCSSProperty__moz_column_rule_color
,
1951 eCSSProperty_UNKNOWN
1954 static const nsCSSProperty gOverflowSubpropTable
[] = {
1955 eCSSProperty_overflow_x
,
1956 eCSSProperty_overflow_y
,
1957 eCSSProperty_UNKNOWN
1960 static const nsCSSProperty gPaddingSubpropTable
[] = {
1961 // Code relies on these being in top-right-bottom-left order.
1962 eCSSProperty_padding_top
,
1963 eCSSProperty_padding_right_value
,
1964 eCSSProperty_padding_bottom
,
1965 eCSSProperty_padding_left_value
,
1967 eCSSProperty_padding_left_ltr_source
,
1968 eCSSProperty_padding_left_rtl_source
,
1969 eCSSProperty_padding_right_ltr_source
,
1970 eCSSProperty_padding_right_rtl_source
,
1971 eCSSProperty_UNKNOWN
1974 static const nsCSSProperty gPaddingLeftSubpropTable
[] = {
1975 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1976 eCSSProperty_padding_left_value
,
1977 eCSSProperty_padding_left_ltr_source
,
1978 eCSSProperty_padding_left_rtl_source
,
1979 eCSSProperty_UNKNOWN
1982 static const nsCSSProperty gPaddingRightSubpropTable
[] = {
1983 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1984 eCSSProperty_padding_right_value
,
1985 eCSSProperty_padding_right_ltr_source
,
1986 eCSSProperty_padding_right_rtl_source
,
1987 eCSSProperty_UNKNOWN
1990 static const nsCSSProperty gMozPaddingStartSubpropTable
[] = {
1991 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1992 eCSSProperty_padding_start_value
,
1993 eCSSProperty_padding_left_ltr_source
,
1994 eCSSProperty_padding_right_rtl_source
,
1995 eCSSProperty_UNKNOWN
1998 static const nsCSSProperty gMozPaddingEndSubpropTable
[] = {
1999 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2000 eCSSProperty_padding_end_value
,
2001 eCSSProperty_padding_right_ltr_source
,
2002 eCSSProperty_padding_left_rtl_source
,
2003 eCSSProperty_UNKNOWN
2006 static const nsCSSProperty gPauseSubpropTable
[] = {
2007 eCSSProperty_pause_after
,
2008 eCSSProperty_pause_before
,
2009 eCSSProperty_UNKNOWN
2012 static const nsCSSProperty gMozTransitionSubpropTable
[] = {
2013 eCSSProperty_transition_property
,
2014 eCSSProperty_transition_duration
,
2015 eCSSProperty_transition_timing_function
,
2016 eCSSProperty_transition_delay
,
2017 eCSSProperty_UNKNOWN
2020 static const nsCSSProperty gMarkerSubpropTable
[] = {
2021 eCSSProperty_marker_start
,
2022 eCSSProperty_marker_mid
,
2023 eCSSProperty_marker_end
,
2024 eCSSProperty_UNKNOWN
2027 const nsCSSProperty
*const
2028 nsCSSProps::kSubpropertyTable
[eCSSProperty_COUNT
- eCSSProperty_COUNT_no_shorthands
] = {
2029 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) g##method_##SubpropTable,
2030 #include "nsCSSPropList.h"
2031 #undef CSS_PROP_SHORTHAND