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>
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
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
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_, flags_, datastruct_, member_, type_, kwtable_) #name_,
61 #include "nsCSSPropList.h"
63 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) #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
[] = {
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();
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
]);
99 NS_ASSERTION(temp1
.Equals(temp2
), "upper case char in prop table");
100 NS_ASSERTION(-1 == temp1
.FindChar('_'), "underscore char in prop table");
104 gPropertyTable
->Init(kCSSRawProperties
, eCSSProperty_COUNT
);
107 gFontDescTable
= new nsStaticCaseInsensitiveNameTable();
108 if (gFontDescTable
) {
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
]);
116 NS_ASSERTION(temp1
.Equals(temp2
), "upper case char in desc table");
117 NS_ASSERTION(-1 == temp1
.FindChar('_'), "underscore char in desc table");
121 gFontDescTable
->Init(kCSSRawFontDescs
, eCSSFontDesc_COUNT
);
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")];
146 static const CSSPropertyAlias gAliases
[] = {
147 { "-moz-outline", eCSSProperty_outline
},
148 { "-moz-outline-color", eCSSProperty_outline_color
},
149 { "-moz-outline-style", eCSSProperty_outline_style
},
150 { "-moz-outline-width", eCSSProperty_outline_width
},
151 { "-moz-outline-offset", eCSSProperty_outline_offset
}
152 // Don't forget to update the sizeof in CSSPropertyAlias above with the
153 // longest string when you add stuff here.
157 nsCSSProps::LookupProperty(const nsACString
& aProperty
)
159 NS_ASSERTION(gPropertyTable
, "no lookup table, needs addref");
161 nsCSSProperty res
= nsCSSProperty(gPropertyTable
->Lookup(aProperty
));
162 if (res
== eCSSProperty_UNKNOWN
) {
163 const nsCString
& prop
= PromiseFlatCString(aProperty
);
164 for (const CSSPropertyAlias
*alias
= gAliases
,
165 *alias_end
= gAliases
+ NS_ARRAY_LENGTH(gAliases
);
166 alias
< alias_end
; ++alias
)
167 if (nsCRT::strcasecmp(prop
.get(), alias
->name
) == 0) {
176 nsCSSProps::LookupProperty(const nsAString
& aProperty
)
178 // This is faster than converting and calling
179 // LookupProperty(nsACString&). The table will do its own
180 // converting and avoid a PromiseFlatCString() call.
181 NS_ASSERTION(gPropertyTable
, "no lookup table, needs addref");
182 nsCSSProperty res
= nsCSSProperty(gPropertyTable
->Lookup(aProperty
));
183 if (res
== eCSSProperty_UNKNOWN
) {
184 NS_ConvertUTF16toUTF8
prop(aProperty
);
185 for (const CSSPropertyAlias
*alias
= gAliases
,
186 *alias_end
= gAliases
+ NS_ARRAY_LENGTH(gAliases
);
187 alias
< alias_end
; ++alias
)
188 if (nsCRT::strcasecmp(prop
.get(), alias
->name
) == 0) {
197 nsCSSProps::LookupFontDesc(const nsACString
& aFontDesc
)
199 NS_ASSERTION(gFontDescTable
, "no lookup table, needs addref");
200 return nsCSSFontDesc(gFontDescTable
->Lookup(aFontDesc
));
204 nsCSSProps::LookupFontDesc(const nsAString
& aFontDesc
)
206 NS_ASSERTION(gFontDescTable
, "no lookup table, needs addref");
207 return nsCSSFontDesc(gFontDescTable
->Lookup(aFontDesc
));
210 const nsAFlatCString
&
211 nsCSSProps::GetStringValue(nsCSSProperty aProperty
)
213 NS_ASSERTION(gPropertyTable
, "no lookup table, needs addref");
214 if (gPropertyTable
) {
215 return gPropertyTable
->GetStringValue(PRInt32(aProperty
));
217 static nsDependentCString
sNullStr("");
222 const nsAFlatCString
&
223 nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID
)
225 NS_ASSERTION(gFontDescTable
, "no lookup table, needs addref");
226 if (gFontDescTable
) {
227 return gFontDescTable
->GetStringValue(PRInt32(aFontDescID
));
229 static nsDependentCString
sNullStr("");
235 /***************************************************************************/
237 const PRInt32
nsCSSProps::kAppearanceKTable
[] = {
238 eCSSKeyword_none
, NS_THEME_NONE
,
239 eCSSKeyword_button
, NS_THEME_BUTTON
,
240 eCSSKeyword_radio
, NS_THEME_RADIO
,
241 eCSSKeyword_checkbox
, NS_THEME_CHECKBOX
,
242 eCSSKeyword_radio_small
, NS_THEME_RADIO_SMALL
,
243 eCSSKeyword_checkbox_small
, NS_THEME_CHECKBOX_SMALL
,
244 eCSSKeyword_button_bevel
, NS_THEME_BUTTON_BEVEL
,
245 eCSSKeyword_toolbox
, NS_THEME_TOOLBOX
,
246 eCSSKeyword_toolbar
, NS_THEME_TOOLBAR
,
247 eCSSKeyword_toolbarbutton
, NS_THEME_TOOLBAR_BUTTON
,
248 eCSSKeyword_toolbargripper
, NS_THEME_TOOLBAR_GRIPPER
,
249 eCSSKeyword_dualbutton
, NS_THEME_TOOLBAR_DUAL_BUTTON
,
250 eCSSKeyword_toolbarbutton_dropdown
, NS_THEME_TOOLBAR_BUTTON_DROPDOWN
,
251 eCSSKeyword_separator
, NS_THEME_TOOLBAR_SEPARATOR
,
252 eCSSKeyword_splitter
, NS_THEME_SPLITTER
,
253 eCSSKeyword_statusbar
, NS_THEME_STATUSBAR
,
254 eCSSKeyword_statusbarpanel
, NS_THEME_STATUSBAR_PANEL
,
255 eCSSKeyword_resizerpanel
, NS_THEME_STATUSBAR_RESIZER_PANEL
,
256 eCSSKeyword_resizer
, NS_THEME_RESIZER
,
257 eCSSKeyword_listbox
, NS_THEME_LISTBOX
,
258 eCSSKeyword_listitem
, NS_THEME_LISTBOX_LISTITEM
,
259 eCSSKeyword_treeview
, NS_THEME_TREEVIEW
,
260 eCSSKeyword_treeitem
, NS_THEME_TREEVIEW_TREEITEM
,
261 eCSSKeyword_treetwisty
, NS_THEME_TREEVIEW_TWISTY
,
262 eCSSKeyword_treetwistyopen
, NS_THEME_TREEVIEW_TWISTY_OPEN
,
263 eCSSKeyword_treeline
, NS_THEME_TREEVIEW_LINE
,
264 eCSSKeyword_treeheader
, NS_THEME_TREEVIEW_HEADER
,
265 eCSSKeyword_treeheadercell
, NS_THEME_TREEVIEW_HEADER_CELL
,
266 eCSSKeyword_treeheadersortarrow
, NS_THEME_TREEVIEW_HEADER_SORTARROW
,
267 eCSSKeyword_progressbar
, NS_THEME_PROGRESSBAR
,
268 eCSSKeyword_progresschunk
, NS_THEME_PROGRESSBAR_CHUNK
,
269 eCSSKeyword_progressbar_vertical
, NS_THEME_PROGRESSBAR_VERTICAL
,
270 eCSSKeyword_progresschunk_vertical
, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL
,
271 eCSSKeyword_tab
, NS_THEME_TAB
,
272 eCSSKeyword_tab_left_edge
, NS_THEME_TAB_LEFT_EDGE
,
273 eCSSKeyword_tab_right_edge
, NS_THEME_TAB_RIGHT_EDGE
,
274 eCSSKeyword_tabpanels
, NS_THEME_TAB_PANELS
,
275 eCSSKeyword_tabpanel
, NS_THEME_TAB_PANEL
,
276 eCSSKeyword_tabscrollarrow_back
, NS_THEME_TAB_SCROLLARROW_BACK
,
277 eCSSKeyword_tabscrollarrow_forward
, NS_THEME_TAB_SCROLLARROW_FORWARD
,
278 eCSSKeyword_tooltip
, NS_THEME_TOOLTIP
,
279 eCSSKeyword_spinner
, NS_THEME_SPINNER
,
280 eCSSKeyword_spinner_upbutton
, NS_THEME_SPINNER_UP_BUTTON
,
281 eCSSKeyword_spinner_downbutton
, NS_THEME_SPINNER_DOWN_BUTTON
,
282 eCSSKeyword_spinner_textfield
, NS_THEME_SPINNER_TEXTFIELD
,
283 eCSSKeyword_scrollbar
, NS_THEME_SCROLLBAR
,
284 eCSSKeyword_scrollbar_small
, NS_THEME_SCROLLBAR_SMALL
,
285 eCSSKeyword_scrollbarbutton_up
, NS_THEME_SCROLLBAR_BUTTON_UP
,
286 eCSSKeyword_scrollbarbutton_down
, NS_THEME_SCROLLBAR_BUTTON_DOWN
,
287 eCSSKeyword_scrollbarbutton_left
, NS_THEME_SCROLLBAR_BUTTON_LEFT
,
288 eCSSKeyword_scrollbarbutton_right
, NS_THEME_SCROLLBAR_BUTTON_RIGHT
,
289 eCSSKeyword_scrollbartrack_horizontal
, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL
,
290 eCSSKeyword_scrollbartrack_vertical
, NS_THEME_SCROLLBAR_TRACK_VERTICAL
,
291 eCSSKeyword_scrollbarthumb_horizontal
, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL
,
292 eCSSKeyword_scrollbarthumb_vertical
, NS_THEME_SCROLLBAR_THUMB_VERTICAL
,
293 eCSSKeyword_textfield
, NS_THEME_TEXTFIELD
,
294 eCSSKeyword_textfield_multiline
, NS_THEME_TEXTFIELD_MULTILINE
,
295 eCSSKeyword_caret
, NS_THEME_TEXTFIELD_CARET
,
296 eCSSKeyword_menulist
, NS_THEME_DROPDOWN
,
297 eCSSKeyword_menulistbutton
, NS_THEME_DROPDOWN_BUTTON
,
298 eCSSKeyword_menulisttext
, NS_THEME_DROPDOWN_TEXT
,
299 eCSSKeyword_menulisttextfield
, NS_THEME_DROPDOWN_TEXTFIELD
,
300 eCSSKeyword_scale_horizontal
, NS_THEME_SCALE_HORIZONTAL
,
301 eCSSKeyword_scale_vertical
, NS_THEME_SCALE_VERTICAL
,
302 eCSSKeyword_scalethumb_horizontal
, NS_THEME_SCALE_THUMB_HORIZONTAL
,
303 eCSSKeyword_scalethumb_vertical
, NS_THEME_SCALE_THUMB_VERTICAL
,
304 eCSSKeyword_scalethumbstart
, NS_THEME_SCALE_THUMB_START
,
305 eCSSKeyword_scalethumbend
, NS_THEME_SCALE_THUMB_END
,
306 eCSSKeyword_scalethumbtick
, NS_THEME_SCALE_TICK
,
307 eCSSKeyword_groupbox
, NS_THEME_GROUPBOX
,
308 eCSSKeyword_checkboxcontainer
, NS_THEME_CHECKBOX_CONTAINER
,
309 eCSSKeyword_radiocontainer
, NS_THEME_RADIO_CONTAINER
,
310 eCSSKeyword_checkboxlabel
, NS_THEME_CHECKBOX_LABEL
,
311 eCSSKeyword_radiolabel
, NS_THEME_RADIO_LABEL
,
312 eCSSKeyword_buttonfocus
, NS_THEME_BUTTON_FOCUS
,
313 eCSSKeyword_window
, NS_THEME_WINDOW
,
314 eCSSKeyword_dialog
, NS_THEME_DIALOG
,
315 eCSSKeyword_menubar
, NS_THEME_MENUBAR
,
316 eCSSKeyword_menupopup
, NS_THEME_MENUPOPUP
,
317 eCSSKeyword_menuitem
, NS_THEME_MENUITEM
,
318 eCSSKeyword_checkmenuitem
, NS_THEME_CHECKMENUITEM
,
319 eCSSKeyword_radiomenuitem
, NS_THEME_RADIOMENUITEM
,
320 eCSSKeyword_menucheckbox
, NS_THEME_MENUCHECKBOX
,
321 eCSSKeyword_menuradio
, NS_THEME_MENURADIO
,
322 eCSSKeyword_menuseparator
, NS_THEME_MENUSEPARATOR
,
323 eCSSKeyword_menuarrow
, NS_THEME_MENUARROW
,
324 eCSSKeyword_menuimage
, NS_THEME_MENUIMAGE
,
325 eCSSKeyword_menuitemtext
, NS_THEME_MENUITEMTEXT
,
326 eCSSKeyword__moz_win_media_toolbox
, NS_THEME_WIN_MEDIA_TOOLBOX
,
327 eCSSKeyword__moz_win_communications_toolbox
, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX
,
328 eCSSKeyword__moz_win_browsertabbar_toolbox
, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX
,
329 eCSSKeyword__moz_win_glass
, NS_THEME_WIN_GLASS
,
330 eCSSKeyword__moz_mac_unified_toolbar
, NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR
,
331 eCSSKeyword_UNKNOWN
,-1
334 // Keyword id tables for variant/enum parsing
335 const PRInt32
nsCSSProps::kAzimuthKTable
[] = {
336 eCSSKeyword_left_side
, NS_STYLE_AZIMUTH_LEFT_SIDE
,
337 eCSSKeyword_far_left
, NS_STYLE_AZIMUTH_FAR_LEFT
,
338 eCSSKeyword_left
, NS_STYLE_AZIMUTH_LEFT
,
339 eCSSKeyword_center_left
, NS_STYLE_AZIMUTH_CENTER_LEFT
,
340 eCSSKeyword_center
, NS_STYLE_AZIMUTH_CENTER
,
341 eCSSKeyword_center_right
, NS_STYLE_AZIMUTH_CENTER_RIGHT
,
342 eCSSKeyword_right
, NS_STYLE_AZIMUTH_RIGHT
,
343 eCSSKeyword_far_right
, NS_STYLE_AZIMUTH_FAR_RIGHT
,
344 eCSSKeyword_right_side
, NS_STYLE_AZIMUTH_RIGHT_SIDE
,
345 eCSSKeyword_behind
, NS_STYLE_AZIMUTH_BEHIND
,
346 eCSSKeyword_leftwards
, NS_STYLE_AZIMUTH_LEFTWARDS
,
347 eCSSKeyword_rightwards
, NS_STYLE_AZIMUTH_RIGHTWARDS
,
348 eCSSKeyword_UNKNOWN
,-1
351 const PRInt32
nsCSSProps::kBackgroundAttachmentKTable
[] = {
352 eCSSKeyword_fixed
, NS_STYLE_BG_ATTACHMENT_FIXED
,
353 eCSSKeyword_scroll
, NS_STYLE_BG_ATTACHMENT_SCROLL
,
354 eCSSKeyword_UNKNOWN
,-1
357 const PRInt32
nsCSSProps::kBackgroundClipKTable
[] = {
358 eCSSKeyword_border
, NS_STYLE_BG_CLIP_BORDER
,
359 eCSSKeyword_padding
, NS_STYLE_BG_CLIP_PADDING
,
360 eCSSKeyword_UNKNOWN
,-1
363 const PRInt32
nsCSSProps::kBackgroundInlinePolicyKTable
[] = {
364 eCSSKeyword_each_box
, NS_STYLE_BG_INLINE_POLICY_EACH_BOX
,
365 eCSSKeyword_continuous
, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS
,
366 eCSSKeyword_bounding_box
, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX
,
367 eCSSKeyword_UNKNOWN
,-1
370 const PRInt32
nsCSSProps::kBackgroundOriginKTable
[] = {
371 eCSSKeyword_border
, NS_STYLE_BG_ORIGIN_BORDER
,
372 eCSSKeyword_padding
, NS_STYLE_BG_ORIGIN_PADDING
,
373 eCSSKeyword_content
, NS_STYLE_BG_ORIGIN_CONTENT
,
374 eCSSKeyword_UNKNOWN
,-1
377 // Note: Don't change this table unless you update
378 // parseBackgroundPosition!
380 const PRInt32
nsCSSProps::kBackgroundPositionKTable
[] = {
381 eCSSKeyword_center
, NS_STYLE_BG_POSITION_CENTER
,
382 eCSSKeyword_top
, NS_STYLE_BG_POSITION_TOP
,
383 eCSSKeyword_bottom
, NS_STYLE_BG_POSITION_BOTTOM
,
384 eCSSKeyword_left
, NS_STYLE_BG_POSITION_LEFT
,
385 eCSSKeyword_right
, NS_STYLE_BG_POSITION_RIGHT
,
386 eCSSKeyword_UNKNOWN
,-1
389 const PRInt32
nsCSSProps::kBackgroundRepeatKTable
[] = {
390 eCSSKeyword_no_repeat
, NS_STYLE_BG_REPEAT_OFF
,
391 eCSSKeyword_repeat
, NS_STYLE_BG_REPEAT_XY
,
392 eCSSKeyword_repeat_x
, NS_STYLE_BG_REPEAT_X
,
393 eCSSKeyword_repeat_y
, NS_STYLE_BG_REPEAT_Y
,
394 eCSSKeyword_UNKNOWN
,-1
397 const PRInt32
nsCSSProps::kBorderCollapseKTable
[] = {
398 eCSSKeyword_collapse
, NS_STYLE_BORDER_COLLAPSE
,
399 eCSSKeyword_separate
, NS_STYLE_BORDER_SEPARATE
,
400 eCSSKeyword_UNKNOWN
,-1
403 const PRInt32
nsCSSProps::kBorderColorKTable
[] = {
404 eCSSKeyword__moz_use_text_color
, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR
,
405 eCSSKeyword_UNKNOWN
,-1
408 const PRInt32
nsCSSProps::kBorderImageKTable
[] = {
409 eCSSKeyword_stretch
, NS_STYLE_BORDER_IMAGE_STRETCH
,
410 eCSSKeyword_repeat
, NS_STYLE_BORDER_IMAGE_REPEAT
,
411 eCSSKeyword_round
, NS_STYLE_BORDER_IMAGE_ROUND
,
412 eCSSKeyword_UNKNOWN
,-1
415 const PRInt32
nsCSSProps::kBorderStyleKTable
[] = {
416 eCSSKeyword_hidden
, NS_STYLE_BORDER_STYLE_HIDDEN
,
417 eCSSKeyword_dotted
, NS_STYLE_BORDER_STYLE_DOTTED
,
418 eCSSKeyword_dashed
, NS_STYLE_BORDER_STYLE_DASHED
,
419 eCSSKeyword_solid
, NS_STYLE_BORDER_STYLE_SOLID
,
420 eCSSKeyword_double
, NS_STYLE_BORDER_STYLE_DOUBLE
,
421 eCSSKeyword_groove
, NS_STYLE_BORDER_STYLE_GROOVE
,
422 eCSSKeyword_ridge
, NS_STYLE_BORDER_STYLE_RIDGE
,
423 eCSSKeyword_inset
, NS_STYLE_BORDER_STYLE_INSET
,
424 eCSSKeyword_outset
, NS_STYLE_BORDER_STYLE_OUTSET
,
425 eCSSKeyword_UNKNOWN
,-1
428 const PRInt32
nsCSSProps::kBorderWidthKTable
[] = {
429 eCSSKeyword_thin
, NS_STYLE_BORDER_WIDTH_THIN
,
430 eCSSKeyword_medium
, NS_STYLE_BORDER_WIDTH_MEDIUM
,
431 eCSSKeyword_thick
, NS_STYLE_BORDER_WIDTH_THICK
,
432 eCSSKeyword_UNKNOWN
,-1
435 const PRInt32
nsCSSProps::kBoxPropSourceKTable
[] = {
436 eCSSKeyword_physical
, NS_BOXPROP_SOURCE_PHYSICAL
,
437 eCSSKeyword_logical
, NS_BOXPROP_SOURCE_LOGICAL
,
438 eCSSKeyword_UNKNOWN
,-1
441 const PRInt32
nsCSSProps::kBoxSizingKTable
[] = {
442 eCSSKeyword_content_box
, NS_STYLE_BOX_SIZING_CONTENT
,
443 eCSSKeyword_border_box
, NS_STYLE_BOX_SIZING_BORDER
,
444 eCSSKeyword_padding_box
, NS_STYLE_BOX_SIZING_PADDING
,
445 eCSSKeyword_UNKNOWN
,-1
448 const PRInt32
nsCSSProps::kCaptionSideKTable
[] = {
449 eCSSKeyword_top
, NS_STYLE_CAPTION_SIDE_TOP
,
450 eCSSKeyword_right
, NS_STYLE_CAPTION_SIDE_RIGHT
,
451 eCSSKeyword_bottom
, NS_STYLE_CAPTION_SIDE_BOTTOM
,
452 eCSSKeyword_left
, NS_STYLE_CAPTION_SIDE_LEFT
,
453 eCSSKeyword_top_outside
, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE
,
454 eCSSKeyword_bottom_outside
, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE
,
455 eCSSKeyword_UNKNOWN
, -1
458 const PRInt32
nsCSSProps::kClearKTable
[] = {
459 eCSSKeyword_left
, NS_STYLE_CLEAR_LEFT
,
460 eCSSKeyword_right
, NS_STYLE_CLEAR_RIGHT
,
461 eCSSKeyword_both
, NS_STYLE_CLEAR_LEFT_AND_RIGHT
,
462 eCSSKeyword_UNKNOWN
,-1
465 const PRInt32
nsCSSProps::kColorKTable
[] = {
466 eCSSKeyword_activeborder
, nsILookAndFeel::eColor_activeborder
,
467 eCSSKeyword_activecaption
, nsILookAndFeel::eColor_activecaption
,
468 eCSSKeyword_appworkspace
, nsILookAndFeel::eColor_appworkspace
,
469 eCSSKeyword_background
, nsILookAndFeel::eColor_background
,
470 eCSSKeyword_buttonface
, nsILookAndFeel::eColor_buttonface
,
471 eCSSKeyword_buttonhighlight
, nsILookAndFeel::eColor_buttonhighlight
,
472 eCSSKeyword_buttonshadow
, nsILookAndFeel::eColor_buttonshadow
,
473 eCSSKeyword_buttontext
, nsILookAndFeel::eColor_buttontext
,
474 eCSSKeyword_captiontext
, nsILookAndFeel::eColor_captiontext
,
475 eCSSKeyword_graytext
, nsILookAndFeel::eColor_graytext
,
476 eCSSKeyword_highlight
, nsILookAndFeel::eColor_highlight
,
477 eCSSKeyword_highlighttext
, nsILookAndFeel::eColor_highlighttext
,
478 eCSSKeyword_inactiveborder
, nsILookAndFeel::eColor_inactiveborder
,
479 eCSSKeyword_inactivecaption
, nsILookAndFeel::eColor_inactivecaption
,
480 eCSSKeyword_inactivecaptiontext
, nsILookAndFeel::eColor_inactivecaptiontext
,
481 eCSSKeyword_infobackground
, nsILookAndFeel::eColor_infobackground
,
482 eCSSKeyword_infotext
, nsILookAndFeel::eColor_infotext
,
483 eCSSKeyword_menu
, nsILookAndFeel::eColor_menu
,
484 eCSSKeyword_menutext
, nsILookAndFeel::eColor_menutext
,
485 eCSSKeyword_scrollbar
, nsILookAndFeel::eColor_scrollbar
,
486 eCSSKeyword_threeddarkshadow
, nsILookAndFeel::eColor_threeddarkshadow
,
487 eCSSKeyword_threedface
, nsILookAndFeel::eColor_threedface
,
488 eCSSKeyword_threedhighlight
, nsILookAndFeel::eColor_threedhighlight
,
489 eCSSKeyword_threedlightshadow
, nsILookAndFeel::eColor_threedlightshadow
,
490 eCSSKeyword_threedshadow
, nsILookAndFeel::eColor_threedshadow
,
491 eCSSKeyword_window
, nsILookAndFeel::eColor_window
,
492 eCSSKeyword_windowframe
, nsILookAndFeel::eColor_windowframe
,
493 eCSSKeyword_windowtext
, nsILookAndFeel::eColor_windowtext
,
494 eCSSKeyword__moz_activehyperlinktext
, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT
,
495 eCSSKeyword__moz_buttondefault
, nsILookAndFeel::eColor__moz_buttondefault
,
496 eCSSKeyword__moz_buttonhoverface
, nsILookAndFeel::eColor__moz_buttonhoverface
,
497 eCSSKeyword__moz_buttonhovertext
, nsILookAndFeel::eColor__moz_buttonhovertext
,
498 eCSSKeyword__moz_cellhighlight
, nsILookAndFeel::eColor__moz_cellhighlight
,
499 eCSSKeyword__moz_cellhighlighttext
, nsILookAndFeel::eColor__moz_cellhighlighttext
,
500 eCSSKeyword__moz_eventreerow
, nsILookAndFeel::eColor__moz_eventreerow
,
501 eCSSKeyword__moz_field
, nsILookAndFeel::eColor__moz_field
,
502 eCSSKeyword__moz_fieldtext
, nsILookAndFeel::eColor__moz_fieldtext
,
503 eCSSKeyword__moz_dialog
, nsILookAndFeel::eColor__moz_dialog
,
504 eCSSKeyword__moz_dialogtext
, nsILookAndFeel::eColor__moz_dialogtext
,
505 eCSSKeyword__moz_dragtargetzone
, nsILookAndFeel::eColor__moz_dragtargetzone
,
506 eCSSKeyword__moz_hyperlinktext
, NS_COLOR_MOZ_HYPERLINKTEXT
,
507 eCSSKeyword__moz_html_cellhighlight
, nsILookAndFeel::eColor__moz_html_cellhighlight
,
508 eCSSKeyword__moz_html_cellhighlighttext
, nsILookAndFeel::eColor__moz_html_cellhighlighttext
,
509 eCSSKeyword__moz_mac_chrome_active
, nsILookAndFeel::eColor__moz_mac_chrome_active
,
510 eCSSKeyword__moz_mac_chrome_inactive
, nsILookAndFeel::eColor__moz_mac_chrome_inactive
,
511 eCSSKeyword__moz_mac_focusring
, nsILookAndFeel::eColor__moz_mac_focusring
,
512 eCSSKeyword__moz_mac_menuselect
, nsILookAndFeel::eColor__moz_mac_menuselect
,
513 eCSSKeyword__moz_mac_menushadow
, nsILookAndFeel::eColor__moz_mac_menushadow
,
514 eCSSKeyword__moz_mac_menutextdisable
, nsILookAndFeel::eColor__moz_mac_menutextdisable
,
515 eCSSKeyword__moz_mac_menutextselect
, nsILookAndFeel::eColor__moz_mac_menutextselect
,
516 eCSSKeyword__moz_mac_accentlightesthighlight
, nsILookAndFeel::eColor__moz_mac_accentlightesthighlight
,
517 eCSSKeyword__moz_mac_accentregularhighlight
, nsILookAndFeel::eColor__moz_mac_accentregularhighlight
,
518 eCSSKeyword__moz_mac_accentface
, nsILookAndFeel::eColor__moz_mac_accentface
,
519 eCSSKeyword__moz_mac_accentlightshadow
, nsILookAndFeel::eColor__moz_mac_accentlightshadow
,
520 eCSSKeyword__moz_mac_accentregularshadow
, nsILookAndFeel::eColor__moz_mac_accentregularshadow
,
521 eCSSKeyword__moz_mac_accentdarkshadow
, nsILookAndFeel::eColor__moz_mac_accentdarkshadow
,
522 eCSSKeyword__moz_mac_accentdarkestshadow
, nsILookAndFeel::eColor__moz_mac_accentdarkestshadow
,
523 eCSSKeyword__moz_mac_alternateprimaryhighlight
, nsILookAndFeel::eColor__moz_mac_alternateprimaryhighlight
,
524 eCSSKeyword__moz_mac_secondaryhighlight
, nsILookAndFeel::eColor__moz_mac_secondaryhighlight
,
525 eCSSKeyword__moz_menuhover
, nsILookAndFeel::eColor__moz_menuhover
,
526 eCSSKeyword__moz_menuhovertext
, nsILookAndFeel::eColor__moz_menuhovertext
,
527 eCSSKeyword__moz_menubarhovertext
, nsILookAndFeel::eColor__moz_menubarhovertext
,
528 eCSSKeyword__moz_oddtreerow
, nsILookAndFeel::eColor__moz_oddtreerow
,
529 eCSSKeyword__moz_visitedhyperlinktext
, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT
,
530 eCSSKeyword_currentcolor
, NS_COLOR_CURRENTCOLOR
,
531 eCSSKeyword__moz_win_mediatext
, nsILookAndFeel::eColor__moz_win_mediatext
,
532 eCSSKeyword__moz_win_communicationstext
, nsILookAndFeel::eColor__moz_win_communicationstext
,
533 eCSSKeyword__moz_nativehyperlinktext
, nsILookAndFeel::eColor__moz_nativehyperlinktext
,
534 eCSSKeyword_UNKNOWN
,-1
537 const PRInt32
nsCSSProps::kContentKTable
[] = {
538 eCSSKeyword_open_quote
, NS_STYLE_CONTENT_OPEN_QUOTE
,
539 eCSSKeyword_close_quote
, NS_STYLE_CONTENT_CLOSE_QUOTE
,
540 eCSSKeyword_no_open_quote
, NS_STYLE_CONTENT_NO_OPEN_QUOTE
,
541 eCSSKeyword_no_close_quote
, NS_STYLE_CONTENT_NO_CLOSE_QUOTE
,
542 eCSSKeyword__moz_alt_content
, NS_STYLE_CONTENT_ALT_CONTENT
,
543 eCSSKeyword_UNKNOWN
,-1
546 const PRInt32
nsCSSProps::kCursorKTable
[] = {
548 eCSSKeyword_crosshair
, NS_STYLE_CURSOR_CROSSHAIR
,
549 eCSSKeyword_default
, NS_STYLE_CURSOR_DEFAULT
,
550 eCSSKeyword_pointer
, NS_STYLE_CURSOR_POINTER
,
551 eCSSKeyword_move
, NS_STYLE_CURSOR_MOVE
,
552 eCSSKeyword_e_resize
, NS_STYLE_CURSOR_E_RESIZE
,
553 eCSSKeyword_ne_resize
, NS_STYLE_CURSOR_NE_RESIZE
,
554 eCSSKeyword_nw_resize
, NS_STYLE_CURSOR_NW_RESIZE
,
555 eCSSKeyword_n_resize
, NS_STYLE_CURSOR_N_RESIZE
,
556 eCSSKeyword_se_resize
, NS_STYLE_CURSOR_SE_RESIZE
,
557 eCSSKeyword_sw_resize
, NS_STYLE_CURSOR_SW_RESIZE
,
558 eCSSKeyword_s_resize
, NS_STYLE_CURSOR_S_RESIZE
,
559 eCSSKeyword_w_resize
, NS_STYLE_CURSOR_W_RESIZE
,
560 eCSSKeyword_text
, NS_STYLE_CURSOR_TEXT
,
561 eCSSKeyword_wait
, NS_STYLE_CURSOR_WAIT
,
562 eCSSKeyword_help
, NS_STYLE_CURSOR_HELP
,
564 eCSSKeyword_progress
, NS_STYLE_CURSOR_SPINNING
,
565 // CSS3 basic user interface module
566 eCSSKeyword_copy
, NS_STYLE_CURSOR_COPY
,
567 eCSSKeyword_alias
, NS_STYLE_CURSOR_ALIAS
,
568 eCSSKeyword_context_menu
, NS_STYLE_CURSOR_CONTEXT_MENU
,
569 eCSSKeyword_cell
, NS_STYLE_CURSOR_CELL
,
570 eCSSKeyword_not_allowed
, NS_STYLE_CURSOR_NOT_ALLOWED
,
571 eCSSKeyword_col_resize
, NS_STYLE_CURSOR_COL_RESIZE
,
572 eCSSKeyword_row_resize
, NS_STYLE_CURSOR_ROW_RESIZE
,
573 eCSSKeyword_no_drop
, NS_STYLE_CURSOR_NO_DROP
,
574 eCSSKeyword_vertical_text
, NS_STYLE_CURSOR_VERTICAL_TEXT
,
575 eCSSKeyword_all_scroll
, NS_STYLE_CURSOR_ALL_SCROLL
,
576 eCSSKeyword_nesw_resize
, NS_STYLE_CURSOR_NESW_RESIZE
,
577 eCSSKeyword_nwse_resize
, NS_STYLE_CURSOR_NWSE_RESIZE
,
578 eCSSKeyword_ns_resize
, NS_STYLE_CURSOR_NS_RESIZE
,
579 eCSSKeyword_ew_resize
, NS_STYLE_CURSOR_EW_RESIZE
,
580 eCSSKeyword_none
, NS_STYLE_CURSOR_NONE
,
581 // -moz- prefixed aliases for some CSS3 cursors for backward compat
582 eCSSKeyword__moz_copy
, NS_STYLE_CURSOR_COPY
,
583 eCSSKeyword__moz_alias
, NS_STYLE_CURSOR_ALIAS
,
584 eCSSKeyword__moz_context_menu
, NS_STYLE_CURSOR_CONTEXT_MENU
,
585 eCSSKeyword__moz_cell
, NS_STYLE_CURSOR_CELL
,
586 // -moz- prefixed vendor specific
587 eCSSKeyword__moz_grab
, NS_STYLE_CURSOR_GRAB
,
588 eCSSKeyword__moz_grabbing
, NS_STYLE_CURSOR_GRABBING
,
589 eCSSKeyword__moz_spinning
, NS_STYLE_CURSOR_SPINNING
,
590 eCSSKeyword__moz_zoom_in
, NS_STYLE_CURSOR_MOZ_ZOOM_IN
,
591 eCSSKeyword__moz_zoom_out
, NS_STYLE_CURSOR_MOZ_ZOOM_OUT
,
592 eCSSKeyword_UNKNOWN
,-1
595 const PRInt32
nsCSSProps::kDirectionKTable
[] = {
596 eCSSKeyword_ltr
, NS_STYLE_DIRECTION_LTR
,
597 eCSSKeyword_rtl
, NS_STYLE_DIRECTION_RTL
,
598 eCSSKeyword_UNKNOWN
,-1
601 const PRInt32
nsCSSProps::kDisplayKTable
[] = {
602 eCSSKeyword_inline
, NS_STYLE_DISPLAY_INLINE
,
603 eCSSKeyword_block
, NS_STYLE_DISPLAY_BLOCK
,
604 eCSSKeyword_inline_block
, NS_STYLE_DISPLAY_INLINE_BLOCK
,
605 eCSSKeyword_list_item
, NS_STYLE_DISPLAY_LIST_ITEM
,
606 eCSSKeyword__moz_run_in
, NS_STYLE_DISPLAY_RUN_IN
,
607 eCSSKeyword__moz_compact
, NS_STYLE_DISPLAY_COMPACT
,
608 eCSSKeyword__moz_marker
, NS_STYLE_DISPLAY_MARKER
,
609 eCSSKeyword_table
, NS_STYLE_DISPLAY_TABLE
,
610 eCSSKeyword_inline_table
, NS_STYLE_DISPLAY_INLINE_TABLE
,
611 eCSSKeyword_table_row_group
, NS_STYLE_DISPLAY_TABLE_ROW_GROUP
,
612 eCSSKeyword_table_header_group
, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP
,
613 eCSSKeyword_table_footer_group
, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP
,
614 eCSSKeyword_table_row
, NS_STYLE_DISPLAY_TABLE_ROW
,
615 eCSSKeyword_table_column_group
, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP
,
616 eCSSKeyword_table_column
, NS_STYLE_DISPLAY_TABLE_COLUMN
,
617 eCSSKeyword_table_cell
, NS_STYLE_DISPLAY_TABLE_CELL
,
618 eCSSKeyword_table_caption
, NS_STYLE_DISPLAY_TABLE_CAPTION
,
619 // Make sure this is kept in sync with the code in
620 // nsCSSFrameConstructor::ConstructXULFrame
621 eCSSKeyword__moz_box
, NS_STYLE_DISPLAY_BOX
,
622 eCSSKeyword__moz_inline_box
, NS_STYLE_DISPLAY_INLINE_BOX
,
624 eCSSKeyword__moz_grid
, NS_STYLE_DISPLAY_GRID
,
625 eCSSKeyword__moz_inline_grid
, NS_STYLE_DISPLAY_INLINE_GRID
,
626 eCSSKeyword__moz_grid_group
, NS_STYLE_DISPLAY_GRID_GROUP
,
627 eCSSKeyword__moz_grid_line
, NS_STYLE_DISPLAY_GRID_LINE
,
628 eCSSKeyword__moz_stack
, NS_STYLE_DISPLAY_STACK
,
629 eCSSKeyword__moz_inline_stack
, NS_STYLE_DISPLAY_INLINE_STACK
,
630 eCSSKeyword__moz_deck
, NS_STYLE_DISPLAY_DECK
,
631 eCSSKeyword__moz_popup
, NS_STYLE_DISPLAY_POPUP
,
632 eCSSKeyword__moz_groupbox
, NS_STYLE_DISPLAY_GROUPBOX
,
634 eCSSKeyword_UNKNOWN
,-1
637 const PRInt32
nsCSSProps::kElevationKTable
[] = {
638 eCSSKeyword_below
, NS_STYLE_ELEVATION_BELOW
,
639 eCSSKeyword_level
, NS_STYLE_ELEVATION_LEVEL
,
640 eCSSKeyword_above
, NS_STYLE_ELEVATION_ABOVE
,
641 eCSSKeyword_higher
, NS_STYLE_ELEVATION_HIGHER
,
642 eCSSKeyword_lower
, NS_STYLE_ELEVATION_LOWER
,
643 eCSSKeyword_UNKNOWN
,-1
646 const PRInt32
nsCSSProps::kEmptyCellsKTable
[] = {
647 eCSSKeyword_show
, NS_STYLE_TABLE_EMPTY_CELLS_SHOW
,
648 eCSSKeyword_hide
, NS_STYLE_TABLE_EMPTY_CELLS_HIDE
,
649 eCSSKeyword__moz_show_background
, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND
,
650 eCSSKeyword_UNKNOWN
,-1
653 const PRInt32
nsCSSProps::kFloatKTable
[] = {
654 eCSSKeyword_left
, NS_STYLE_FLOAT_LEFT
,
655 eCSSKeyword_right
, NS_STYLE_FLOAT_RIGHT
,
656 eCSSKeyword_UNKNOWN
,-1
659 const PRInt32
nsCSSProps::kFloatEdgeKTable
[] = {
660 eCSSKeyword_content_box
, NS_STYLE_FLOAT_EDGE_CONTENT
,
661 eCSSKeyword_margin_box
, NS_STYLE_FLOAT_EDGE_MARGIN
,
662 eCSSKeyword_UNKNOWN
,-1
665 const PRInt32
nsCSSProps::kFontKTable
[] = {
667 eCSSKeyword_caption
, NS_STYLE_FONT_CAPTION
,
668 eCSSKeyword_icon
, NS_STYLE_FONT_ICON
,
669 eCSSKeyword_menu
, NS_STYLE_FONT_MENU
,
670 eCSSKeyword_message_box
, NS_STYLE_FONT_MESSAGE_BOX
,
671 eCSSKeyword_small_caption
, NS_STYLE_FONT_SMALL_CAPTION
,
672 eCSSKeyword_status_bar
, NS_STYLE_FONT_STATUS_BAR
,
674 // Proposed for CSS3.
675 eCSSKeyword__moz_window
, NS_STYLE_FONT_WINDOW
,
676 eCSSKeyword__moz_document
, NS_STYLE_FONT_DOCUMENT
,
677 eCSSKeyword__moz_workspace
, NS_STYLE_FONT_WORKSPACE
,
678 eCSSKeyword__moz_desktop
, NS_STYLE_FONT_DESKTOP
,
679 eCSSKeyword__moz_info
, NS_STYLE_FONT_INFO
,
680 eCSSKeyword__moz_dialog
, NS_STYLE_FONT_DIALOG
,
681 eCSSKeyword__moz_button
, NS_STYLE_FONT_BUTTON
,
682 eCSSKeyword__moz_pull_down_menu
, NS_STYLE_FONT_PULL_DOWN_MENU
,
683 eCSSKeyword__moz_list
, NS_STYLE_FONT_LIST
,
684 eCSSKeyword__moz_field
, NS_STYLE_FONT_FIELD
,
685 eCSSKeyword_UNKNOWN
,-1
688 const PRInt32
nsCSSProps::kFontSizeKTable
[] = {
689 eCSSKeyword_xx_small
, NS_STYLE_FONT_SIZE_XXSMALL
,
690 eCSSKeyword_x_small
, NS_STYLE_FONT_SIZE_XSMALL
,
691 eCSSKeyword_small
, NS_STYLE_FONT_SIZE_SMALL
,
692 eCSSKeyword_medium
, NS_STYLE_FONT_SIZE_MEDIUM
,
693 eCSSKeyword_large
, NS_STYLE_FONT_SIZE_LARGE
,
694 eCSSKeyword_x_large
, NS_STYLE_FONT_SIZE_XLARGE
,
695 eCSSKeyword_xx_large
, NS_STYLE_FONT_SIZE_XXLARGE
,
696 eCSSKeyword_larger
, NS_STYLE_FONT_SIZE_LARGER
,
697 eCSSKeyword_smaller
, NS_STYLE_FONT_SIZE_SMALLER
,
698 eCSSKeyword_UNKNOWN
,-1
701 const PRInt32
nsCSSProps::kFontStretchKTable
[] = {
702 eCSSKeyword_wider
, NS_STYLE_FONT_STRETCH_WIDER
,
703 eCSSKeyword_narrower
, NS_STYLE_FONT_STRETCH_NARROWER
,
704 eCSSKeyword_ultra_condensed
, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED
,
705 eCSSKeyword_extra_condensed
, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED
,
706 eCSSKeyword_condensed
, NS_STYLE_FONT_STRETCH_CONDENSED
,
707 eCSSKeyword_semi_condensed
, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED
,
708 eCSSKeyword_semi_expanded
, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED
,
709 eCSSKeyword_expanded
, NS_STYLE_FONT_STRETCH_EXPANDED
,
710 eCSSKeyword_extra_expanded
, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED
,
711 eCSSKeyword_ultra_expanded
, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED
,
712 eCSSKeyword_UNKNOWN
,-1
715 const PRInt32
nsCSSProps::kFontStyleKTable
[] = {
716 eCSSKeyword_italic
, NS_STYLE_FONT_STYLE_ITALIC
,
717 eCSSKeyword_oblique
, NS_STYLE_FONT_STYLE_OBLIQUE
,
718 eCSSKeyword_UNKNOWN
,-1
721 const PRInt32
nsCSSProps::kFontVariantKTable
[] = {
722 eCSSKeyword_small_caps
, NS_STYLE_FONT_VARIANT_SMALL_CAPS
,
723 eCSSKeyword_UNKNOWN
,-1
726 const PRInt32
nsCSSProps::kFontWeightKTable
[] = {
727 eCSSKeyword_bold
, NS_STYLE_FONT_WEIGHT_BOLD
,
728 eCSSKeyword_bolder
, NS_STYLE_FONT_WEIGHT_BOLDER
,
729 eCSSKeyword_lighter
, NS_STYLE_FONT_WEIGHT_LIGHTER
,
730 eCSSKeyword_UNKNOWN
,-1
733 const PRInt32
nsCSSProps::kIMEModeKTable
[] = {
734 eCSSKeyword_active
, NS_STYLE_IME_MODE_ACTIVE
,
735 eCSSKeyword_disabled
, NS_STYLE_IME_MODE_DISABLED
,
736 eCSSKeyword_inactive
, NS_STYLE_IME_MODE_INACTIVE
,
737 eCSSKeyword_UNKNOWN
,-1
740 // XXX What's the point?
741 const PRInt32
nsCSSProps::kKeyEquivalentKTable
[] = {
742 eCSSKeyword_UNKNOWN
,-1
745 const PRInt32
nsCSSProps::kListStylePositionKTable
[] = {
746 eCSSKeyword_inside
, NS_STYLE_LIST_STYLE_POSITION_INSIDE
,
747 eCSSKeyword_outside
, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE
,
748 eCSSKeyword_UNKNOWN
,-1
751 const PRInt32
nsCSSProps::kListStyleKTable
[] = {
752 eCSSKeyword_disc
, NS_STYLE_LIST_STYLE_DISC
,
753 eCSSKeyword_circle
, NS_STYLE_LIST_STYLE_CIRCLE
,
754 eCSSKeyword_square
, NS_STYLE_LIST_STYLE_SQUARE
,
755 eCSSKeyword_decimal
, NS_STYLE_LIST_STYLE_DECIMAL
,
756 eCSSKeyword_decimal_leading_zero
, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO
,
757 eCSSKeyword_lower_roman
, NS_STYLE_LIST_STYLE_LOWER_ROMAN
,
758 eCSSKeyword_upper_roman
, NS_STYLE_LIST_STYLE_UPPER_ROMAN
,
759 eCSSKeyword_lower_greek
, NS_STYLE_LIST_STYLE_LOWER_GREEK
,
760 eCSSKeyword_lower_alpha
, NS_STYLE_LIST_STYLE_LOWER_ALPHA
,
761 eCSSKeyword_lower_latin
, NS_STYLE_LIST_STYLE_LOWER_LATIN
,
762 eCSSKeyword_upper_alpha
, NS_STYLE_LIST_STYLE_UPPER_ALPHA
,
763 eCSSKeyword_upper_latin
, NS_STYLE_LIST_STYLE_UPPER_LATIN
,
764 eCSSKeyword_hebrew
, NS_STYLE_LIST_STYLE_HEBREW
,
765 eCSSKeyword_armenian
, NS_STYLE_LIST_STYLE_ARMENIAN
,
766 eCSSKeyword_georgian
, NS_STYLE_LIST_STYLE_GEORGIAN
,
767 eCSSKeyword_cjk_ideographic
, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC
,
768 eCSSKeyword_hiragana
, NS_STYLE_LIST_STYLE_HIRAGANA
,
769 eCSSKeyword_katakana
, NS_STYLE_LIST_STYLE_KATAKANA
,
770 eCSSKeyword_hiragana_iroha
, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA
,
771 eCSSKeyword_katakana_iroha
, NS_STYLE_LIST_STYLE_KATAKANA_IROHA
,
772 eCSSKeyword__moz_cjk_heavenly_stem
, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM
,
773 eCSSKeyword__moz_cjk_earthly_branch
, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH
,
774 eCSSKeyword__moz_trad_chinese_informal
, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL
,
775 eCSSKeyword__moz_trad_chinese_formal
, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL
,
776 eCSSKeyword__moz_simp_chinese_informal
, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL
,
777 eCSSKeyword__moz_simp_chinese_formal
, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL
,
778 eCSSKeyword__moz_japanese_informal
, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL
,
779 eCSSKeyword__moz_japanese_formal
, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL
,
780 eCSSKeyword__moz_arabic_indic
, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC
,
781 eCSSKeyword__moz_persian
, NS_STYLE_LIST_STYLE_MOZ_PERSIAN
,
782 eCSSKeyword__moz_urdu
, NS_STYLE_LIST_STYLE_MOZ_URDU
,
783 eCSSKeyword__moz_devanagari
, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI
,
784 eCSSKeyword__moz_gurmukhi
, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI
,
785 eCSSKeyword__moz_gujarati
, NS_STYLE_LIST_STYLE_MOZ_GUJARATI
,
786 eCSSKeyword__moz_oriya
, NS_STYLE_LIST_STYLE_MOZ_ORIYA
,
787 eCSSKeyword__moz_kannada
, NS_STYLE_LIST_STYLE_MOZ_KANNADA
,
788 eCSSKeyword__moz_malayalam
, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM
,
789 eCSSKeyword__moz_bengali
, NS_STYLE_LIST_STYLE_MOZ_BENGALI
,
790 eCSSKeyword__moz_tamil
, NS_STYLE_LIST_STYLE_MOZ_TAMIL
,
791 eCSSKeyword__moz_telugu
, NS_STYLE_LIST_STYLE_MOZ_TELUGU
,
792 eCSSKeyword__moz_thai
, NS_STYLE_LIST_STYLE_MOZ_THAI
,
793 eCSSKeyword__moz_lao
, NS_STYLE_LIST_STYLE_MOZ_LAO
,
794 eCSSKeyword__moz_myanmar
, NS_STYLE_LIST_STYLE_MOZ_MYANMAR
,
795 eCSSKeyword__moz_khmer
, NS_STYLE_LIST_STYLE_MOZ_KHMER
,
796 eCSSKeyword__moz_hangul
, NS_STYLE_LIST_STYLE_MOZ_HANGUL
,
797 eCSSKeyword__moz_hangul_consonant
, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT
,
798 eCSSKeyword__moz_ethiopic_halehame
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME
,
799 eCSSKeyword__moz_ethiopic_numeric
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC
,
800 eCSSKeyword__moz_ethiopic_halehame_am
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM
,
801 eCSSKeyword__moz_ethiopic_halehame_ti_er
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER
,
802 eCSSKeyword__moz_ethiopic_halehame_ti_et
, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET
,
803 eCSSKeyword_UNKNOWN
,-1
806 // Same as kBorderStyleKTable except 'hidden'.
807 const PRInt32
nsCSSProps::kOutlineStyleKTable
[] = {
808 eCSSKeyword_dotted
, NS_STYLE_BORDER_STYLE_DOTTED
,
809 eCSSKeyword_dashed
, NS_STYLE_BORDER_STYLE_DASHED
,
810 eCSSKeyword_solid
, NS_STYLE_BORDER_STYLE_SOLID
,
811 eCSSKeyword_double
, NS_STYLE_BORDER_STYLE_DOUBLE
,
812 eCSSKeyword_groove
, NS_STYLE_BORDER_STYLE_GROOVE
,
813 eCSSKeyword_ridge
, NS_STYLE_BORDER_STYLE_RIDGE
,
814 eCSSKeyword_inset
, NS_STYLE_BORDER_STYLE_INSET
,
815 eCSSKeyword_outset
, NS_STYLE_BORDER_STYLE_OUTSET
,
816 eCSSKeyword_UNKNOWN
,-1
819 const PRInt32
nsCSSProps::kOutlineColorKTable
[] = {
820 #ifdef GFX_HAS_INVERT
821 eCSSKeyword_invert
, NS_STYLE_COLOR_INVERT
,
823 eCSSKeyword__moz_use_text_color
, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR
,
825 eCSSKeyword_UNKNOWN
,-1
828 const PRInt32
nsCSSProps::kOverflowKTable
[] = {
829 eCSSKeyword_visible
, NS_STYLE_OVERFLOW_VISIBLE
,
830 eCSSKeyword_hidden
, NS_STYLE_OVERFLOW_HIDDEN
,
831 eCSSKeyword_scroll
, NS_STYLE_OVERFLOW_SCROLL
,
833 eCSSKeyword__moz_scrollbars_none
, NS_STYLE_OVERFLOW_HIDDEN
,
834 eCSSKeyword__moz_scrollbars_horizontal
, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL
,
835 eCSSKeyword__moz_scrollbars_vertical
, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL
,
836 eCSSKeyword__moz_hidden_unscrollable
, NS_STYLE_OVERFLOW_CLIP
,
837 eCSSKeyword_UNKNOWN
,-1
840 const PRInt32
nsCSSProps::kOverflowSubKTable
[] = {
841 eCSSKeyword_visible
, NS_STYLE_OVERFLOW_VISIBLE
,
842 eCSSKeyword_hidden
, NS_STYLE_OVERFLOW_HIDDEN
,
843 eCSSKeyword_scroll
, NS_STYLE_OVERFLOW_SCROLL
,
845 eCSSKeyword__moz_hidden_unscrollable
, NS_STYLE_OVERFLOW_CLIP
,
846 eCSSKeyword_UNKNOWN
,-1
849 const PRInt32
nsCSSProps::kPageBreakKTable
[] = {
850 eCSSKeyword_always
, NS_STYLE_PAGE_BREAK_ALWAYS
,
851 eCSSKeyword_avoid
, NS_STYLE_PAGE_BREAK_AVOID
,
852 eCSSKeyword_left
, NS_STYLE_PAGE_BREAK_LEFT
,
853 eCSSKeyword_right
, NS_STYLE_PAGE_BREAK_RIGHT
,
854 eCSSKeyword_UNKNOWN
,-1
857 const PRInt32
nsCSSProps::kPageBreakInsideKTable
[] = {
858 eCSSKeyword_avoid
, NS_STYLE_PAGE_BREAK_AVOID
,
859 eCSSKeyword_UNKNOWN
,-1
862 const PRInt32
nsCSSProps::kPageMarksKTable
[] = {
863 eCSSKeyword_crop
, NS_STYLE_PAGE_MARKS_CROP
,
864 eCSSKeyword_cross
, NS_STYLE_PAGE_MARKS_REGISTER
,
865 eCSSKeyword_UNKNOWN
,-1
868 const PRInt32
nsCSSProps::kPageSizeKTable
[] = {
869 eCSSKeyword_landscape
, NS_STYLE_PAGE_SIZE_LANDSCAPE
,
870 eCSSKeyword_portrait
, NS_STYLE_PAGE_SIZE_PORTRAIT
,
871 eCSSKeyword_UNKNOWN
,-1
874 const PRInt32
nsCSSProps::kPitchKTable
[] = {
875 eCSSKeyword_x_low
, NS_STYLE_PITCH_X_LOW
,
876 eCSSKeyword_low
, NS_STYLE_PITCH_LOW
,
877 eCSSKeyword_medium
, NS_STYLE_PITCH_MEDIUM
,
878 eCSSKeyword_high
, NS_STYLE_PITCH_HIGH
,
879 eCSSKeyword_x_high
, NS_STYLE_PITCH_X_HIGH
,
880 eCSSKeyword_UNKNOWN
,-1
883 const PRInt32
nsCSSProps::kPositionKTable
[] = {
884 eCSSKeyword_static
, NS_STYLE_POSITION_STATIC
,
885 eCSSKeyword_relative
, NS_STYLE_POSITION_RELATIVE
,
886 eCSSKeyword_absolute
, NS_STYLE_POSITION_ABSOLUTE
,
887 eCSSKeyword_fixed
, NS_STYLE_POSITION_FIXED
,
888 eCSSKeyword_UNKNOWN
,-1
891 const PRInt32
nsCSSProps::kSpeakKTable
[] = {
892 eCSSKeyword_spell_out
, NS_STYLE_SPEAK_SPELL_OUT
,
893 eCSSKeyword_UNKNOWN
,-1
896 const PRInt32
nsCSSProps::kSpeakHeaderKTable
[] = {
897 eCSSKeyword_once
, NS_STYLE_SPEAK_HEADER_ONCE
,
898 eCSSKeyword_always
, NS_STYLE_SPEAK_HEADER_ALWAYS
,
899 eCSSKeyword_UNKNOWN
,-1
902 const PRInt32
nsCSSProps::kSpeakNumeralKTable
[] = {
903 eCSSKeyword_digits
, NS_STYLE_SPEAK_NUMERAL_DIGITS
,
904 eCSSKeyword_continuous
, NS_STYLE_SPEAK_NUMERAL_CONTINUOUS
,
905 eCSSKeyword_UNKNOWN
,-1
908 const PRInt32
nsCSSProps::kSpeakPunctuationKTable
[] = {
909 eCSSKeyword_code
, NS_STYLE_SPEAK_PUNCTUATION_CODE
,
910 eCSSKeyword_UNKNOWN
,-1
913 const PRInt32
nsCSSProps::kSpeechRateKTable
[] = {
914 eCSSKeyword_x_slow
, NS_STYLE_SPEECH_RATE_X_SLOW
,
915 eCSSKeyword_slow
, NS_STYLE_SPEECH_RATE_SLOW
,
916 eCSSKeyword_medium
, NS_STYLE_SPEECH_RATE_MEDIUM
,
917 eCSSKeyword_fast
, NS_STYLE_SPEECH_RATE_FAST
,
918 eCSSKeyword_x_fast
, NS_STYLE_SPEECH_RATE_X_FAST
,
919 eCSSKeyword_faster
, NS_STYLE_SPEECH_RATE_FASTER
,
920 eCSSKeyword_slower
, NS_STYLE_SPEECH_RATE_SLOWER
,
921 eCSSKeyword_UNKNOWN
,-1
924 const PRInt32
nsCSSProps::kStackSizingKTable
[] = {
925 eCSSKeyword_ignore
, NS_STYLE_STACK_SIZING_IGNORE
,
926 eCSSKeyword_stretch_to_fit
, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT
,
927 eCSSKeyword_UNKNOWN
,-1
930 const PRInt32
nsCSSProps::kTableLayoutKTable
[] = {
931 eCSSKeyword_fixed
, NS_STYLE_TABLE_LAYOUT_FIXED
,
932 eCSSKeyword_UNKNOWN
,-1
935 const PRInt32
nsCSSProps::kTextAlignKTable
[] = {
936 eCSSKeyword_left
, NS_STYLE_TEXT_ALIGN_LEFT
,
937 eCSSKeyword_right
, NS_STYLE_TEXT_ALIGN_RIGHT
,
938 eCSSKeyword_center
, NS_STYLE_TEXT_ALIGN_CENTER
,
939 eCSSKeyword_justify
, NS_STYLE_TEXT_ALIGN_JUSTIFY
,
940 eCSSKeyword__moz_center
, NS_STYLE_TEXT_ALIGN_MOZ_CENTER
,
941 eCSSKeyword__moz_right
, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT
,
942 eCSSKeyword__moz_left
, NS_STYLE_TEXT_ALIGN_MOZ_LEFT
,
943 eCSSKeyword_start
, NS_STYLE_TEXT_ALIGN_DEFAULT
,
944 eCSSKeyword_UNKNOWN
,-1
947 const PRInt32
nsCSSProps::kTextDecorationKTable
[] = {
948 eCSSKeyword_underline
, NS_STYLE_TEXT_DECORATION_UNDERLINE
,
949 eCSSKeyword_overline
, NS_STYLE_TEXT_DECORATION_OVERLINE
,
950 eCSSKeyword_line_through
, NS_STYLE_TEXT_DECORATION_LINE_THROUGH
,
951 eCSSKeyword_blink
, NS_STYLE_TEXT_DECORATION_BLINK
,
952 eCSSKeyword__moz_anchor_decoration
, NS_STYLE_TEXT_DECORATION_PREF_ANCHORS
,
953 eCSSKeyword_UNKNOWN
,-1
956 const PRInt32
nsCSSProps::kTextTransformKTable
[] = {
957 eCSSKeyword_capitalize
, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE
,
958 eCSSKeyword_lowercase
, NS_STYLE_TEXT_TRANSFORM_LOWERCASE
,
959 eCSSKeyword_uppercase
, NS_STYLE_TEXT_TRANSFORM_UPPERCASE
,
960 eCSSKeyword_UNKNOWN
,-1
963 const PRInt32
nsCSSProps::kUnicodeBidiKTable
[] = {
964 eCSSKeyword_embed
, NS_STYLE_UNICODE_BIDI_EMBED
,
965 eCSSKeyword_bidi_override
, NS_STYLE_UNICODE_BIDI_OVERRIDE
,
966 eCSSKeyword_UNKNOWN
,-1
969 const PRInt32
nsCSSProps::kUserFocusKTable
[] = {
970 eCSSKeyword_ignore
, NS_STYLE_USER_FOCUS_IGNORE
,
971 eCSSKeyword_select_all
, NS_STYLE_USER_FOCUS_SELECT_ALL
,
972 eCSSKeyword_select_before
, NS_STYLE_USER_FOCUS_SELECT_BEFORE
,
973 eCSSKeyword_select_after
, NS_STYLE_USER_FOCUS_SELECT_AFTER
,
974 eCSSKeyword_select_same
, NS_STYLE_USER_FOCUS_SELECT_SAME
,
975 eCSSKeyword_select_menu
, NS_STYLE_USER_FOCUS_SELECT_MENU
,
976 eCSSKeyword_UNKNOWN
,-1
979 const PRInt32
nsCSSProps::kUserInputKTable
[] = {
980 eCSSKeyword_enabled
, NS_STYLE_USER_INPUT_ENABLED
,
981 eCSSKeyword_disabled
, NS_STYLE_USER_INPUT_DISABLED
,
982 eCSSKeyword_UNKNOWN
,-1
985 const PRInt32
nsCSSProps::kUserModifyKTable
[] = {
986 eCSSKeyword_read_only
, NS_STYLE_USER_MODIFY_READ_ONLY
,
987 eCSSKeyword_read_write
, NS_STYLE_USER_MODIFY_READ_WRITE
,
988 eCSSKeyword_write_only
, NS_STYLE_USER_MODIFY_WRITE_ONLY
,
989 eCSSKeyword_UNKNOWN
,-1
992 const PRInt32
nsCSSProps::kUserSelectKTable
[] = {
993 eCSSKeyword_text
, NS_STYLE_USER_SELECT_TEXT
,
994 eCSSKeyword_element
, NS_STYLE_USER_SELECT_ELEMENT
,
995 eCSSKeyword_elements
, NS_STYLE_USER_SELECT_ELEMENTS
,
996 eCSSKeyword_all
, NS_STYLE_USER_SELECT_ALL
,
997 eCSSKeyword_toggle
, NS_STYLE_USER_SELECT_TOGGLE
,
998 eCSSKeyword_tri_state
, NS_STYLE_USER_SELECT_TRI_STATE
,
999 eCSSKeyword__moz_all
, NS_STYLE_USER_SELECT_MOZ_ALL
,
1000 eCSSKeyword__moz_none
, NS_STYLE_USER_SELECT_MOZ_NONE
,
1001 eCSSKeyword_UNKNOWN
,-1
1004 const PRInt32
nsCSSProps::kVerticalAlignKTable
[] = {
1005 eCSSKeyword_baseline
, NS_STYLE_VERTICAL_ALIGN_BASELINE
,
1006 eCSSKeyword_sub
, NS_STYLE_VERTICAL_ALIGN_SUB
,
1007 eCSSKeyword_super
, NS_STYLE_VERTICAL_ALIGN_SUPER
,
1008 eCSSKeyword_top
, NS_STYLE_VERTICAL_ALIGN_TOP
,
1009 eCSSKeyword_text_top
, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP
,
1010 eCSSKeyword_middle
, NS_STYLE_VERTICAL_ALIGN_MIDDLE
,
1011 eCSSKeyword__moz_middle_with_baseline
, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE
,
1012 eCSSKeyword_bottom
, NS_STYLE_VERTICAL_ALIGN_BOTTOM
,
1013 eCSSKeyword_text_bottom
, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM
,
1014 eCSSKeyword_UNKNOWN
,-1
1017 const PRInt32
nsCSSProps::kVisibilityKTable
[] = {
1018 eCSSKeyword_visible
, NS_STYLE_VISIBILITY_VISIBLE
,
1019 eCSSKeyword_hidden
, NS_STYLE_VISIBILITY_HIDDEN
,
1020 eCSSKeyword_collapse
, NS_STYLE_VISIBILITY_COLLAPSE
,
1021 eCSSKeyword_UNKNOWN
,-1
1024 const PRInt32
nsCSSProps::kVolumeKTable
[] = {
1025 eCSSKeyword_silent
, NS_STYLE_VOLUME_SILENT
,
1026 eCSSKeyword_x_soft
, NS_STYLE_VOLUME_X_SOFT
,
1027 eCSSKeyword_soft
, NS_STYLE_VOLUME_SOFT
,
1028 eCSSKeyword_medium
, NS_STYLE_VOLUME_MEDIUM
,
1029 eCSSKeyword_loud
, NS_STYLE_VOLUME_LOUD
,
1030 eCSSKeyword_x_loud
, NS_STYLE_VOLUME_X_LOUD
,
1031 eCSSKeyword_UNKNOWN
,-1
1034 const PRInt32
nsCSSProps::kWhitespaceKTable
[] = {
1035 eCSSKeyword_pre
, NS_STYLE_WHITESPACE_PRE
,
1036 eCSSKeyword_nowrap
, NS_STYLE_WHITESPACE_NOWRAP
,
1037 eCSSKeyword_pre_wrap
, NS_STYLE_WHITESPACE_PRE_WRAP
,
1038 eCSSKeyword_pre_line
, NS_STYLE_WHITESPACE_PRE_LINE
,
1039 eCSSKeyword_UNKNOWN
,-1
1042 const PRInt32
nsCSSProps::kWidthKTable
[] = {
1043 eCSSKeyword__moz_max_content
, NS_STYLE_WIDTH_MAX_CONTENT
,
1044 eCSSKeyword__moz_min_content
, NS_STYLE_WIDTH_MIN_CONTENT
,
1045 eCSSKeyword__moz_fit_content
, NS_STYLE_WIDTH_FIT_CONTENT
,
1046 eCSSKeyword__moz_available
, NS_STYLE_WIDTH_AVAILABLE
,
1047 eCSSKeyword_UNKNOWN
,-1
1050 const PRInt32
nsCSSProps::kWindowShadowKTable
[] = {
1051 eCSSKeyword_default
, NS_STYLE_WINDOW_SHADOW_DEFAULT
,
1052 eCSSKeyword_UNKNOWN
,-1
1055 const PRInt32
nsCSSProps::kWordwrapKTable
[] = {
1056 eCSSKeyword_normal
, NS_STYLE_WORDWRAP_NORMAL
,
1057 eCSSKeyword_break_word
, NS_STYLE_WORDWRAP_BREAK_WORD
,
1058 eCSSKeyword_UNKNOWN
,-1
1061 // Specific keyword tables for XUL.properties
1062 const PRInt32
nsCSSProps::kBoxAlignKTable
[] = {
1063 eCSSKeyword_stretch
, NS_STYLE_BOX_ALIGN_STRETCH
,
1064 eCSSKeyword_start
, NS_STYLE_BOX_ALIGN_START
,
1065 eCSSKeyword_center
, NS_STYLE_BOX_ALIGN_CENTER
,
1066 eCSSKeyword_baseline
, NS_STYLE_BOX_ALIGN_BASELINE
,
1067 eCSSKeyword_end
, NS_STYLE_BOX_ALIGN_END
,
1068 eCSSKeyword_UNKNOWN
,-1
1071 const PRInt32
nsCSSProps::kBoxDirectionKTable
[] = {
1072 eCSSKeyword_normal
, NS_STYLE_BOX_DIRECTION_NORMAL
,
1073 eCSSKeyword_reverse
, NS_STYLE_BOX_DIRECTION_REVERSE
,
1074 eCSSKeyword_UNKNOWN
,-1
1077 const PRInt32
nsCSSProps::kBoxOrientKTable
[] = {
1078 eCSSKeyword_horizontal
, NS_STYLE_BOX_ORIENT_HORIZONTAL
,
1079 eCSSKeyword_vertical
, NS_STYLE_BOX_ORIENT_VERTICAL
,
1080 eCSSKeyword_inline_axis
, NS_STYLE_BOX_ORIENT_HORIZONTAL
,
1081 eCSSKeyword_block_axis
, NS_STYLE_BOX_ORIENT_VERTICAL
,
1082 eCSSKeyword_UNKNOWN
,-1
1085 const PRInt32
nsCSSProps::kBoxPackKTable
[] = {
1086 eCSSKeyword_start
, NS_STYLE_BOX_PACK_START
,
1087 eCSSKeyword_center
, NS_STYLE_BOX_PACK_CENTER
,
1088 eCSSKeyword_end
, NS_STYLE_BOX_PACK_END
,
1089 eCSSKeyword_justify
, NS_STYLE_BOX_PACK_JUSTIFY
,
1090 eCSSKeyword_UNKNOWN
,-1
1094 // keyword tables for SVG properties
1096 const PRInt32
nsCSSProps::kDominantBaselineKTable
[] = {
1097 eCSSKeyword_use_script
, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT
,
1098 eCSSKeyword_no_change
, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE
,
1099 eCSSKeyword_reset_size
, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE
,
1100 eCSSKeyword_alphabetic
, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC
,
1101 eCSSKeyword_hanging
, NS_STYLE_DOMINANT_BASELINE_HANGING
,
1102 eCSSKeyword_ideographic
, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC
,
1103 eCSSKeyword_mathematical
, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL
,
1104 eCSSKeyword_central
, NS_STYLE_DOMINANT_BASELINE_CENTRAL
,
1105 eCSSKeyword_middle
, NS_STYLE_DOMINANT_BASELINE_MIDDLE
,
1106 eCSSKeyword_text_after_edge
, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE
,
1107 eCSSKeyword_text_before_edge
, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE
,
1108 eCSSKeyword_UNKNOWN
, -1
1111 const PRInt32
nsCSSProps::kFillRuleKTable
[] = {
1112 eCSSKeyword_nonzero
, NS_STYLE_FILL_RULE_NONZERO
,
1113 eCSSKeyword_evenodd
, NS_STYLE_FILL_RULE_EVENODD
,
1114 eCSSKeyword_UNKNOWN
, -1
1117 const PRInt32
nsCSSProps::kPointerEventsKTable
[] = {
1118 eCSSKeyword_visiblepainted
, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED
,
1119 eCSSKeyword_visiblefill
, NS_STYLE_POINTER_EVENTS_VISIBLEFILL
,
1120 eCSSKeyword_visiblestroke
, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE
,
1121 eCSSKeyword_visible
, NS_STYLE_POINTER_EVENTS_VISIBLE
,
1122 eCSSKeyword_painted
, NS_STYLE_POINTER_EVENTS_PAINTED
,
1123 eCSSKeyword_fill
, NS_STYLE_POINTER_EVENTS_FILL
,
1124 eCSSKeyword_stroke
, NS_STYLE_POINTER_EVENTS_STROKE
,
1125 eCSSKeyword_all
, NS_STYLE_POINTER_EVENTS_ALL
,
1126 eCSSKeyword_UNKNOWN
, -1
1129 const PRInt32
nsCSSProps::kShapeRenderingKTable
[] = {
1130 eCSSKeyword_optimizespeed
, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED
,
1131 eCSSKeyword_crispedges
, NS_STYLE_SHAPE_RENDERING_CRISPEDGES
,
1132 eCSSKeyword_geometricprecision
, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION
,
1133 eCSSKeyword_UNKNOWN
, -1
1136 const PRInt32
nsCSSProps::kStrokeLinecapKTable
[] = {
1137 eCSSKeyword_butt
, NS_STYLE_STROKE_LINECAP_BUTT
,
1138 eCSSKeyword_round
, NS_STYLE_STROKE_LINECAP_ROUND
,
1139 eCSSKeyword_square
, NS_STYLE_STROKE_LINECAP_SQUARE
,
1140 eCSSKeyword_UNKNOWN
, -1
1143 const PRInt32
nsCSSProps::kStrokeLinejoinKTable
[] = {
1144 eCSSKeyword_miter
, NS_STYLE_STROKE_LINEJOIN_MITER
,
1145 eCSSKeyword_round
, NS_STYLE_STROKE_LINEJOIN_ROUND
,
1146 eCSSKeyword_bevel
, NS_STYLE_STROKE_LINEJOIN_BEVEL
,
1147 eCSSKeyword_UNKNOWN
, -1
1150 const PRInt32
nsCSSProps::kTextAnchorKTable
[] = {
1151 eCSSKeyword_start
, NS_STYLE_TEXT_ANCHOR_START
,
1152 eCSSKeyword_middle
, NS_STYLE_TEXT_ANCHOR_MIDDLE
,
1153 eCSSKeyword_end
, NS_STYLE_TEXT_ANCHOR_END
,
1154 eCSSKeyword_UNKNOWN
, -1
1157 const PRInt32
nsCSSProps::kTextRenderingKTable
[] = {
1158 eCSSKeyword_optimizespeed
, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED
,
1159 eCSSKeyword_optimizelegibility
, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY
,
1160 eCSSKeyword_geometricprecision
, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION
,
1161 eCSSKeyword_UNKNOWN
, -1
1164 const PRInt32
nsCSSProps::kColorInterpolationKTable
[] = {
1165 eCSSKeyword_srgb
, NS_STYLE_COLOR_INTERPOLATION_SRGB
,
1166 eCSSKeyword_linearrgb
, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB
,
1167 eCSSKeyword_UNKNOWN
, -1
1173 nsCSSProps::FindKeyword(nsCSSKeyword aKeyword
, const PRInt32 aTable
[], PRInt32
& aResult
)
1176 while (eCSSKeyword_UNKNOWN
!= nsCSSKeyword(aTable
[index
])) {
1177 if (aKeyword
== nsCSSKeyword(aTable
[index
])) {
1178 aResult
= aTable
[index
+1];
1187 nsCSSProps::ValueToKeywordEnum(PRInt32 aValue
, const PRInt32 aTable
[])
1191 if (aTable
[i
] == -1 && aTable
[i
-1] == eCSSKeyword_UNKNOWN
) {
1194 if (aValue
== aTable
[i
]) {
1195 return nsCSSKeyword(aTable
[i
-1]);
1199 return eCSSKeyword_UNKNOWN
;
1202 const nsAFlatCString
&
1203 nsCSSProps::ValueToKeyword(PRInt32 aValue
, const PRInt32 aTable
[])
1205 nsCSSKeyword keyword
= ValueToKeywordEnum(aValue
, aTable
);
1206 if (keyword
== eCSSKeyword_UNKNOWN
) {
1207 static nsDependentCString
sNullStr("");
1210 return nsCSSKeywords::GetStringValue(keyword
);
1214 /* static */ const PRInt32
* const
1215 nsCSSProps::kKeywordTableTable
[eCSSProperty_COUNT_no_shorthands
] = {
1216 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) kwtable_,
1217 #include "nsCSSPropList.h"
1221 const nsAFlatCString
&
1222 nsCSSProps::LookupPropertyValue(nsCSSProperty aProp
, PRInt32 aValue
)
1224 NS_ASSERTION(aProp
>= 0 && aProp
< eCSSProperty_COUNT
, "property out of range");
1226 const PRInt32
* kwtable
= nsnull
;
1227 if (aProp
< eCSSProperty_COUNT_no_shorthands
)
1228 kwtable
= kKeywordTableTable
[aProp
];
1231 return ValueToKeyword(aValue
, kwtable
);
1233 static nsDependentCString
sNullStr("");
1237 PRBool
nsCSSProps::GetColorName(PRInt32 aPropValue
, nsCString
&aStr
)
1239 PRBool rv
= PR_FALSE
;
1241 // first get the keyword corresponding to the property Value from the color table
1242 nsCSSKeyword keyword
= ValueToKeywordEnum(aPropValue
, kColorKTable
);
1244 // next get the name as a string from the keywords table
1245 if (keyword
!= eCSSKeyword_UNKNOWN
) {
1246 nsCSSKeywords::AddRefTable();
1247 aStr
= nsCSSKeywords::GetStringValue(keyword
);
1248 nsCSSKeywords::ReleaseTable();
1254 // define array of all CSS property types
1255 const nsCSSType
nsCSSProps::kTypeTable
[eCSSProperty_COUNT_no_shorthands
] = {
1256 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) type_,
1257 #include "nsCSSPropList.h"
1261 const nsStyleStructID
nsCSSProps::kSIDTable
[eCSSProperty_COUNT_no_shorthands
] = {
1262 #define CSS_PROP_FONT(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Font,
1263 #define CSS_PROP_COLOR(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Color,
1264 #define CSS_PROP_BACKGROUND(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Background,
1265 #define CSS_PROP_LIST(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_List,
1266 #define CSS_PROP_POSITION(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Position,
1267 #define CSS_PROP_TEXT(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Text,
1268 #define CSS_PROP_TEXTRESET(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_TextReset,
1269 #define CSS_PROP_DISPLAY(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Display,
1270 #define CSS_PROP_VISIBILITY(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Visibility,
1271 #define CSS_PROP_CONTENT(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Content,
1272 #define CSS_PROP_QUOTES(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Quotes,
1273 #define CSS_PROP_USERINTERFACE(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_UserInterface,
1274 #define CSS_PROP_UIRESET(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_UIReset,
1275 #define CSS_PROP_TABLE(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Table,
1276 #define CSS_PROP_TABLEBORDER(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_TableBorder,
1277 #define CSS_PROP_MARGIN(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Margin,
1278 #define CSS_PROP_PADDING(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Padding,
1279 #define CSS_PROP_BORDER(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Border,
1280 #define CSS_PROP_OUTLINE(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Outline,
1281 #define CSS_PROP_XUL(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_XUL,
1282 #define CSS_PROP_SVG(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVG,
1283 #define CSS_PROP_SVGRESET(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_SVGReset,
1284 #define CSS_PROP_COLUMN(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) eStyleStruct_Column,
1285 // This shouldn't matter, but we need something to go here.
1286 #define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) nsStyleStructID(-1),
1288 #include "nsCSSPropList.h"
1290 #undef CSS_PROP_FONT
1291 #undef CSS_PROP_COLOR
1292 #undef CSS_PROP_BACKGROUND
1293 #undef CSS_PROP_LIST
1294 #undef CSS_PROP_POSITION
1295 #undef CSS_PROP_TEXT
1296 #undef CSS_PROP_TEXTRESET
1297 #undef CSS_PROP_DISPLAY
1298 #undef CSS_PROP_VISIBILITY
1299 #undef CSS_PROP_CONTENT
1300 #undef CSS_PROP_QUOTES
1301 #undef CSS_PROP_USERINTERFACE
1302 #undef CSS_PROP_UIRESET
1303 #undef CSS_PROP_TABLE
1304 #undef CSS_PROP_TABLEBORDER
1305 #undef CSS_PROP_MARGIN
1306 #undef CSS_PROP_PADDING
1307 #undef CSS_PROP_BORDER
1308 #undef CSS_PROP_OUTLINE
1311 #undef CSS_PROP_SVGRESET
1312 #undef CSS_PROP_COLUMN
1313 #undef CSS_PROP_BACKENDONLY
1316 const PRUint32
nsCSSProps::kFlagsTable
[eCSSProperty_COUNT
] = {
1317 #define CSS_PROP(name_, id_, method_, flags_, datastruct_, member_, type_, kwtable_) flags_,
1318 #include "nsCSSPropList.h"
1320 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) flags_,
1321 #include "nsCSSPropList.h"
1322 #undef CSS_PROP_SHORTHAND
1325 static const nsCSSProperty gMozBorderRadiusSubpropTable
[] = {
1326 // Code relies on these being in topleft-topright-bottomright-bottomleft
1328 eCSSProperty__moz_border_radius_topLeft
,
1329 eCSSProperty__moz_border_radius_topRight
,
1330 eCSSProperty__moz_border_radius_bottomRight
,
1331 eCSSProperty__moz_border_radius_bottomLeft
,
1332 eCSSProperty_UNKNOWN
1335 static const nsCSSProperty gMozOutlineRadiusSubpropTable
[] = {
1336 // Code relies on these being in topleft-topright-bottomright-bottomleft
1338 eCSSProperty__moz_outline_radius_topLeft
,
1339 eCSSProperty__moz_outline_radius_topRight
,
1340 eCSSProperty__moz_outline_radius_bottomRight
,
1341 eCSSProperty__moz_outline_radius_bottomLeft
,
1342 eCSSProperty_UNKNOWN
1345 static const nsCSSProperty gBackgroundSubpropTable
[] = {
1346 eCSSProperty_background_color
,
1347 eCSSProperty_background_image
,
1348 eCSSProperty_background_repeat
,
1349 eCSSProperty_background_attachment
,
1350 eCSSProperty_background_position
,
1351 eCSSProperty__moz_background_clip
, // XXX Added LDB.
1352 eCSSProperty__moz_background_origin
, // XXX Added LDB.
1353 eCSSProperty__moz_background_inline_policy
, // XXX Added LDB.
1354 eCSSProperty_UNKNOWN
1357 static const nsCSSProperty gBorderSubpropTable
[] = {
1358 eCSSProperty_border_top_width
,
1359 eCSSProperty_border_right_width_value
,
1360 eCSSProperty_border_right_width_ltr_source
,
1361 eCSSProperty_border_right_width_rtl_source
,
1362 eCSSProperty_border_bottom_width
,
1363 eCSSProperty_border_left_width_value
,
1364 eCSSProperty_border_left_width_ltr_source
,
1365 eCSSProperty_border_left_width_rtl_source
,
1366 eCSSProperty_border_top_style
,
1367 eCSSProperty_border_right_style_value
,
1368 eCSSProperty_border_right_style_ltr_source
,
1369 eCSSProperty_border_right_style_rtl_source
,
1370 eCSSProperty_border_bottom_style
,
1371 eCSSProperty_border_left_style_value
,
1372 eCSSProperty_border_left_style_ltr_source
,
1373 eCSSProperty_border_left_style_rtl_source
,
1374 eCSSProperty_border_top_color
,
1375 eCSSProperty_border_right_color_value
,
1376 eCSSProperty_border_right_color_ltr_source
,
1377 eCSSProperty_border_right_color_rtl_source
,
1378 eCSSProperty_border_bottom_color
,
1379 eCSSProperty_border_left_color_value
,
1380 eCSSProperty_border_left_color_ltr_source
,
1381 eCSSProperty_border_left_color_rtl_source
,
1382 eCSSProperty_UNKNOWN
1385 static const nsCSSProperty gBorderBottomSubpropTable
[] = {
1386 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1387 eCSSProperty_border_bottom_width
,
1388 eCSSProperty_border_bottom_style
,
1389 eCSSProperty_border_bottom_color
,
1390 eCSSProperty_UNKNOWN
1393 static const nsCSSProperty gBorderColorSubpropTable
[] = {
1394 // Code relies on these being in top-right-bottom-left order.
1395 eCSSProperty_border_top_color
,
1396 eCSSProperty_border_right_color_value
,
1397 eCSSProperty_border_bottom_color
,
1398 eCSSProperty_border_left_color_value
,
1400 eCSSProperty_border_left_color_ltr_source
,
1401 eCSSProperty_border_left_color_rtl_source
,
1402 eCSSProperty_border_right_color_ltr_source
,
1403 eCSSProperty_border_right_color_rtl_source
,
1404 eCSSProperty_UNKNOWN
1407 static const nsCSSProperty gMozBorderEndColorSubpropTable
[] = {
1408 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1409 eCSSProperty_border_end_color_value
,
1410 eCSSProperty_border_right_color_ltr_source
,
1411 eCSSProperty_border_left_color_rtl_source
,
1412 eCSSProperty_UNKNOWN
1415 static const nsCSSProperty gBorderLeftColorSubpropTable
[] = {
1416 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1417 eCSSProperty_border_left_color_value
,
1418 eCSSProperty_border_left_color_ltr_source
,
1419 eCSSProperty_border_left_color_rtl_source
,
1420 eCSSProperty_UNKNOWN
1423 static const nsCSSProperty gBorderRightColorSubpropTable
[] = {
1424 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1425 eCSSProperty_border_right_color_value
,
1426 eCSSProperty_border_right_color_ltr_source
,
1427 eCSSProperty_border_right_color_rtl_source
,
1428 eCSSProperty_UNKNOWN
1431 static const nsCSSProperty gMozBorderStartColorSubpropTable
[] = {
1432 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1433 eCSSProperty_border_start_color_value
,
1434 eCSSProperty_border_left_color_ltr_source
,
1435 eCSSProperty_border_right_color_rtl_source
,
1436 eCSSProperty_UNKNOWN
1439 static const nsCSSProperty gMozBorderEndSubpropTable
[] = {
1440 // nsCSSDeclaration.cpp output the subproperties in this order.
1441 eCSSProperty_border_end_width_value
,
1442 eCSSProperty_border_end_style_value
,
1443 eCSSProperty_border_end_color_value
,
1445 eCSSProperty_border_right_width_ltr_source
,
1446 eCSSProperty_border_left_width_rtl_source
,
1447 eCSSProperty_border_right_style_ltr_source
,
1448 eCSSProperty_border_left_style_rtl_source
,
1449 eCSSProperty_border_right_color_ltr_source
,
1450 eCSSProperty_border_left_color_rtl_source
,
1451 eCSSProperty_UNKNOWN
1454 static const nsCSSProperty gBorderLeftSubpropTable
[] = {
1455 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1456 eCSSProperty_border_left_width_value
,
1457 eCSSProperty_border_left_style_value
,
1458 eCSSProperty_border_left_color_value
,
1460 eCSSProperty_border_left_width_ltr_source
,
1461 eCSSProperty_border_left_width_rtl_source
,
1462 eCSSProperty_border_left_style_ltr_source
,
1463 eCSSProperty_border_left_style_rtl_source
,
1464 eCSSProperty_border_left_color_ltr_source
,
1465 eCSSProperty_border_left_color_rtl_source
,
1466 eCSSProperty_UNKNOWN
1469 static const nsCSSProperty gBorderRightSubpropTable
[] = {
1470 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1471 eCSSProperty_border_right_width_value
,
1472 eCSSProperty_border_right_style_value
,
1473 eCSSProperty_border_right_color_value
,
1475 eCSSProperty_border_right_width_ltr_source
,
1476 eCSSProperty_border_right_width_rtl_source
,
1477 eCSSProperty_border_right_style_ltr_source
,
1478 eCSSProperty_border_right_style_rtl_source
,
1479 eCSSProperty_border_right_color_ltr_source
,
1480 eCSSProperty_border_right_color_rtl_source
,
1481 eCSSProperty_UNKNOWN
1484 static const nsCSSProperty gMozBorderStartSubpropTable
[] = {
1485 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1486 eCSSProperty_border_start_width_value
,
1487 eCSSProperty_border_start_style_value
,
1488 eCSSProperty_border_start_color_value
,
1490 eCSSProperty_border_left_width_ltr_source
,
1491 eCSSProperty_border_right_width_rtl_source
,
1492 eCSSProperty_border_left_style_ltr_source
,
1493 eCSSProperty_border_right_style_rtl_source
,
1494 eCSSProperty_border_left_color_ltr_source
,
1495 eCSSProperty_border_right_color_rtl_source
,
1496 eCSSProperty_UNKNOWN
1499 static const nsCSSProperty gBorderStyleSubpropTable
[] = {
1500 // Code relies on these being in top-right-bottom-left order.
1501 eCSSProperty_border_top_style
,
1502 eCSSProperty_border_right_style_value
,
1503 eCSSProperty_border_bottom_style
,
1504 eCSSProperty_border_left_style_value
,
1506 eCSSProperty_border_left_style_ltr_source
,
1507 eCSSProperty_border_left_style_rtl_source
,
1508 eCSSProperty_border_right_style_ltr_source
,
1509 eCSSProperty_border_right_style_rtl_source
,
1510 eCSSProperty_UNKNOWN
1513 static const nsCSSProperty gBorderLeftStyleSubpropTable
[] = {
1514 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1515 eCSSProperty_border_left_style_value
,
1516 eCSSProperty_border_left_style_ltr_source
,
1517 eCSSProperty_border_left_style_rtl_source
,
1518 eCSSProperty_UNKNOWN
1521 static const nsCSSProperty gBorderRightStyleSubpropTable
[] = {
1522 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1523 eCSSProperty_border_right_style_value
,
1524 eCSSProperty_border_right_style_ltr_source
,
1525 eCSSProperty_border_right_style_rtl_source
,
1526 eCSSProperty_UNKNOWN
1529 static const nsCSSProperty gMozBorderStartStyleSubpropTable
[] = {
1530 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1531 eCSSProperty_border_start_style_value
,
1532 eCSSProperty_border_left_style_ltr_source
,
1533 eCSSProperty_border_right_style_rtl_source
,
1534 eCSSProperty_UNKNOWN
1537 static const nsCSSProperty gMozBorderEndStyleSubpropTable
[] = {
1538 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1539 eCSSProperty_border_end_style_value
,
1540 eCSSProperty_border_right_style_ltr_source
,
1541 eCSSProperty_border_left_style_rtl_source
,
1542 eCSSProperty_UNKNOWN
1545 static const nsCSSProperty gBorderTopSubpropTable
[] = {
1546 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1547 eCSSProperty_border_top_width
,
1548 eCSSProperty_border_top_style
,
1549 eCSSProperty_border_top_color
,
1550 eCSSProperty_UNKNOWN
1553 static const nsCSSProperty gBorderWidthSubpropTable
[] = {
1554 // Code relies on these being in top-right-bottom-left order.
1555 eCSSProperty_border_top_width
,
1556 eCSSProperty_border_right_width_value
,
1557 eCSSProperty_border_bottom_width
,
1558 eCSSProperty_border_left_width_value
,
1560 eCSSProperty_border_left_width_ltr_source
,
1561 eCSSProperty_border_left_width_rtl_source
,
1562 eCSSProperty_border_right_width_ltr_source
,
1563 eCSSProperty_border_right_width_rtl_source
,
1564 eCSSProperty_UNKNOWN
1567 static const nsCSSProperty gBorderLeftWidthSubpropTable
[] = {
1568 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1569 eCSSProperty_border_left_width_value
,
1570 eCSSProperty_border_left_width_ltr_source
,
1571 eCSSProperty_border_left_width_rtl_source
,
1572 eCSSProperty_UNKNOWN
1575 static const nsCSSProperty gBorderRightWidthSubpropTable
[] = {
1576 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1577 eCSSProperty_border_right_width_value
,
1578 eCSSProperty_border_right_width_ltr_source
,
1579 eCSSProperty_border_right_width_rtl_source
,
1580 eCSSProperty_UNKNOWN
1583 static const nsCSSProperty gMozBorderStartWidthSubpropTable
[] = {
1584 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1585 eCSSProperty_border_start_width_value
,
1586 eCSSProperty_border_left_width_ltr_source
,
1587 eCSSProperty_border_right_width_rtl_source
,
1588 eCSSProperty_UNKNOWN
1591 static const nsCSSProperty gMozBorderEndWidthSubpropTable
[] = {
1592 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1593 eCSSProperty_border_end_width_value
,
1594 eCSSProperty_border_right_width_ltr_source
,
1595 eCSSProperty_border_left_width_rtl_source
,
1596 eCSSProperty_UNKNOWN
1599 static const nsCSSProperty gCueSubpropTable
[] = {
1600 eCSSProperty_cue_after
,
1601 eCSSProperty_cue_before
,
1602 eCSSProperty_UNKNOWN
1605 static const nsCSSProperty gFontSubpropTable
[] = {
1606 eCSSProperty_font_family
,
1607 eCSSProperty_font_style
,
1608 eCSSProperty_font_variant
,
1609 eCSSProperty_font_weight
,
1610 eCSSProperty_font_size
,
1611 eCSSProperty_line_height
,
1612 eCSSProperty_font_size_adjust
, // XXX Added LDB.
1613 eCSSProperty_font_stretch
, // XXX Added LDB.
1614 eCSSProperty__x_system_font
,
1615 eCSSProperty_UNKNOWN
1618 static const nsCSSProperty gListStyleSubpropTable
[] = {
1619 eCSSProperty_list_style_type
,
1620 eCSSProperty_list_style_image
,
1621 eCSSProperty_list_style_position
,
1622 eCSSProperty_UNKNOWN
1625 static const nsCSSProperty gMarginSubpropTable
[] = {
1626 // Code relies on these being in top-right-bottom-left order.
1627 eCSSProperty_margin_top
,
1628 eCSSProperty_margin_right_value
,
1629 eCSSProperty_margin_bottom
,
1630 eCSSProperty_margin_left_value
,
1632 eCSSProperty_margin_left_ltr_source
,
1633 eCSSProperty_margin_left_rtl_source
,
1634 eCSSProperty_margin_right_ltr_source
,
1635 eCSSProperty_margin_right_rtl_source
,
1636 eCSSProperty_UNKNOWN
1639 static const nsCSSProperty gMarginLeftSubpropTable
[] = {
1640 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1641 eCSSProperty_margin_left_value
,
1642 eCSSProperty_margin_left_ltr_source
,
1643 eCSSProperty_margin_left_rtl_source
,
1644 eCSSProperty_UNKNOWN
1647 static const nsCSSProperty gMarginRightSubpropTable
[] = {
1648 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1649 eCSSProperty_margin_right_value
,
1650 eCSSProperty_margin_right_ltr_source
,
1651 eCSSProperty_margin_right_rtl_source
,
1652 eCSSProperty_UNKNOWN
1655 static const nsCSSProperty gMozMarginStartSubpropTable
[] = {
1656 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1657 eCSSProperty_margin_start_value
,
1658 eCSSProperty_margin_left_ltr_source
,
1659 eCSSProperty_margin_right_rtl_source
,
1660 eCSSProperty_UNKNOWN
1663 static const nsCSSProperty gMozMarginEndSubpropTable
[] = {
1664 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1665 eCSSProperty_margin_end_value
,
1666 eCSSProperty_margin_right_ltr_source
,
1667 eCSSProperty_margin_left_rtl_source
,
1668 eCSSProperty_UNKNOWN
1672 static const nsCSSProperty gOutlineSubpropTable
[] = {
1673 // nsCSSDeclaration.cpp outputs the subproperties in this order.
1674 eCSSProperty_outline_color
,
1675 eCSSProperty_outline_style
,
1676 eCSSProperty_outline_width
,
1677 eCSSProperty_UNKNOWN
1680 static const nsCSSProperty gMozColumnRuleSubpropTable
[] = {
1681 eCSSProperty__moz_column_rule_width
,
1682 eCSSProperty__moz_column_rule_style
,
1683 eCSSProperty__moz_column_rule_color
,
1684 eCSSProperty_UNKNOWN
1687 static const nsCSSProperty gOverflowSubpropTable
[] = {
1688 eCSSProperty_overflow_x
,
1689 eCSSProperty_overflow_y
,
1690 eCSSProperty_UNKNOWN
1693 static const nsCSSProperty gPaddingSubpropTable
[] = {
1694 // Code relies on these being in top-right-bottom-left order.
1695 eCSSProperty_padding_top
,
1696 eCSSProperty_padding_right_value
,
1697 eCSSProperty_padding_bottom
,
1698 eCSSProperty_padding_left_value
,
1700 eCSSProperty_padding_left_ltr_source
,
1701 eCSSProperty_padding_left_rtl_source
,
1702 eCSSProperty_padding_right_ltr_source
,
1703 eCSSProperty_padding_right_rtl_source
,
1704 eCSSProperty_UNKNOWN
1707 static const nsCSSProperty gPaddingLeftSubpropTable
[] = {
1708 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1709 eCSSProperty_padding_left_value
,
1710 eCSSProperty_padding_left_ltr_source
,
1711 eCSSProperty_padding_left_rtl_source
,
1712 eCSSProperty_UNKNOWN
1715 static const nsCSSProperty gPaddingRightSubpropTable
[] = {
1716 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1717 eCSSProperty_padding_right_value
,
1718 eCSSProperty_padding_right_ltr_source
,
1719 eCSSProperty_padding_right_rtl_source
,
1720 eCSSProperty_UNKNOWN
1723 static const nsCSSProperty gMozPaddingStartSubpropTable
[] = {
1724 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1725 eCSSProperty_padding_start_value
,
1726 eCSSProperty_padding_left_ltr_source
,
1727 eCSSProperty_padding_right_rtl_source
,
1728 eCSSProperty_UNKNOWN
1731 static const nsCSSProperty gMozPaddingEndSubpropTable
[] = {
1732 // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1733 eCSSProperty_padding_end_value
,
1734 eCSSProperty_padding_right_ltr_source
,
1735 eCSSProperty_padding_left_rtl_source
,
1736 eCSSProperty_UNKNOWN
1739 static const nsCSSProperty gPauseSubpropTable
[] = {
1740 eCSSProperty_pause_after
,
1741 eCSSProperty_pause_before
,
1742 eCSSProperty_UNKNOWN
1746 static const nsCSSProperty gMarkerSubpropTable
[] = {
1747 eCSSProperty_marker_start
,
1748 eCSSProperty_marker_mid
,
1749 eCSSProperty_marker_end
,
1750 eCSSProperty_UNKNOWN
1754 const nsCSSProperty
*const
1755 nsCSSProps::kSubpropertyTable
[eCSSProperty_COUNT
- eCSSProperty_COUNT_no_shorthands
] = {
1756 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) g##method_##SubpropTable,
1757 #include "nsCSSPropList.h"
1758 #undef CSS_PROP_SHORTHAND