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
4 : *
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/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Original Code is mozilla.org code.
16 : *
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.
21 : *
22 : * Contributor(s):
23 : * Mats Palmgren <matspal@gmail.com>
24 : * Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>, Collabora Ltd.
25 : *
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.
37 : *
38 : * ***** END LICENSE BLOCK ***** */
39 :
40 : /*
41 : * methods for dealing with CSS properties and tables of the keyword
42 : * values they accept
43 : */
44 :
45 : #include "mozilla/Util.h"
46 :
47 : #include "nsCSSProps.h"
48 : #include "nsCSSKeywords.h"
49 : #include "nsStyleConsts.h"
50 : #include "nsIWidget.h"
51 : #include "nsThemeConstants.h" // For system widget appearance types
52 :
53 : #include "mozilla/LookAndFeel.h" // for system colors
54 :
55 : #include "nsString.h"
56 : #include "nsReadableUtils.h"
57 : #include "nsStaticNameTable.h"
58 :
59 : using namespace mozilla;
60 :
61 : // required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it
62 : extern const char* const kCSSRawProperties[];
63 :
64 : // define an array of all CSS properties
65 : const char* const kCSSRawProperties[] = {
66 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
67 : stylestruct_, stylestructoffset_, animtype_) \
68 : #name_,
69 : #include "nsCSSPropList.h"
70 : #undef CSS_PROP
71 : #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) #name_,
72 : #include "nsCSSPropList.h"
73 : #undef CSS_PROP_SHORTHAND
74 : };
75 :
76 : using namespace mozilla;
77 :
78 : static PRInt32 gTableRefCount;
79 : static nsStaticCaseInsensitiveNameTable* gPropertyTable;
80 : static nsStaticCaseInsensitiveNameTable* gFontDescTable;
81 :
82 : /* static */ nsCSSProperty *
83 : nsCSSProps::gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands];
84 : /* static */ nsCSSProperty* nsCSSProps::gShorthandsContainingPool = nsnull;
85 :
86 : static const char* const kCSSRawFontDescs[] = {
87 : #define CSS_FONT_DESC(name_, method_) #name_,
88 : #include "nsCSSFontDescList.h"
89 : #undef CSS_FONT_DESC
90 : };
91 :
92 : struct PropertyAndCount {
93 : nsCSSProperty property;
94 : PRUint32 count;
95 : };
96 :
97 : static int
98 320775 : SortPropertyAndCount(const void* s1, const void* s2, void *closure)
99 : {
100 320775 : const PropertyAndCount *pc1 = static_cast<const PropertyAndCount*>(s1);
101 320775 : const PropertyAndCount *pc2 = static_cast<const PropertyAndCount*>(s2);
102 : // Primary sort by count (lowest to highest)
103 320775 : if (pc1->count != pc2->count)
104 155610 : return pc1->count - pc2->count;
105 : // Secondary sort by property index (highest to lowest)
106 165165 : return pc2->property - pc1->property;
107 : }
108 :
109 : void
110 1365 : nsCSSProps::AddRefTable(void)
111 : {
112 1365 : if (0 == gTableRefCount++) {
113 1365 : NS_ABORT_IF_FALSE(!gPropertyTable, "pre existing array!");
114 1365 : NS_ABORT_IF_FALSE(!gFontDescTable, "pre existing array!");
115 :
116 1365 : gPropertyTable = new nsStaticCaseInsensitiveNameTable();
117 1365 : if (gPropertyTable) {
118 : #ifdef DEBUG
119 : {
120 : // let's verify the table...
121 389025 : for (PRInt32 index = 0; index < eCSSProperty_COUNT; ++index) {
122 775320 : nsCAutoString temp1(kCSSRawProperties[index]);
123 775320 : nsCAutoString temp2(kCSSRawProperties[index]);
124 387660 : ToLowerCase(temp1);
125 387660 : NS_ABORT_IF_FALSE(temp1.Equals(temp2), "upper case char in prop table");
126 387660 : NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'),
127 : "underscore char in prop table");
128 : }
129 : }
130 : #endif
131 1365 : gPropertyTable->Init(kCSSRawProperties, eCSSProperty_COUNT);
132 : }
133 :
134 1365 : gFontDescTable = new nsStaticCaseInsensitiveNameTable();
135 1365 : if (gFontDescTable) {
136 : #ifdef DEBUG
137 : {
138 : // let's verify the table...
139 12285 : for (PRInt32 index = 0; index < eCSSFontDesc_COUNT; ++index) {
140 21840 : nsCAutoString temp1(kCSSRawFontDescs[index]);
141 21840 : nsCAutoString temp2(kCSSRawFontDescs[index]);
142 10920 : ToLowerCase(temp1);
143 10920 : NS_ABORT_IF_FALSE(temp1.Equals(temp2), "upper case char in desc table");
144 10920 : NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'),
145 : "underscore char in desc table");
146 : }
147 : }
148 : #endif
149 1365 : gFontDescTable->Init(kCSSRawFontDescs, eCSSFontDesc_COUNT);
150 : }
151 :
152 1365 : BuildShorthandsContainingTable();
153 : }
154 1365 : }
155 :
156 : #undef DEBUG_SHORTHANDS_CONTAINING
157 :
158 : bool
159 1365 : nsCSSProps::BuildShorthandsContainingTable()
160 : {
161 : PRUint32 occurrenceCounts[eCSSProperty_COUNT_no_shorthands];
162 1365 : memset(occurrenceCounts, 0, sizeof(occurrenceCounts));
163 : PropertyAndCount subpropCounts[eCSSProperty_COUNT -
164 : eCSSProperty_COUNT_no_shorthands];
165 64155 : 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());
171 : #endif
172 : PropertyAndCount &subpropCountsEntry =
173 62790 : subpropCounts[shorthand - eCSSProperty_COUNT_no_shorthands];
174 62790 : subpropCountsEntry.property = shorthand;
175 62790 : subpropCountsEntry.count = 0;
176 387660 : for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
177 : *subprops != eCSSProperty_UNKNOWN;
178 : ++subprops) {
179 324870 : NS_ABORT_IF_FALSE(0 < *subprops &&
180 : *subprops < eCSSProperty_COUNT_no_shorthands,
181 : "subproperty must be a longhand");
182 324870 : ++occurrenceCounts[*subprops];
183 324870 : ++subpropCountsEntry.count;
184 : }
185 : }
186 :
187 1365 : PRUint32 poolEntries = 0;
188 326235 : for (nsCSSProperty longhand = nsCSSProperty(0);
189 : longhand < eCSSProperty_COUNT_no_shorthands;
190 : longhand = nsCSSProperty(longhand + 1)) {
191 324870 : PRUint32 count = occurrenceCounts[longhand];
192 324870 : if (count > 0)
193 : // leave room for terminator
194 159705 : poolEntries += count + 1;
195 : }
196 :
197 2730 : gShorthandsContainingPool = new nsCSSProperty[poolEntries];
198 1365 : if (!gShorthandsContainingPool)
199 0 : return false;
200 :
201 : // Initialize all entries to point to their null-terminator.
202 : {
203 1365 : nsCSSProperty *poolCursor = gShorthandsContainingPool - 1;
204 : nsCSSProperty *lastTerminator =
205 1365 : gShorthandsContainingPool + poolEntries - 1;
206 326235 : for (nsCSSProperty longhand = nsCSSProperty(0);
207 : longhand < eCSSProperty_COUNT_no_shorthands;
208 : longhand = nsCSSProperty(longhand + 1)) {
209 324870 : PRUint32 count = occurrenceCounts[longhand];
210 324870 : if (count > 0) {
211 159705 : poolCursor += count + 1;
212 159705 : gShorthandsContainingTable[longhand] = poolCursor;
213 159705 : *poolCursor = eCSSProperty_UNKNOWN;
214 : } else {
215 165165 : gShorthandsContainingTable[longhand] = lastTerminator;
216 : }
217 : }
218 1365 : NS_ABORT_IF_FALSE(poolCursor == lastTerminator, "miscalculation");
219 : }
220 :
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, ArrayLength(subpropCounts),
224 1365 : sizeof(subpropCounts[0]), SortPropertyAndCount, nsnull);
225 :
226 : // Fill in all the entries in gShorthandsContainingTable
227 65520 : for (const PropertyAndCount *shorthandAndCount = subpropCounts,
228 1365 : *shorthandAndCountEnd = ArrayEnd(subpropCounts);
229 : shorthandAndCount < shorthandAndCountEnd;
230 : ++shorthandAndCount) {
231 : #ifdef DEBUG_SHORTHANDS_CONTAINING
232 : printf("Entering %u subprops for '%s'.\n",
233 : shorthandAndCount->count,
234 : nsCSSProps::GetStringValue(shorthandAndCount->property).get());
235 : #endif
236 387660 : for (const nsCSSProperty* subprops =
237 62790 : SubpropertyEntryFor(shorthandAndCount->property);
238 : *subprops != eCSSProperty_UNKNOWN;
239 : ++subprops) {
240 324870 : *(--gShorthandsContainingTable[*subprops]) = shorthandAndCount->property;
241 : }
242 : }
243 :
244 : #ifdef DEBUG_SHORTHANDS_CONTAINING
245 : for (nsCSSProperty longhand = nsCSSProperty(0);
246 : longhand < eCSSProperty_COUNT_no_shorthands;
247 : longhand = nsCSSProperty(longhand + 1)) {
248 : printf("Property %s is in %d shorthands.\n",
249 : nsCSSProps::GetStringValue(longhand).get(),
250 : occurrenceCounts[longhand]);
251 : for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand);
252 : *shorthands != eCSSProperty_UNKNOWN;
253 : ++shorthands) {
254 : printf(" %s\n", nsCSSProps::GetStringValue(*shorthands).get());
255 : }
256 : }
257 : #endif
258 :
259 : #ifdef DEBUG
260 : // Verify that all values that should be are present.
261 64155 : for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands;
262 : shorthand < eCSSProperty_COUNT;
263 : shorthand = nsCSSProperty(shorthand + 1)) {
264 387660 : for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
265 : *subprops != eCSSProperty_UNKNOWN;
266 : ++subprops) {
267 324870 : PRUint32 count = 0;
268 1395030 : for (const nsCSSProperty *shcont = ShorthandsContaining(*subprops);
269 : *shcont != eCSSProperty_UNKNOWN;
270 : ++shcont) {
271 1070160 : if (*shcont == shorthand)
272 324870 : ++count;
273 : }
274 324870 : NS_ABORT_IF_FALSE(count == 1,
275 : "subproperty of shorthand should have shorthand"
276 : " in its ShorthandsContaining() table");
277 : }
278 : }
279 :
280 : // Verify that there are no extra values
281 326235 : for (nsCSSProperty longhand = nsCSSProperty(0);
282 : longhand < eCSSProperty_COUNT_no_shorthands;
283 : longhand = nsCSSProperty(longhand + 1)) {
284 649740 : for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand);
285 : *shorthands != eCSSProperty_UNKNOWN;
286 : ++shorthands) {
287 324870 : PRUint32 count = 0;
288 3461640 : for (const nsCSSProperty* subprops = SubpropertyEntryFor(*shorthands);
289 : *subprops != eCSSProperty_UNKNOWN;
290 : ++subprops) {
291 3136770 : if (*subprops == longhand)
292 324870 : ++count;
293 : }
294 324870 : NS_ABORT_IF_FALSE(count == 1,
295 : "longhand should be in subproperty table of "
296 : "property in its ShorthandsContaining() table");
297 : }
298 : }
299 : #endif
300 :
301 1365 : return true;
302 : }
303 :
304 : void
305 1364 : nsCSSProps::ReleaseTable(void)
306 : {
307 1364 : if (0 == --gTableRefCount) {
308 1364 : delete gPropertyTable;
309 1364 : gPropertyTable = nsnull;
310 :
311 1364 : delete gFontDescTable;
312 1364 : gFontDescTable = nsnull;
313 :
314 1364 : delete [] gShorthandsContainingPool;
315 1364 : gShorthandsContainingPool = nsnull;
316 : }
317 1364 : }
318 :
319 : // We need eCSSAliasCount so we can make gAliases nonzero size when there
320 : // are no aliases.
321 : enum {
322 : #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
323 : eCSSAliasCountBefore_##aliasmethod_,
324 : #include "nsCSSPropAliasList.h"
325 : #undef CSS_PROP_ALIAS
326 :
327 : eCSSAliasCount
328 : };
329 :
330 : enum {
331 : // We want the largest sizeof(#aliasname_). To find that, we use the
332 : // auto-incrementing behavior of C++ enums (a value without an
333 : // initializer is one larger than the previous value, or 0 at the
334 : // start of the enum), and for each alias we define two values:
335 : // eMaxCSSAliasNameSizeBefore_##aliasmethod_ is the largest
336 : // sizeof(#aliasname_) before that alias. The first one is
337 : // conveniently zero.
338 : // eMaxCSSAliasNameSizeWith_##aliasmethod_ is **one less than** the
339 : // largest sizeof(#aliasname_) before or including that alias.
340 : #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
341 : eMaxCSSAliasNameSizeBefore_##aliasmethod_, \
342 : eMaxCSSAliasNameSizeWith_##aliasmethod_ = \
343 : PR_MAX(sizeof(#aliasname_), eMaxCSSAliasNameSizeBefore_##aliasmethod_) - 1,
344 : #include "nsCSSPropAliasList.h"
345 : #undef CSS_PROP_ALIAS
346 :
347 : eMaxCSSAliasNameSize
348 : };
349 :
350 : struct CSSPropertyAlias {
351 : char name[PR_MAX(eMaxCSSAliasNameSize, 1)];
352 : nsCSSProperty id;
353 : };
354 :
355 : static const CSSPropertyAlias gAliases[PR_MAX(eCSSAliasCount, 1)] = {
356 : #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_) \
357 : { #aliasname_, eCSSProperty_##propid_ },
358 : #include "nsCSSPropAliasList.h"
359 : #undef CSS_PROP_ALIAS
360 : };
361 :
362 : nsCSSProperty
363 0 : nsCSSProps::LookupProperty(const nsACString& aProperty)
364 : {
365 0 : NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref");
366 :
367 0 : nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
368 : // Check eCSSAliasCount against 0 to make it easy for the
369 : // compiler to optimize away the 0-aliases case.
370 : if (eCSSAliasCount != 0 && res == eCSSProperty_UNKNOWN) {
371 : for (const CSSPropertyAlias *alias = gAliases,
372 : *alias_end = ArrayEnd(gAliases);
373 : alias < alias_end; ++alias) {
374 : if (aProperty.LowerCaseEqualsASCII(alias->name)) {
375 : res = alias->id;
376 : break;
377 : }
378 : }
379 : }
380 0 : return res;
381 : }
382 :
383 : nsCSSProperty
384 0 : nsCSSProps::LookupProperty(const nsAString& aProperty)
385 : {
386 : // This is faster than converting and calling
387 : // LookupProperty(nsACString&). The table will do its own
388 : // converting and avoid a PromiseFlatCString() call.
389 0 : NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref");
390 0 : nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty));
391 : // Check eCSSAliasCount against 0 to make it easy for the
392 : // compiler to optimize away the 0-aliases case.
393 : if (eCSSAliasCount != 0 && res == eCSSProperty_UNKNOWN) {
394 : for (const CSSPropertyAlias *alias = gAliases,
395 : *alias_end = ArrayEnd(gAliases);
396 : alias < alias_end; ++alias) {
397 : if (aProperty.LowerCaseEqualsASCII(alias->name)) {
398 : res = alias->id;
399 : break;
400 : }
401 : }
402 : }
403 0 : return res;
404 : }
405 :
406 : nsCSSFontDesc
407 0 : nsCSSProps::LookupFontDesc(const nsACString& aFontDesc)
408 : {
409 0 : NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref");
410 0 : return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
411 : }
412 :
413 : nsCSSFontDesc
414 0 : nsCSSProps::LookupFontDesc(const nsAString& aFontDesc)
415 : {
416 0 : NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref");
417 0 : return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
418 : }
419 :
420 : const nsAFlatCString&
421 0 : nsCSSProps::GetStringValue(nsCSSProperty aProperty)
422 : {
423 0 : NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref");
424 0 : if (gPropertyTable) {
425 0 : return gPropertyTable->GetStringValue(PRInt32(aProperty));
426 : } else {
427 0 : static nsDependentCString sNullStr("");
428 0 : return sNullStr;
429 : }
430 : }
431 :
432 : const nsAFlatCString&
433 0 : nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID)
434 : {
435 0 : NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref");
436 0 : if (gFontDescTable) {
437 0 : return gFontDescTable->GetStringValue(PRInt32(aFontDescID));
438 : } else {
439 0 : static nsDependentCString sNullStr("");
440 0 : return sNullStr;
441 : }
442 : }
443 :
444 : nsCSSProperty
445 0 : nsCSSProps::OtherNameFor(nsCSSProperty aProperty)
446 : {
447 0 : switch (aProperty) {
448 : case eCSSProperty_border_left_color_value:
449 0 : return eCSSProperty_border_left_color;
450 : case eCSSProperty_border_left_style_value:
451 0 : return eCSSProperty_border_left_style;
452 : case eCSSProperty_border_left_width_value:
453 0 : return eCSSProperty_border_left_width;
454 : case eCSSProperty_border_right_color_value:
455 0 : return eCSSProperty_border_right_color;
456 : case eCSSProperty_border_right_style_value:
457 0 : return eCSSProperty_border_right_style;
458 : case eCSSProperty_border_right_width_value:
459 0 : return eCSSProperty_border_right_width;
460 : case eCSSProperty_margin_left_value:
461 0 : return eCSSProperty_margin_left;
462 : case eCSSProperty_margin_right_value:
463 0 : return eCSSProperty_margin_right;
464 : case eCSSProperty_padding_left_value:
465 0 : return eCSSProperty_padding_left;
466 : case eCSSProperty_padding_right_value:
467 0 : return eCSSProperty_padding_right;
468 : default:
469 0 : NS_ABORT_IF_FALSE(false, "bad caller");
470 : }
471 0 : return eCSSProperty_UNKNOWN;
472 : }
473 :
474 : /***************************************************************************/
475 :
476 : const PRInt32 nsCSSProps::kAnimationDirectionKTable[] = {
477 : eCSSKeyword_normal, NS_STYLE_ANIMATION_DIRECTION_NORMAL,
478 : eCSSKeyword_alternate, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE,
479 : eCSSKeyword_UNKNOWN,-1
480 : };
481 :
482 : const PRInt32 nsCSSProps::kAnimationFillModeKTable[] = {
483 : eCSSKeyword_none, NS_STYLE_ANIMATION_FILL_MODE_NONE,
484 : eCSSKeyword_forwards, NS_STYLE_ANIMATION_FILL_MODE_FORWARDS,
485 : eCSSKeyword_backwards, NS_STYLE_ANIMATION_FILL_MODE_BACKWARDS,
486 : eCSSKeyword_both, NS_STYLE_ANIMATION_FILL_MODE_BOTH,
487 : eCSSKeyword_UNKNOWN,-1
488 : };
489 :
490 : const PRInt32 nsCSSProps::kAnimationIterationCountKTable[] = {
491 : eCSSKeyword_infinite, NS_STYLE_ANIMATION_ITERATION_COUNT_INFINITE,
492 : eCSSKeyword_UNKNOWN,-1
493 : };
494 :
495 : const PRInt32 nsCSSProps::kAnimationPlayStateKTable[] = {
496 : eCSSKeyword_running, NS_STYLE_ANIMATION_PLAY_STATE_RUNNING,
497 : eCSSKeyword_paused, NS_STYLE_ANIMATION_PLAY_STATE_PAUSED,
498 : eCSSKeyword_UNKNOWN,-1
499 : };
500 :
501 : const PRInt32 nsCSSProps::kAppearanceKTable[] = {
502 : eCSSKeyword_none, NS_THEME_NONE,
503 : eCSSKeyword_button, NS_THEME_BUTTON,
504 : eCSSKeyword_radio, NS_THEME_RADIO,
505 : eCSSKeyword_checkbox, NS_THEME_CHECKBOX,
506 : eCSSKeyword_button_bevel, NS_THEME_BUTTON_BEVEL,
507 : eCSSKeyword_toolbox, NS_THEME_TOOLBOX,
508 : eCSSKeyword_toolbar, NS_THEME_TOOLBAR,
509 : eCSSKeyword_toolbarbutton, NS_THEME_TOOLBAR_BUTTON,
510 : eCSSKeyword_toolbargripper, NS_THEME_TOOLBAR_GRIPPER,
511 : eCSSKeyword_dualbutton, NS_THEME_TOOLBAR_DUAL_BUTTON,
512 : eCSSKeyword_toolbarbutton_dropdown, NS_THEME_TOOLBAR_BUTTON_DROPDOWN,
513 : eCSSKeyword_button_arrow_up, NS_THEME_BUTTON_ARROW_UP,
514 : eCSSKeyword_button_arrow_down, NS_THEME_BUTTON_ARROW_DOWN,
515 : eCSSKeyword_button_arrow_next, NS_THEME_BUTTON_ARROW_NEXT,
516 : eCSSKeyword_button_arrow_previous, NS_THEME_BUTTON_ARROW_PREVIOUS,
517 : eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR,
518 : eCSSKeyword_splitter, NS_THEME_SPLITTER,
519 : eCSSKeyword_statusbar, NS_THEME_STATUSBAR,
520 : eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL,
521 : eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL,
522 : eCSSKeyword_resizer, NS_THEME_RESIZER,
523 : eCSSKeyword_listbox, NS_THEME_LISTBOX,
524 : eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM,
525 : eCSSKeyword_treeview, NS_THEME_TREEVIEW,
526 : eCSSKeyword_treeitem, NS_THEME_TREEVIEW_TREEITEM,
527 : eCSSKeyword_treetwisty, NS_THEME_TREEVIEW_TWISTY,
528 : eCSSKeyword_treetwistyopen, NS_THEME_TREEVIEW_TWISTY_OPEN,
529 : eCSSKeyword_treeline, NS_THEME_TREEVIEW_LINE,
530 : eCSSKeyword_treeheader, NS_THEME_TREEVIEW_HEADER,
531 : eCSSKeyword_treeheadercell, NS_THEME_TREEVIEW_HEADER_CELL,
532 : eCSSKeyword_treeheadersortarrow, NS_THEME_TREEVIEW_HEADER_SORTARROW,
533 : eCSSKeyword_progressbar, NS_THEME_PROGRESSBAR,
534 : eCSSKeyword_progresschunk, NS_THEME_PROGRESSBAR_CHUNK,
535 : eCSSKeyword_progressbar_vertical, NS_THEME_PROGRESSBAR_VERTICAL,
536 : eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL,
537 : eCSSKeyword_tab, NS_THEME_TAB,
538 : eCSSKeyword_tabpanels, NS_THEME_TAB_PANELS,
539 : eCSSKeyword_tabpanel, NS_THEME_TAB_PANEL,
540 : eCSSKeyword_tabscrollarrow_back, NS_THEME_TAB_SCROLLARROW_BACK,
541 : eCSSKeyword_tabscrollarrow_forward, NS_THEME_TAB_SCROLLARROW_FORWARD,
542 : eCSSKeyword_tooltip, NS_THEME_TOOLTIP,
543 : eCSSKeyword_spinner, NS_THEME_SPINNER,
544 : eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON,
545 : eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON,
546 : eCSSKeyword_spinner_textfield, NS_THEME_SPINNER_TEXTFIELD,
547 : eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR,
548 : eCSSKeyword_scrollbar_small, NS_THEME_SCROLLBAR_SMALL,
549 : eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP,
550 : eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN,
551 : eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT,
552 : eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT,
553 : eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL,
554 : eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL,
555 : eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL,
556 : eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL,
557 : eCSSKeyword_textfield, NS_THEME_TEXTFIELD,
558 : eCSSKeyword_textfield_multiline, NS_THEME_TEXTFIELD_MULTILINE,
559 : eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET,
560 : eCSSKeyword_searchfield, NS_THEME_SEARCHFIELD,
561 : eCSSKeyword_menulist, NS_THEME_DROPDOWN,
562 : eCSSKeyword_menulistbutton, NS_THEME_DROPDOWN_BUTTON,
563 : eCSSKeyword_menulisttext, NS_THEME_DROPDOWN_TEXT,
564 : eCSSKeyword_menulisttextfield, NS_THEME_DROPDOWN_TEXTFIELD,
565 : eCSSKeyword_scale_horizontal, NS_THEME_SCALE_HORIZONTAL,
566 : eCSSKeyword_scale_vertical, NS_THEME_SCALE_VERTICAL,
567 : eCSSKeyword_scalethumb_horizontal, NS_THEME_SCALE_THUMB_HORIZONTAL,
568 : eCSSKeyword_scalethumb_vertical, NS_THEME_SCALE_THUMB_VERTICAL,
569 : eCSSKeyword_scalethumbstart, NS_THEME_SCALE_THUMB_START,
570 : eCSSKeyword_scalethumbend, NS_THEME_SCALE_THUMB_END,
571 : eCSSKeyword_scalethumbtick, NS_THEME_SCALE_TICK,
572 : eCSSKeyword_groupbox, NS_THEME_GROUPBOX,
573 : eCSSKeyword_checkboxcontainer, NS_THEME_CHECKBOX_CONTAINER,
574 : eCSSKeyword_radiocontainer, NS_THEME_RADIO_CONTAINER,
575 : eCSSKeyword_checkboxlabel, NS_THEME_CHECKBOX_LABEL,
576 : eCSSKeyword_radiolabel, NS_THEME_RADIO_LABEL,
577 : eCSSKeyword_buttonfocus, NS_THEME_BUTTON_FOCUS,
578 : eCSSKeyword_window, NS_THEME_WINDOW,
579 : eCSSKeyword_dialog, NS_THEME_DIALOG,
580 : eCSSKeyword_menubar, NS_THEME_MENUBAR,
581 : eCSSKeyword_menupopup, NS_THEME_MENUPOPUP,
582 : eCSSKeyword_menuitem, NS_THEME_MENUITEM,
583 : eCSSKeyword_checkmenuitem, NS_THEME_CHECKMENUITEM,
584 : eCSSKeyword_radiomenuitem, NS_THEME_RADIOMENUITEM,
585 : eCSSKeyword_menucheckbox, NS_THEME_MENUCHECKBOX,
586 : eCSSKeyword_menuradio, NS_THEME_MENURADIO,
587 : eCSSKeyword_menuseparator, NS_THEME_MENUSEPARATOR,
588 : eCSSKeyword_menuarrow, NS_THEME_MENUARROW,
589 : eCSSKeyword_menuimage, NS_THEME_MENUIMAGE,
590 : eCSSKeyword_menuitemtext, NS_THEME_MENUITEMTEXT,
591 : eCSSKeyword__moz_win_media_toolbox, NS_THEME_WIN_MEDIA_TOOLBOX,
592 : eCSSKeyword__moz_win_communications_toolbox, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX,
593 : eCSSKeyword__moz_win_browsertabbar_toolbox, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX,
594 : eCSSKeyword__moz_win_glass, NS_THEME_WIN_GLASS,
595 : eCSSKeyword__moz_win_borderless_glass, NS_THEME_WIN_BORDERLESS_GLASS,
596 : eCSSKeyword__moz_mac_unified_toolbar, NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR,
597 : eCSSKeyword__moz_window_titlebar, NS_THEME_WINDOW_TITLEBAR,
598 : eCSSKeyword__moz_window_titlebar_maximized, NS_THEME_WINDOW_TITLEBAR_MAXIMIZED,
599 : eCSSKeyword__moz_window_frame_left, NS_THEME_WINDOW_FRAME_LEFT,
600 : eCSSKeyword__moz_window_frame_right, NS_THEME_WINDOW_FRAME_RIGHT,
601 : eCSSKeyword__moz_window_frame_bottom, NS_THEME_WINDOW_FRAME_BOTTOM,
602 : eCSSKeyword__moz_window_button_close, NS_THEME_WINDOW_BUTTON_CLOSE,
603 : eCSSKeyword__moz_window_button_minimize, NS_THEME_WINDOW_BUTTON_MINIMIZE,
604 : eCSSKeyword__moz_window_button_maximize, NS_THEME_WINDOW_BUTTON_MAXIMIZE,
605 : eCSSKeyword__moz_window_button_restore, NS_THEME_WINDOW_BUTTON_RESTORE,
606 : eCSSKeyword__moz_window_button_box, NS_THEME_WINDOW_BUTTON_BOX,
607 : eCSSKeyword__moz_window_button_box_maximized, NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED,
608 : eCSSKeyword__moz_win_exclude_glass, NS_THEME_WIN_EXCLUDE_GLASS,
609 : eCSSKeyword_UNKNOWN,-1
610 : };
611 :
612 : const PRInt32 nsCSSProps::kBackfaceVisibilityKTable[] = {
613 : eCSSKeyword_visible, NS_STYLE_BACKFACE_VISIBILITY_VISIBLE,
614 : eCSSKeyword_hidden, NS_STYLE_BACKFACE_VISIBILITY_HIDDEN,
615 : eCSSKeyword_UNKNOWN,-1
616 : };
617 :
618 : const PRInt32 nsCSSProps::kTransformStyleKTable[] = {
619 : eCSSKeyword_flat, NS_STYLE_TRANSFORM_STYLE_FLAT,
620 : eCSSKeyword_preserve_3d, NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D,
621 : eCSSKeyword_UNKNOWN,-1
622 : };
623 :
624 : const PRInt32 nsCSSProps::kBackgroundAttachmentKTable[] = {
625 : eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED,
626 : eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL,
627 : eCSSKeyword_UNKNOWN,-1
628 : };
629 :
630 : const PRInt32 nsCSSProps::kBackgroundInlinePolicyKTable[] = {
631 : eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX,
632 : eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS,
633 : eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX,
634 : eCSSKeyword_UNKNOWN,-1
635 : };
636 :
637 : MOZ_STATIC_ASSERT(NS_STYLE_BG_CLIP_BORDER == NS_STYLE_BG_ORIGIN_BORDER &&
638 : NS_STYLE_BG_CLIP_PADDING == NS_STYLE_BG_ORIGIN_PADDING &&
639 : NS_STYLE_BG_CLIP_CONTENT == NS_STYLE_BG_ORIGIN_CONTENT,
640 : "bg-clip and bg-origin style constants must agree");
641 : const PRInt32 nsCSSProps::kBackgroundOriginKTable[] = {
642 : eCSSKeyword_border_box, NS_STYLE_BG_ORIGIN_BORDER,
643 : eCSSKeyword_padding_box, NS_STYLE_BG_ORIGIN_PADDING,
644 : eCSSKeyword_content_box, NS_STYLE_BG_ORIGIN_CONTENT,
645 : eCSSKeyword_UNKNOWN,-1
646 : };
647 :
648 : // Note: Don't change this table unless you update
649 : // parseBackgroundPosition!
650 :
651 : const PRInt32 nsCSSProps::kBackgroundPositionKTable[] = {
652 : eCSSKeyword_center, NS_STYLE_BG_POSITION_CENTER,
653 : eCSSKeyword_top, NS_STYLE_BG_POSITION_TOP,
654 : eCSSKeyword_bottom, NS_STYLE_BG_POSITION_BOTTOM,
655 : eCSSKeyword_left, NS_STYLE_BG_POSITION_LEFT,
656 : eCSSKeyword_right, NS_STYLE_BG_POSITION_RIGHT,
657 : eCSSKeyword_UNKNOWN,-1
658 : };
659 :
660 : const PRInt32 nsCSSProps::kBackgroundRepeatKTable[] = {
661 : eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_NO_REPEAT,
662 : eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_REPEAT,
663 : eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_REPEAT_X,
664 : eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_REPEAT_Y,
665 : eCSSKeyword_UNKNOWN,-1
666 : };
667 :
668 : const PRInt32 nsCSSProps::kBackgroundRepeatPartKTable[] = {
669 : eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_NO_REPEAT,
670 : eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_REPEAT,
671 : eCSSKeyword_UNKNOWN,-1
672 : };
673 :
674 : const PRInt32 nsCSSProps::kBackgroundSizeKTable[] = {
675 : eCSSKeyword_contain, NS_STYLE_BG_SIZE_CONTAIN,
676 : eCSSKeyword_cover, NS_STYLE_BG_SIZE_COVER,
677 : eCSSKeyword_UNKNOWN,-1
678 : };
679 :
680 : const PRInt32 nsCSSProps::kBorderCollapseKTable[] = {
681 : eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE,
682 : eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE,
683 : eCSSKeyword_UNKNOWN,-1
684 : };
685 :
686 : const PRInt32 nsCSSProps::kBorderColorKTable[] = {
687 : eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
688 : eCSSKeyword_UNKNOWN,-1
689 : };
690 :
691 : const PRInt32 nsCSSProps::kBorderImageRepeatKTable[] = {
692 : eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH,
693 : eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT,
694 : eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_REPEAT_ROUND,
695 : eCSSKeyword_UNKNOWN,-1
696 : };
697 :
698 : const PRInt32 nsCSSProps::kBorderImageSliceKTable[] = {
699 : eCSSKeyword_fill, NS_STYLE_BORDER_IMAGE_SLICE_FILL,
700 : eCSSKeyword_UNKNOWN,-1
701 : };
702 :
703 : const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
704 : eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE,
705 : eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN,
706 : eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
707 : eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
708 : eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
709 : eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
710 : eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
711 : eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
712 : eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
713 : eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
714 : eCSSKeyword_UNKNOWN,-1
715 : };
716 :
717 : const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
718 : eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
719 : eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
720 : eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
721 : eCSSKeyword_UNKNOWN,-1
722 : };
723 :
724 : const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
725 : eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL,
726 : eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL,
727 : eCSSKeyword_UNKNOWN,-1
728 : };
729 :
730 : const PRInt32 nsCSSProps::kBoxShadowTypeKTable[] = {
731 : eCSSKeyword_inset, NS_STYLE_BOX_SHADOW_INSET,
732 : eCSSKeyword_UNKNOWN,-1
733 : };
734 :
735 : const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
736 : eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT,
737 : eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER,
738 : eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING,
739 : eCSSKeyword_UNKNOWN,-1
740 : };
741 :
742 : const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
743 : eCSSKeyword_top, NS_STYLE_CAPTION_SIDE_TOP,
744 : eCSSKeyword_right, NS_STYLE_CAPTION_SIDE_RIGHT,
745 : eCSSKeyword_bottom, NS_STYLE_CAPTION_SIDE_BOTTOM,
746 : eCSSKeyword_left, NS_STYLE_CAPTION_SIDE_LEFT,
747 : eCSSKeyword_top_outside, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE,
748 : eCSSKeyword_bottom_outside, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
749 : eCSSKeyword_UNKNOWN, -1
750 : };
751 :
752 : const PRInt32 nsCSSProps::kClearKTable[] = {
753 : eCSSKeyword_none, NS_STYLE_CLEAR_NONE,
754 : eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
755 : eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
756 : eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
757 : eCSSKeyword_UNKNOWN,-1
758 : };
759 :
760 : const PRInt32 nsCSSProps::kColorKTable[] = {
761 : eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder,
762 : eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption,
763 : eCSSKeyword_appworkspace, LookAndFeel::eColorID_appworkspace,
764 : eCSSKeyword_background, LookAndFeel::eColorID_background,
765 : eCSSKeyword_buttonface, LookAndFeel::eColorID_buttonface,
766 : eCSSKeyword_buttonhighlight, LookAndFeel::eColorID_buttonhighlight,
767 : eCSSKeyword_buttonshadow, LookAndFeel::eColorID_buttonshadow,
768 : eCSSKeyword_buttontext, LookAndFeel::eColorID_buttontext,
769 : eCSSKeyword_captiontext, LookAndFeel::eColorID_captiontext,
770 : eCSSKeyword_graytext, LookAndFeel::eColorID_graytext,
771 : eCSSKeyword_highlight, LookAndFeel::eColorID_highlight,
772 : eCSSKeyword_highlighttext, LookAndFeel::eColorID_highlighttext,
773 : eCSSKeyword_inactiveborder, LookAndFeel::eColorID_inactiveborder,
774 : eCSSKeyword_inactivecaption, LookAndFeel::eColorID_inactivecaption,
775 : eCSSKeyword_inactivecaptiontext, LookAndFeel::eColorID_inactivecaptiontext,
776 : eCSSKeyword_infobackground, LookAndFeel::eColorID_infobackground,
777 : eCSSKeyword_infotext, LookAndFeel::eColorID_infotext,
778 : eCSSKeyword_menu, LookAndFeel::eColorID_menu,
779 : eCSSKeyword_menutext, LookAndFeel::eColorID_menutext,
780 : eCSSKeyword_scrollbar, LookAndFeel::eColorID_scrollbar,
781 : eCSSKeyword_threeddarkshadow, LookAndFeel::eColorID_threeddarkshadow,
782 : eCSSKeyword_threedface, LookAndFeel::eColorID_threedface,
783 : eCSSKeyword_threedhighlight, LookAndFeel::eColorID_threedhighlight,
784 : eCSSKeyword_threedlightshadow, LookAndFeel::eColorID_threedlightshadow,
785 : eCSSKeyword_threedshadow, LookAndFeel::eColorID_threedshadow,
786 : eCSSKeyword_window, LookAndFeel::eColorID_window,
787 : eCSSKeyword_windowframe, LookAndFeel::eColorID_windowframe,
788 : eCSSKeyword_windowtext, LookAndFeel::eColorID_windowtext,
789 : eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT,
790 : eCSSKeyword__moz_buttondefault, LookAndFeel::eColorID__moz_buttondefault,
791 : eCSSKeyword__moz_buttonhoverface, LookAndFeel::eColorID__moz_buttonhoverface,
792 : eCSSKeyword__moz_buttonhovertext, LookAndFeel::eColorID__moz_buttonhovertext,
793 : eCSSKeyword__moz_cellhighlight, LookAndFeel::eColorID__moz_cellhighlight,
794 : eCSSKeyword__moz_cellhighlighttext, LookAndFeel::eColorID__moz_cellhighlighttext,
795 : eCSSKeyword__moz_eventreerow, LookAndFeel::eColorID__moz_eventreerow,
796 : eCSSKeyword__moz_field, LookAndFeel::eColorID__moz_field,
797 : eCSSKeyword__moz_fieldtext, LookAndFeel::eColorID__moz_fieldtext,
798 : eCSSKeyword__moz_default_background_color, NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR,
799 : eCSSKeyword__moz_default_color, NS_COLOR_MOZ_DEFAULT_COLOR,
800 : eCSSKeyword__moz_dialog, LookAndFeel::eColorID__moz_dialog,
801 : eCSSKeyword__moz_dialogtext, LookAndFeel::eColorID__moz_dialogtext,
802 : eCSSKeyword__moz_dragtargetzone, LookAndFeel::eColorID__moz_dragtargetzone,
803 : eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT,
804 : eCSSKeyword__moz_html_cellhighlight, LookAndFeel::eColorID__moz_html_cellhighlight,
805 : eCSSKeyword__moz_html_cellhighlighttext, LookAndFeel::eColorID__moz_html_cellhighlighttext,
806 : eCSSKeyword__moz_mac_chrome_active, LookAndFeel::eColorID__moz_mac_chrome_active,
807 : eCSSKeyword__moz_mac_chrome_inactive, LookAndFeel::eColorID__moz_mac_chrome_inactive,
808 : eCSSKeyword__moz_mac_focusring, LookAndFeel::eColorID__moz_mac_focusring,
809 : eCSSKeyword__moz_mac_menuselect, LookAndFeel::eColorID__moz_mac_menuselect,
810 : eCSSKeyword__moz_mac_menushadow, LookAndFeel::eColorID__moz_mac_menushadow,
811 : eCSSKeyword__moz_mac_menutextdisable, LookAndFeel::eColorID__moz_mac_menutextdisable,
812 : eCSSKeyword__moz_mac_menutextselect, LookAndFeel::eColorID__moz_mac_menutextselect,
813 : eCSSKeyword__moz_mac_disabledtoolbartext, LookAndFeel::eColorID__moz_mac_disabledtoolbartext,
814 : eCSSKeyword__moz_mac_alternateprimaryhighlight, LookAndFeel::eColorID__moz_mac_alternateprimaryhighlight,
815 : eCSSKeyword__moz_mac_secondaryhighlight, LookAndFeel::eColorID__moz_mac_secondaryhighlight,
816 : eCSSKeyword__moz_menuhover, LookAndFeel::eColorID__moz_menuhover,
817 : eCSSKeyword__moz_menuhovertext, LookAndFeel::eColorID__moz_menuhovertext,
818 : eCSSKeyword__moz_menubartext, LookAndFeel::eColorID__moz_menubartext,
819 : eCSSKeyword__moz_menubarhovertext, LookAndFeel::eColorID__moz_menubarhovertext,
820 : eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow,
821 : eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
822 : eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR,
823 : eCSSKeyword__moz_win_mediatext, LookAndFeel::eColorID__moz_win_mediatext,
824 : eCSSKeyword__moz_win_communicationstext, LookAndFeel::eColorID__moz_win_communicationstext,
825 : eCSSKeyword__moz_nativehyperlinktext, LookAndFeel::eColorID__moz_nativehyperlinktext,
826 : eCSSKeyword__moz_comboboxtext, LookAndFeel::eColorID__moz_comboboxtext,
827 : eCSSKeyword__moz_combobox, LookAndFeel::eColorID__moz_combobox,
828 : eCSSKeyword_UNKNOWN,-1
829 : };
830 :
831 : const PRInt32 nsCSSProps::kContentKTable[] = {
832 : eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE,
833 : eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
834 : eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
835 : eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
836 : eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT,
837 : eCSSKeyword_UNKNOWN,-1
838 : };
839 :
840 : const PRInt32 nsCSSProps::kCursorKTable[] = {
841 : // CSS 2.0
842 : eCSSKeyword_auto, NS_STYLE_CURSOR_AUTO,
843 : eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR,
844 : eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT,
845 : eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER,
846 : eCSSKeyword_move, NS_STYLE_CURSOR_MOVE,
847 : eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE,
848 : eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE,
849 : eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE,
850 : eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE,
851 : eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE,
852 : eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE,
853 : eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE,
854 : eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE,
855 : eCSSKeyword_text, NS_STYLE_CURSOR_TEXT,
856 : eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT,
857 : eCSSKeyword_help, NS_STYLE_CURSOR_HELP,
858 : // CSS 2.1
859 : eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING,
860 : // CSS3 basic user interface module
861 : eCSSKeyword_copy, NS_STYLE_CURSOR_COPY,
862 : eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS,
863 : eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
864 : eCSSKeyword_cell, NS_STYLE_CURSOR_CELL,
865 : eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED,
866 : eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE,
867 : eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE,
868 : eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP,
869 : eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT,
870 : eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL,
871 : eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE,
872 : eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE,
873 : eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE,
874 : eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE,
875 : eCSSKeyword_none, NS_STYLE_CURSOR_NONE,
876 : // -moz- prefixed vendor specific
877 : eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB,
878 : eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING,
879 : eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
880 : eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
881 : eCSSKeyword_UNKNOWN,-1
882 : };
883 :
884 : const PRInt32 nsCSSProps::kDirectionKTable[] = {
885 : eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR,
886 : eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL,
887 : eCSSKeyword_UNKNOWN,-1
888 : };
889 :
890 : const PRInt32 nsCSSProps::kDisplayKTable[] = {
891 : eCSSKeyword_none, NS_STYLE_DISPLAY_NONE,
892 : eCSSKeyword_inline, NS_STYLE_DISPLAY_INLINE,
893 : eCSSKeyword_block, NS_STYLE_DISPLAY_BLOCK,
894 : eCSSKeyword_inline_block, NS_STYLE_DISPLAY_INLINE_BLOCK,
895 : eCSSKeyword_list_item, NS_STYLE_DISPLAY_LIST_ITEM,
896 : eCSSKeyword_table, NS_STYLE_DISPLAY_TABLE,
897 : eCSSKeyword_inline_table, NS_STYLE_DISPLAY_INLINE_TABLE,
898 : eCSSKeyword_table_row_group, NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
899 : eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
900 : eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
901 : eCSSKeyword_table_row, NS_STYLE_DISPLAY_TABLE_ROW,
902 : eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
903 : eCSSKeyword_table_column, NS_STYLE_DISPLAY_TABLE_COLUMN,
904 : eCSSKeyword_table_cell, NS_STYLE_DISPLAY_TABLE_CELL,
905 : eCSSKeyword_table_caption, NS_STYLE_DISPLAY_TABLE_CAPTION,
906 : // Make sure this is kept in sync with the code in
907 : // nsCSSFrameConstructor::ConstructXULFrame
908 : eCSSKeyword__moz_box, NS_STYLE_DISPLAY_BOX,
909 : eCSSKeyword__moz_inline_box, NS_STYLE_DISPLAY_INLINE_BOX,
910 : #ifdef MOZ_XUL
911 : eCSSKeyword__moz_grid, NS_STYLE_DISPLAY_GRID,
912 : eCSSKeyword__moz_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID,
913 : eCSSKeyword__moz_grid_group, NS_STYLE_DISPLAY_GRID_GROUP,
914 : eCSSKeyword__moz_grid_line, NS_STYLE_DISPLAY_GRID_LINE,
915 : eCSSKeyword__moz_stack, NS_STYLE_DISPLAY_STACK,
916 : eCSSKeyword__moz_inline_stack, NS_STYLE_DISPLAY_INLINE_STACK,
917 : eCSSKeyword__moz_deck, NS_STYLE_DISPLAY_DECK,
918 : eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP,
919 : eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX,
920 : #endif
921 : eCSSKeyword_UNKNOWN,-1
922 : };
923 :
924 : const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
925 : eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
926 : eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
927 : eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
928 : eCSSKeyword_UNKNOWN,-1
929 : };
930 :
931 : const PRInt32 nsCSSProps::kFloatKTable[] = {
932 : eCSSKeyword_none, NS_STYLE_FLOAT_NONE,
933 : eCSSKeyword_left, NS_STYLE_FLOAT_LEFT,
934 : eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
935 : eCSSKeyword_UNKNOWN,-1
936 : };
937 :
938 : const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
939 : eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT,
940 : eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN,
941 : eCSSKeyword_UNKNOWN,-1
942 : };
943 :
944 : const PRInt32 nsCSSProps::kFontKTable[] = {
945 : // CSS2.
946 : eCSSKeyword_caption, NS_STYLE_FONT_CAPTION,
947 : eCSSKeyword_icon, NS_STYLE_FONT_ICON,
948 : eCSSKeyword_menu, NS_STYLE_FONT_MENU,
949 : eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX,
950 : eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION,
951 : eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR,
952 :
953 : // Proposed for CSS3.
954 : eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW,
955 : eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT,
956 : eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE,
957 : eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP,
958 : eCSSKeyword__moz_info, NS_STYLE_FONT_INFO,
959 : eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG,
960 : eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON,
961 : eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
962 : eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
963 : eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
964 : eCSSKeyword_UNKNOWN,-1
965 : };
966 :
967 : const PRInt32 nsCSSProps::kFontSizeKTable[] = {
968 : eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL,
969 : eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL,
970 : eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL,
971 : eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM,
972 : eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE,
973 : eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE,
974 : eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
975 : eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
976 : eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
977 : eCSSKeyword_UNKNOWN,-1
978 : };
979 :
980 : const PRInt32 nsCSSProps::kFontStretchKTable[] = {
981 : eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED,
982 : eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED,
983 : eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED,
984 : eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED,
985 : eCSSKeyword_normal, NS_STYLE_FONT_STRETCH_NORMAL,
986 : eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED,
987 : eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
988 : eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
989 : eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
990 : eCSSKeyword_UNKNOWN,-1
991 : };
992 :
993 : const PRInt32 nsCSSProps::kFontStyleKTable[] = {
994 : eCSSKeyword_normal, NS_STYLE_FONT_STYLE_NORMAL,
995 : eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
996 : eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
997 : eCSSKeyword_UNKNOWN,-1
998 : };
999 :
1000 : const PRInt32 nsCSSProps::kFontVariantKTable[] = {
1001 : eCSSKeyword_normal, NS_STYLE_FONT_VARIANT_NORMAL,
1002 : eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
1003 : eCSSKeyword_UNKNOWN,-1
1004 : };
1005 :
1006 : const PRInt32 nsCSSProps::kFontWeightKTable[] = {
1007 : eCSSKeyword_normal, NS_STYLE_FONT_WEIGHT_NORMAL,
1008 : eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
1009 : eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
1010 : eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
1011 : eCSSKeyword_UNKNOWN,-1
1012 : };
1013 :
1014 : const PRInt32 nsCSSProps::kIMEModeKTable[] = {
1015 : eCSSKeyword_normal, NS_STYLE_IME_MODE_NORMAL,
1016 : eCSSKeyword_auto, NS_STYLE_IME_MODE_AUTO,
1017 : eCSSKeyword_active, NS_STYLE_IME_MODE_ACTIVE,
1018 : eCSSKeyword_disabled, NS_STYLE_IME_MODE_DISABLED,
1019 : eCSSKeyword_inactive, NS_STYLE_IME_MODE_INACTIVE,
1020 : eCSSKeyword_UNKNOWN,-1
1021 : };
1022 :
1023 : const PRInt32 nsCSSProps::kLineHeightKTable[] = {
1024 : // -moz- prefixed, intended for internal use for single-line controls
1025 : eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT,
1026 : eCSSKeyword_UNKNOWN,-1
1027 : };
1028 :
1029 : const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
1030 : eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
1031 : eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
1032 : eCSSKeyword_UNKNOWN,-1
1033 : };
1034 :
1035 : const PRInt32 nsCSSProps::kListStyleKTable[] = {
1036 : eCSSKeyword_none, NS_STYLE_LIST_STYLE_NONE,
1037 : eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC,
1038 : eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE,
1039 : eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE,
1040 : eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL,
1041 : eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO,
1042 : eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN,
1043 : eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN,
1044 : eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK,
1045 : eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA,
1046 : eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN,
1047 : eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA,
1048 : eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN,
1049 : eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW,
1050 : eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN,
1051 : eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN,
1052 : eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC,
1053 : eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA,
1054 : eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA,
1055 : eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA,
1056 : eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA,
1057 : eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM,
1058 : eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH,
1059 : eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL,
1060 : eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL,
1061 : eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL,
1062 : eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL,
1063 : eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL,
1064 : eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL,
1065 : eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC,
1066 : eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN,
1067 : eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU,
1068 : eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI,
1069 : eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI,
1070 : eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI,
1071 : eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA,
1072 : eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA,
1073 : eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM,
1074 : eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI,
1075 : eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL,
1076 : eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU,
1077 : eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI,
1078 : eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO,
1079 : eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR,
1080 : eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER,
1081 : eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL,
1082 : eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT,
1083 : eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME,
1084 : eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC,
1085 : eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
1086 : eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
1087 : eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
1088 : eCSSKeyword_UNKNOWN,-1
1089 : };
1090 :
1091 : const PRInt32 nsCSSProps::kOrientKTable[] = {
1092 : eCSSKeyword_horizontal, NS_STYLE_ORIENT_HORIZONTAL,
1093 : eCSSKeyword_vertical, NS_STYLE_ORIENT_VERTICAL,
1094 : eCSSKeyword_UNKNOWN, -1
1095 : };
1096 :
1097 : // Same as kBorderStyleKTable except 'hidden'.
1098 : const PRInt32 nsCSSProps::kOutlineStyleKTable[] = {
1099 : eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE,
1100 : eCSSKeyword_auto, NS_STYLE_BORDER_STYLE_AUTO,
1101 : eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
1102 : eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
1103 : eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
1104 : eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
1105 : eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
1106 : eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
1107 : eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
1108 : eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
1109 : eCSSKeyword_UNKNOWN,-1
1110 : };
1111 :
1112 : const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
1113 : eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
1114 : eCSSKeyword_UNKNOWN,-1
1115 : };
1116 :
1117 : const PRInt32 nsCSSProps::kOverflowKTable[] = {
1118 : eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO,
1119 : eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
1120 : eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
1121 : eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
1122 : // Deprecated:
1123 : eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
1124 : eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
1125 : eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
1126 : eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
1127 : eCSSKeyword_UNKNOWN,-1
1128 : };
1129 :
1130 : const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
1131 : eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO,
1132 : eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
1133 : eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
1134 : eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
1135 : // Deprecated:
1136 : eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
1137 : eCSSKeyword_UNKNOWN,-1
1138 : };
1139 :
1140 : const PRInt32 nsCSSProps::kPageBreakKTable[] = {
1141 : eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO,
1142 : eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
1143 : eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
1144 : eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
1145 : eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
1146 : eCSSKeyword_UNKNOWN,-1
1147 : };
1148 :
1149 : const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
1150 : eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO,
1151 : eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
1152 : eCSSKeyword_UNKNOWN,-1
1153 : };
1154 :
1155 : const PRInt32 nsCSSProps::kPageMarksKTable[] = {
1156 : eCSSKeyword_none, NS_STYLE_PAGE_MARKS_NONE,
1157 : eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
1158 : eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
1159 : eCSSKeyword_UNKNOWN,-1
1160 : };
1161 :
1162 : const PRInt32 nsCSSProps::kPageSizeKTable[] = {
1163 : eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
1164 : eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
1165 : eCSSKeyword_UNKNOWN,-1
1166 : };
1167 :
1168 : const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
1169 : eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE,
1170 : eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
1171 : eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
1172 : eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
1173 : eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
1174 : eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
1175 : eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
1176 : eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
1177 : eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
1178 : eCSSKeyword_auto, NS_STYLE_POINTER_EVENTS_AUTO,
1179 : eCSSKeyword_UNKNOWN, -1
1180 : };
1181 :
1182 : const PRInt32 nsCSSProps::kPositionKTable[] = {
1183 : eCSSKeyword_static, NS_STYLE_POSITION_STATIC,
1184 : eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
1185 : eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
1186 : eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
1187 : eCSSKeyword_UNKNOWN,-1
1188 : };
1189 :
1190 : const PRInt32 nsCSSProps::kRadialGradientShapeKTable[] = {
1191 : eCSSKeyword_circle, NS_STYLE_GRADIENT_SHAPE_CIRCULAR,
1192 : eCSSKeyword_ellipse, NS_STYLE_GRADIENT_SHAPE_ELLIPTICAL,
1193 : eCSSKeyword_UNKNOWN,-1
1194 : };
1195 :
1196 : const PRInt32 nsCSSProps::kRadialGradientSizeKTable[] = {
1197 : eCSSKeyword_closest_side, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE,
1198 : eCSSKeyword_closest_corner, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER,
1199 : eCSSKeyword_farthest_side, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE,
1200 : eCSSKeyword_farthest_corner, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER,
1201 : // synonyms
1202 : eCSSKeyword_contain, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE,
1203 : eCSSKeyword_cover, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER,
1204 : eCSSKeyword_UNKNOWN,-1
1205 : };
1206 :
1207 : const PRInt32 nsCSSProps::kResizeKTable[] = {
1208 : eCSSKeyword_none, NS_STYLE_RESIZE_NONE,
1209 : eCSSKeyword_both, NS_STYLE_RESIZE_BOTH,
1210 : eCSSKeyword_horizontal, NS_STYLE_RESIZE_HORIZONTAL,
1211 : eCSSKeyword_vertical, NS_STYLE_RESIZE_VERTICAL,
1212 : eCSSKeyword_UNKNOWN,-1
1213 : };
1214 :
1215 : const PRInt32 nsCSSProps::kStackSizingKTable[] = {
1216 : eCSSKeyword_ignore, NS_STYLE_STACK_SIZING_IGNORE,
1217 : eCSSKeyword_stretch_to_fit, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT,
1218 : eCSSKeyword_UNKNOWN,-1
1219 : };
1220 :
1221 : const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
1222 : eCSSKeyword_auto, NS_STYLE_TABLE_LAYOUT_AUTO,
1223 : eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
1224 : eCSSKeyword_UNKNOWN,-1
1225 : };
1226 :
1227 : const PRInt32 nsCSSProps::kTextAlignKTable[] = {
1228 : eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
1229 : eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
1230 : eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
1231 : eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
1232 : eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
1233 : eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
1234 : eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT,
1235 : eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
1236 : eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END,
1237 : eCSSKeyword_UNKNOWN,-1
1238 : };
1239 :
1240 : const PRInt32 nsCSSProps::kTextAlignLastKTable[] = {
1241 : eCSSKeyword_auto, NS_STYLE_TEXT_ALIGN_AUTO,
1242 : eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
1243 : eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
1244 : eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
1245 : eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
1246 : eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
1247 : eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END,
1248 : eCSSKeyword_UNKNOWN,-1
1249 : };
1250 :
1251 : const PRInt32 nsCSSProps::kTextBlinkKTable[] = {
1252 : eCSSKeyword_none, NS_STYLE_TEXT_BLINK_NONE,
1253 : eCSSKeyword_blink, NS_STYLE_TEXT_BLINK_BLINK,
1254 : eCSSKeyword_UNKNOWN,-1
1255 : };
1256 :
1257 : const PRInt32 nsCSSProps::kTextDecorationLineKTable[] = {
1258 : eCSSKeyword_none, NS_STYLE_TEXT_DECORATION_LINE_NONE,
1259 : eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE,
1260 : eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_LINE_OVERLINE,
1261 : eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH,
1262 : eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_LINE_PREF_ANCHORS,
1263 : eCSSKeyword_UNKNOWN,-1
1264 : };
1265 :
1266 : const PRInt32 nsCSSProps::kTextDecorationStyleKTable[] = {
1267 : eCSSKeyword__moz_none, NS_STYLE_TEXT_DECORATION_STYLE_NONE,
1268 : eCSSKeyword_solid, NS_STYLE_TEXT_DECORATION_STYLE_SOLID,
1269 : eCSSKeyword_double, NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE,
1270 : eCSSKeyword_dotted, NS_STYLE_TEXT_DECORATION_STYLE_DOTTED,
1271 : eCSSKeyword_dashed, NS_STYLE_TEXT_DECORATION_STYLE_DASHED,
1272 : eCSSKeyword_wavy, NS_STYLE_TEXT_DECORATION_STYLE_WAVY,
1273 : eCSSKeyword_UNKNOWN,-1
1274 : };
1275 :
1276 : const PRInt32 nsCSSProps::kTextOverflowKTable[] = {
1277 : eCSSKeyword_clip, NS_STYLE_TEXT_OVERFLOW_CLIP,
1278 : eCSSKeyword_ellipsis, NS_STYLE_TEXT_OVERFLOW_ELLIPSIS,
1279 : eCSSKeyword_UNKNOWN, -1
1280 : };
1281 :
1282 : const PRInt32 nsCSSProps::kTextTransformKTable[] = {
1283 : eCSSKeyword_none, NS_STYLE_TEXT_TRANSFORM_NONE,
1284 : eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
1285 : eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
1286 : eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
1287 : eCSSKeyword_UNKNOWN,-1
1288 : };
1289 :
1290 : const PRInt32 nsCSSProps::kTransitionTimingFunctionKTable[] = {
1291 : eCSSKeyword_ease, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE,
1292 : eCSSKeyword_linear, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR,
1293 : eCSSKeyword_ease_in, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN,
1294 : eCSSKeyword_ease_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_OUT,
1295 : eCSSKeyword_ease_in_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT,
1296 : eCSSKeyword_step_start, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START,
1297 : eCSSKeyword_step_end, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END,
1298 : eCSSKeyword_UNKNOWN,-1
1299 : };
1300 :
1301 : const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
1302 : eCSSKeyword_normal, NS_STYLE_UNICODE_BIDI_NORMAL,
1303 : eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
1304 : eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
1305 : eCSSKeyword__moz_isolate, NS_STYLE_UNICODE_BIDI_ISOLATE,
1306 : eCSSKeyword__moz_plaintext, NS_STYLE_UNICODE_BIDI_PLAINTEXT,
1307 : eCSSKeyword_UNKNOWN,-1
1308 : };
1309 :
1310 : const PRInt32 nsCSSProps::kUserFocusKTable[] = {
1311 : eCSSKeyword_none, NS_STYLE_USER_FOCUS_NONE,
1312 : eCSSKeyword_normal, NS_STYLE_USER_FOCUS_NORMAL,
1313 : eCSSKeyword_ignore, NS_STYLE_USER_FOCUS_IGNORE,
1314 : eCSSKeyword_select_all, NS_STYLE_USER_FOCUS_SELECT_ALL,
1315 : eCSSKeyword_select_before, NS_STYLE_USER_FOCUS_SELECT_BEFORE,
1316 : eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER,
1317 : eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME,
1318 : eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU,
1319 : eCSSKeyword_UNKNOWN,-1
1320 : };
1321 :
1322 : const PRInt32 nsCSSProps::kUserInputKTable[] = {
1323 : eCSSKeyword_none, NS_STYLE_USER_INPUT_NONE,
1324 : eCSSKeyword_auto, NS_STYLE_USER_INPUT_AUTO,
1325 : eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED,
1326 : eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
1327 : eCSSKeyword_UNKNOWN,-1
1328 : };
1329 :
1330 : const PRInt32 nsCSSProps::kUserModifyKTable[] = {
1331 : eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY,
1332 : eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
1333 : eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
1334 : eCSSKeyword_UNKNOWN,-1
1335 : };
1336 :
1337 : const PRInt32 nsCSSProps::kUserSelectKTable[] = {
1338 : eCSSKeyword_none, NS_STYLE_USER_SELECT_NONE,
1339 : eCSSKeyword_auto, NS_STYLE_USER_SELECT_AUTO,
1340 : eCSSKeyword_text, NS_STYLE_USER_SELECT_TEXT,
1341 : eCSSKeyword_element, NS_STYLE_USER_SELECT_ELEMENT,
1342 : eCSSKeyword_elements, NS_STYLE_USER_SELECT_ELEMENTS,
1343 : eCSSKeyword_all, NS_STYLE_USER_SELECT_ALL,
1344 : eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE,
1345 : eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE,
1346 : eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL,
1347 : eCSSKeyword__moz_none, NS_STYLE_USER_SELECT_MOZ_NONE,
1348 : eCSSKeyword_UNKNOWN,-1
1349 : };
1350 :
1351 : const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
1352 : eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE,
1353 : eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB,
1354 : eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER,
1355 : eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP,
1356 : eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP,
1357 : eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
1358 : eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE,
1359 : eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
1360 : eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
1361 : eCSSKeyword_UNKNOWN,-1
1362 : };
1363 :
1364 : const PRInt32 nsCSSProps::kVisibilityKTable[] = {
1365 : eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
1366 : eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
1367 : eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
1368 : eCSSKeyword_UNKNOWN,-1
1369 : };
1370 :
1371 : const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
1372 : eCSSKeyword_normal, NS_STYLE_WHITESPACE_NORMAL,
1373 : eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
1374 : eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
1375 : eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP,
1376 : eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE,
1377 : eCSSKeyword_UNKNOWN,-1
1378 : };
1379 :
1380 : const PRInt32 nsCSSProps::kWidthKTable[] = {
1381 : eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT,
1382 : eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT,
1383 : eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT,
1384 : eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE,
1385 : eCSSKeyword_UNKNOWN,-1
1386 : };
1387 :
1388 : const PRInt32 nsCSSProps::kWindowShadowKTable[] = {
1389 : eCSSKeyword_none, NS_STYLE_WINDOW_SHADOW_NONE,
1390 : eCSSKeyword_default, NS_STYLE_WINDOW_SHADOW_DEFAULT,
1391 : eCSSKeyword_menu, NS_STYLE_WINDOW_SHADOW_MENU,
1392 : eCSSKeyword_tooltip, NS_STYLE_WINDOW_SHADOW_TOOLTIP,
1393 : eCSSKeyword_sheet, NS_STYLE_WINDOW_SHADOW_SHEET,
1394 : eCSSKeyword_UNKNOWN,-1
1395 : };
1396 :
1397 : const PRInt32 nsCSSProps::kWordwrapKTable[] = {
1398 : eCSSKeyword_normal, NS_STYLE_WORDWRAP_NORMAL,
1399 : eCSSKeyword_break_word, NS_STYLE_WORDWRAP_BREAK_WORD,
1400 : eCSSKeyword_UNKNOWN,-1
1401 : };
1402 :
1403 : const PRInt32 nsCSSProps::kHyphensKTable[] = {
1404 : eCSSKeyword_none, NS_STYLE_HYPHENS_NONE,
1405 : eCSSKeyword_manual, NS_STYLE_HYPHENS_MANUAL,
1406 : eCSSKeyword_auto, NS_STYLE_HYPHENS_AUTO,
1407 : eCSSKeyword_UNKNOWN,-1
1408 : };
1409 :
1410 : // Specific keyword tables for XUL.properties
1411 : const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
1412 : eCSSKeyword_stretch, NS_STYLE_BOX_ALIGN_STRETCH,
1413 : eCSSKeyword_start, NS_STYLE_BOX_ALIGN_START,
1414 : eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
1415 : eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE,
1416 : eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END,
1417 : eCSSKeyword_UNKNOWN,-1
1418 : };
1419 :
1420 : const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
1421 : eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL,
1422 : eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE,
1423 : eCSSKeyword_UNKNOWN,-1
1424 : };
1425 :
1426 : const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
1427 : eCSSKeyword_horizontal, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1428 : eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL,
1429 : eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1430 : eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL,
1431 : eCSSKeyword_UNKNOWN,-1
1432 : };
1433 :
1434 : const PRInt32 nsCSSProps::kBoxPackKTable[] = {
1435 : eCSSKeyword_start, NS_STYLE_BOX_PACK_START,
1436 : eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER,
1437 : eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
1438 : eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY,
1439 : eCSSKeyword_UNKNOWN,-1
1440 : };
1441 :
1442 : // keyword tables for SVG properties
1443 :
1444 : const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
1445 : eCSSKeyword_auto, NS_STYLE_DOMINANT_BASELINE_AUTO,
1446 : eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT,
1447 : eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE,
1448 : eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE,
1449 : eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC,
1450 : eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING,
1451 : eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC,
1452 : eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL,
1453 : eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL,
1454 : eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
1455 : eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
1456 : eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
1457 : eCSSKeyword_UNKNOWN, -1
1458 : };
1459 :
1460 : const PRInt32 nsCSSProps::kFillRuleKTable[] = {
1461 : eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
1462 : eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
1463 : eCSSKeyword_UNKNOWN, -1
1464 : };
1465 :
1466 : const PRInt32 nsCSSProps::kImageRenderingKTable[] = {
1467 : eCSSKeyword_auto, NS_STYLE_IMAGE_RENDERING_AUTO,
1468 : eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED,
1469 : eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY,
1470 : eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES,
1471 : eCSSKeyword_UNKNOWN, -1
1472 : };
1473 :
1474 : const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
1475 : eCSSKeyword_auto, NS_STYLE_SHAPE_RENDERING_AUTO,
1476 : eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
1477 : eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
1478 : eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
1479 : eCSSKeyword_UNKNOWN, -1
1480 : };
1481 :
1482 : const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
1483 : eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
1484 : eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
1485 : eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
1486 : eCSSKeyword_UNKNOWN, -1
1487 : };
1488 :
1489 : const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
1490 : eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
1491 : eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
1492 : eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
1493 : eCSSKeyword_UNKNOWN, -1
1494 : };
1495 :
1496 : const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
1497 : eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
1498 : eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
1499 : eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
1500 : eCSSKeyword_UNKNOWN, -1
1501 : };
1502 :
1503 : const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
1504 : eCSSKeyword_auto, NS_STYLE_TEXT_RENDERING_AUTO,
1505 : eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
1506 : eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
1507 : eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
1508 : eCSSKeyword_UNKNOWN, -1
1509 : };
1510 :
1511 : const PRInt32 nsCSSProps::kColorInterpolationKTable[] = {
1512 : eCSSKeyword_auto, NS_STYLE_COLOR_INTERPOLATION_AUTO,
1513 : eCSSKeyword_srgb, NS_STYLE_COLOR_INTERPOLATION_SRGB,
1514 : eCSSKeyword_linearrgb, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB,
1515 : eCSSKeyword_UNKNOWN, -1
1516 : };
1517 :
1518 : const PRInt32 nsCSSProps::kColumnFillKTable[] = {
1519 : eCSSKeyword_auto, NS_STYLE_COLUMN_FILL_AUTO,
1520 : eCSSKeyword_balance, NS_STYLE_COLUMN_FILL_BALANCE,
1521 : eCSSKeyword_UNKNOWN, -1
1522 : };
1523 :
1524 : bool
1525 0 : nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
1526 : {
1527 0 : PRInt32 index = 0;
1528 0 : while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
1529 0 : if (aKeyword == nsCSSKeyword(aTable[index])) {
1530 0 : aResult = aTable[index+1];
1531 0 : return true;
1532 : }
1533 0 : index += 2;
1534 : }
1535 0 : return false;
1536 : }
1537 :
1538 : nsCSSKeyword
1539 0 : nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
1540 : {
1541 0 : PRInt32 i = 1;
1542 0 : for (;;) {
1543 0 : if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
1544 : break;
1545 : }
1546 0 : if (aValue == aTable[i]) {
1547 0 : return nsCSSKeyword(aTable[i-1]);
1548 : }
1549 0 : i += 2;
1550 : }
1551 0 : return eCSSKeyword_UNKNOWN;
1552 : }
1553 :
1554 : const nsAFlatCString&
1555 0 : nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
1556 : {
1557 0 : nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
1558 0 : if (keyword == eCSSKeyword_UNKNOWN) {
1559 0 : static nsDependentCString sNullStr("");
1560 0 : return sNullStr;
1561 : } else {
1562 0 : return nsCSSKeywords::GetStringValue(keyword);
1563 : }
1564 : }
1565 :
1566 : /* static */ const PRInt32* const
1567 : nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = {
1568 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1569 : stylestruct_, stylestructoffset_, animtype_) \
1570 : kwtable_,
1571 : #include "nsCSSPropList.h"
1572 : #undef CSS_PROP
1573 : };
1574 :
1575 : const nsAFlatCString&
1576 0 : nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
1577 : {
1578 0 : NS_ABORT_IF_FALSE(aProp >= 0 && aProp < eCSSProperty_COUNT,
1579 : "property out of range");
1580 :
1581 0 : const PRInt32* kwtable = nsnull;
1582 0 : if (aProp < eCSSProperty_COUNT_no_shorthands)
1583 0 : kwtable = kKeywordTableTable[aProp];
1584 :
1585 0 : if (kwtable)
1586 0 : return ValueToKeyword(aValue, kwtable);
1587 :
1588 0 : static nsDependentCString sNullStr("");
1589 0 : return sNullStr;
1590 : }
1591 :
1592 0 : bool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
1593 : {
1594 0 : bool rv = false;
1595 :
1596 : // first get the keyword corresponding to the property Value from the color table
1597 0 : nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
1598 :
1599 : // next get the name as a string from the keywords table
1600 0 : if (keyword != eCSSKeyword_UNKNOWN) {
1601 0 : nsCSSKeywords::AddRefTable();
1602 0 : aStr = nsCSSKeywords::GetStringValue(keyword);
1603 0 : nsCSSKeywords::ReleaseTable();
1604 0 : rv = true;
1605 : }
1606 0 : return rv;
1607 : }
1608 :
1609 : const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = {
1610 : // Note that this uses the special BackendOnly style struct ID
1611 : // (which does need to be valid for storing in the
1612 : // nsCSSCompressedDataBlock::mStyleBits bitfield).
1613 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1614 : stylestruct_, stylestructoffset_, animtype_) \
1615 : eStyleStruct_##stylestruct_,
1616 :
1617 : #include "nsCSSPropList.h"
1618 :
1619 : #undef CSS_PROP
1620 : };
1621 :
1622 : const nsStyleAnimType
1623 : nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = {
1624 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1625 : stylestruct_, stylestructoffset_, animtype_) \
1626 : animtype_,
1627 : #include "nsCSSPropList.h"
1628 : #undef CSS_PROP
1629 : };
1630 :
1631 : const ptrdiff_t
1632 : nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = {
1633 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1634 : stylestruct_, stylestructoffset_, animtype_) \
1635 : stylestructoffset_,
1636 : #include "nsCSSPropList.h"
1637 : #undef CSS_PROP
1638 : };
1639 :
1640 : const PRUint32 nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
1641 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1642 : stylestruct_, stylestructoffset_, animtype_) \
1643 : flags_,
1644 : #include "nsCSSPropList.h"
1645 : #undef CSS_PROP
1646 : #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) flags_,
1647 : #include "nsCSSPropList.h"
1648 : #undef CSS_PROP_SHORTHAND
1649 : };
1650 :
1651 : static const nsCSSProperty gAnimationSubpropTable[] = {
1652 : eCSSProperty_animation_duration,
1653 : eCSSProperty_animation_timing_function,
1654 : eCSSProperty_animation_delay,
1655 : eCSSProperty_animation_direction,
1656 : eCSSProperty_animation_fill_mode,
1657 : eCSSProperty_animation_iteration_count,
1658 : // List animation-name last so we serialize it last, in case it has
1659 : // a value that conflicts with one of the other properties. (See
1660 : // how Declaration::GetValue serializes 'animation'.
1661 : eCSSProperty_animation_name,
1662 : eCSSProperty_UNKNOWN
1663 : };
1664 :
1665 : static const nsCSSProperty gBorderRadiusSubpropTable[] = {
1666 : // Code relies on these being in topleft-topright-bottomright-bottomleft
1667 : // order.
1668 : eCSSProperty_border_top_left_radius,
1669 : eCSSProperty_border_top_right_radius,
1670 : eCSSProperty_border_bottom_right_radius,
1671 : eCSSProperty_border_bottom_left_radius,
1672 : eCSSProperty_UNKNOWN
1673 : };
1674 :
1675 : static const nsCSSProperty gOutlineRadiusSubpropTable[] = {
1676 : // Code relies on these being in topleft-topright-bottomright-bottomleft
1677 : // order.
1678 : eCSSProperty__moz_outline_radius_topLeft,
1679 : eCSSProperty__moz_outline_radius_topRight,
1680 : eCSSProperty__moz_outline_radius_bottomRight,
1681 : eCSSProperty__moz_outline_radius_bottomLeft,
1682 : eCSSProperty_UNKNOWN
1683 : };
1684 :
1685 : static const nsCSSProperty gBackgroundSubpropTable[] = {
1686 : eCSSProperty_background_color,
1687 : eCSSProperty_background_image,
1688 : eCSSProperty_background_repeat,
1689 : eCSSProperty_background_attachment,
1690 : eCSSProperty_background_position,
1691 : eCSSProperty_background_clip,
1692 : eCSSProperty_background_origin,
1693 : eCSSProperty_background_size,
1694 : eCSSProperty_UNKNOWN
1695 : };
1696 :
1697 : static const nsCSSProperty gBorderSubpropTable[] = {
1698 : eCSSProperty_border_top_width,
1699 : eCSSProperty_border_right_width_value,
1700 : eCSSProperty_border_right_width_ltr_source,
1701 : eCSSProperty_border_right_width_rtl_source,
1702 : eCSSProperty_border_bottom_width,
1703 : eCSSProperty_border_left_width_value,
1704 : eCSSProperty_border_left_width_ltr_source,
1705 : eCSSProperty_border_left_width_rtl_source,
1706 : eCSSProperty_border_top_style,
1707 : eCSSProperty_border_right_style_value,
1708 : eCSSProperty_border_right_style_ltr_source,
1709 : eCSSProperty_border_right_style_rtl_source,
1710 : eCSSProperty_border_bottom_style,
1711 : eCSSProperty_border_left_style_value,
1712 : eCSSProperty_border_left_style_ltr_source,
1713 : eCSSProperty_border_left_style_rtl_source,
1714 : eCSSProperty_border_top_color,
1715 : eCSSProperty_border_right_color_value,
1716 : eCSSProperty_border_right_color_ltr_source,
1717 : eCSSProperty_border_right_color_rtl_source,
1718 : eCSSProperty_border_bottom_color,
1719 : eCSSProperty_border_left_color_value,
1720 : eCSSProperty_border_left_color_ltr_source,
1721 : eCSSProperty_border_left_color_rtl_source,
1722 : eCSSProperty_border_top_colors,
1723 : eCSSProperty_border_right_colors,
1724 : eCSSProperty_border_bottom_colors,
1725 : eCSSProperty_border_left_colors,
1726 : eCSSProperty_border_image_source,
1727 : eCSSProperty_border_image_slice,
1728 : eCSSProperty_border_image_width,
1729 : eCSSProperty_border_image_outset,
1730 : eCSSProperty_border_image_repeat,
1731 : eCSSProperty_UNKNOWN
1732 : };
1733 :
1734 : static const nsCSSProperty gBorderBottomSubpropTable[] = {
1735 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1736 : // It also depends on the color being third.
1737 : eCSSProperty_border_bottom_width,
1738 : eCSSProperty_border_bottom_style,
1739 : eCSSProperty_border_bottom_color,
1740 : eCSSProperty_UNKNOWN
1741 : };
1742 :
1743 : MOZ_STATIC_ASSERT(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
1744 : NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
1745 : "box side constants not top/right/bottom/left == 0/1/2/3");
1746 : static const nsCSSProperty gBorderColorSubpropTable[] = {
1747 : // Code relies on these being in top-right-bottom-left order.
1748 : // Code relies on these matching the NS_SIDE_* constants.
1749 : eCSSProperty_border_top_color,
1750 : eCSSProperty_border_right_color_value,
1751 : eCSSProperty_border_bottom_color,
1752 : eCSSProperty_border_left_color_value,
1753 : // extras:
1754 : eCSSProperty_border_left_color_ltr_source,
1755 : eCSSProperty_border_left_color_rtl_source,
1756 : eCSSProperty_border_right_color_ltr_source,
1757 : eCSSProperty_border_right_color_rtl_source,
1758 : eCSSProperty_UNKNOWN
1759 : };
1760 :
1761 : static const nsCSSProperty gBorderEndColorSubpropTable[] = {
1762 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1763 : eCSSProperty_border_end_color_value,
1764 : eCSSProperty_border_right_color_ltr_source,
1765 : eCSSProperty_border_left_color_rtl_source,
1766 : eCSSProperty_UNKNOWN
1767 : };
1768 :
1769 : static const nsCSSProperty gBorderLeftColorSubpropTable[] = {
1770 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1771 : eCSSProperty_border_left_color_value,
1772 : eCSSProperty_border_left_color_ltr_source,
1773 : eCSSProperty_border_left_color_rtl_source,
1774 : eCSSProperty_UNKNOWN
1775 : };
1776 :
1777 : static const nsCSSProperty gBorderRightColorSubpropTable[] = {
1778 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1779 : eCSSProperty_border_right_color_value,
1780 : eCSSProperty_border_right_color_ltr_source,
1781 : eCSSProperty_border_right_color_rtl_source,
1782 : eCSSProperty_UNKNOWN
1783 : };
1784 :
1785 : static const nsCSSProperty gBorderStartColorSubpropTable[] = {
1786 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1787 : eCSSProperty_border_start_color_value,
1788 : eCSSProperty_border_left_color_ltr_source,
1789 : eCSSProperty_border_right_color_rtl_source,
1790 : eCSSProperty_UNKNOWN
1791 : };
1792 :
1793 : static const nsCSSProperty gBorderEndSubpropTable[] = {
1794 : // nsCSSDeclaration.cpp output the subproperties in this order.
1795 : // It also depends on the color being third.
1796 : eCSSProperty_border_end_width_value,
1797 : eCSSProperty_border_end_style_value,
1798 : eCSSProperty_border_end_color_value,
1799 : // extras:
1800 : eCSSProperty_border_right_width_ltr_source,
1801 : eCSSProperty_border_left_width_rtl_source,
1802 : eCSSProperty_border_right_style_ltr_source,
1803 : eCSSProperty_border_left_style_rtl_source,
1804 : eCSSProperty_border_right_color_ltr_source,
1805 : eCSSProperty_border_left_color_rtl_source,
1806 : eCSSProperty_UNKNOWN
1807 : };
1808 :
1809 : static const nsCSSProperty gBorderLeftSubpropTable[] = {
1810 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1811 : // It also depends on the color being third.
1812 : eCSSProperty_border_left_width_value,
1813 : eCSSProperty_border_left_style_value,
1814 : eCSSProperty_border_left_color_value,
1815 : // extras:
1816 : eCSSProperty_border_left_width_ltr_source,
1817 : eCSSProperty_border_left_width_rtl_source,
1818 : eCSSProperty_border_left_style_ltr_source,
1819 : eCSSProperty_border_left_style_rtl_source,
1820 : eCSSProperty_border_left_color_ltr_source,
1821 : eCSSProperty_border_left_color_rtl_source,
1822 : eCSSProperty_UNKNOWN
1823 : };
1824 :
1825 : static const nsCSSProperty gBorderRightSubpropTable[] = {
1826 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1827 : // It also depends on the color being third.
1828 : eCSSProperty_border_right_width_value,
1829 : eCSSProperty_border_right_style_value,
1830 : eCSSProperty_border_right_color_value,
1831 : // extras:
1832 : eCSSProperty_border_right_width_ltr_source,
1833 : eCSSProperty_border_right_width_rtl_source,
1834 : eCSSProperty_border_right_style_ltr_source,
1835 : eCSSProperty_border_right_style_rtl_source,
1836 : eCSSProperty_border_right_color_ltr_source,
1837 : eCSSProperty_border_right_color_rtl_source,
1838 : eCSSProperty_UNKNOWN
1839 : };
1840 :
1841 : static const nsCSSProperty gBorderStartSubpropTable[] = {
1842 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1843 : // It also depends on the color being third.
1844 : eCSSProperty_border_start_width_value,
1845 : eCSSProperty_border_start_style_value,
1846 : eCSSProperty_border_start_color_value,
1847 : // extras:
1848 : eCSSProperty_border_left_width_ltr_source,
1849 : eCSSProperty_border_right_width_rtl_source,
1850 : eCSSProperty_border_left_style_ltr_source,
1851 : eCSSProperty_border_right_style_rtl_source,
1852 : eCSSProperty_border_left_color_ltr_source,
1853 : eCSSProperty_border_right_color_rtl_source,
1854 : eCSSProperty_UNKNOWN
1855 : };
1856 :
1857 : static const nsCSSProperty gBorderStyleSubpropTable[] = {
1858 : // Code relies on these being in top-right-bottom-left order.
1859 : eCSSProperty_border_top_style,
1860 : eCSSProperty_border_right_style_value,
1861 : eCSSProperty_border_bottom_style,
1862 : eCSSProperty_border_left_style_value,
1863 : // extras:
1864 : eCSSProperty_border_left_style_ltr_source,
1865 : eCSSProperty_border_left_style_rtl_source,
1866 : eCSSProperty_border_right_style_ltr_source,
1867 : eCSSProperty_border_right_style_rtl_source,
1868 : eCSSProperty_UNKNOWN
1869 : };
1870 :
1871 : static const nsCSSProperty gBorderLeftStyleSubpropTable[] = {
1872 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1873 : eCSSProperty_border_left_style_value,
1874 : eCSSProperty_border_left_style_ltr_source,
1875 : eCSSProperty_border_left_style_rtl_source,
1876 : eCSSProperty_UNKNOWN
1877 : };
1878 :
1879 : static const nsCSSProperty gBorderRightStyleSubpropTable[] = {
1880 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1881 : eCSSProperty_border_right_style_value,
1882 : eCSSProperty_border_right_style_ltr_source,
1883 : eCSSProperty_border_right_style_rtl_source,
1884 : eCSSProperty_UNKNOWN
1885 : };
1886 :
1887 : static const nsCSSProperty gBorderStartStyleSubpropTable[] = {
1888 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1889 : eCSSProperty_border_start_style_value,
1890 : eCSSProperty_border_left_style_ltr_source,
1891 : eCSSProperty_border_right_style_rtl_source,
1892 : eCSSProperty_UNKNOWN
1893 : };
1894 :
1895 : static const nsCSSProperty gBorderEndStyleSubpropTable[] = {
1896 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1897 : eCSSProperty_border_end_style_value,
1898 : eCSSProperty_border_right_style_ltr_source,
1899 : eCSSProperty_border_left_style_rtl_source,
1900 : eCSSProperty_UNKNOWN
1901 : };
1902 :
1903 : static const nsCSSProperty gBorderTopSubpropTable[] = {
1904 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1905 : // It also depends on the color being third.
1906 : eCSSProperty_border_top_width,
1907 : eCSSProperty_border_top_style,
1908 : eCSSProperty_border_top_color,
1909 : eCSSProperty_UNKNOWN
1910 : };
1911 :
1912 : static const nsCSSProperty gBorderWidthSubpropTable[] = {
1913 : // Code relies on these being in top-right-bottom-left order.
1914 : eCSSProperty_border_top_width,
1915 : eCSSProperty_border_right_width_value,
1916 : eCSSProperty_border_bottom_width,
1917 : eCSSProperty_border_left_width_value,
1918 : // extras:
1919 : eCSSProperty_border_left_width_ltr_source,
1920 : eCSSProperty_border_left_width_rtl_source,
1921 : eCSSProperty_border_right_width_ltr_source,
1922 : eCSSProperty_border_right_width_rtl_source,
1923 : eCSSProperty_UNKNOWN
1924 : };
1925 :
1926 : static const nsCSSProperty gBorderLeftWidthSubpropTable[] = {
1927 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1928 : eCSSProperty_border_left_width_value,
1929 : eCSSProperty_border_left_width_ltr_source,
1930 : eCSSProperty_border_left_width_rtl_source,
1931 : eCSSProperty_UNKNOWN
1932 : };
1933 :
1934 : static const nsCSSProperty gBorderRightWidthSubpropTable[] = {
1935 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1936 : eCSSProperty_border_right_width_value,
1937 : eCSSProperty_border_right_width_ltr_source,
1938 : eCSSProperty_border_right_width_rtl_source,
1939 : eCSSProperty_UNKNOWN
1940 : };
1941 :
1942 : static const nsCSSProperty gBorderStartWidthSubpropTable[] = {
1943 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1944 : eCSSProperty_border_start_width_value,
1945 : eCSSProperty_border_left_width_ltr_source,
1946 : eCSSProperty_border_right_width_rtl_source,
1947 : eCSSProperty_UNKNOWN
1948 : };
1949 :
1950 : static const nsCSSProperty gBorderEndWidthSubpropTable[] = {
1951 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1952 : eCSSProperty_border_end_width_value,
1953 : eCSSProperty_border_right_width_ltr_source,
1954 : eCSSProperty_border_left_width_rtl_source,
1955 : eCSSProperty_UNKNOWN
1956 : };
1957 :
1958 : static const nsCSSProperty gFontSubpropTable[] = {
1959 : eCSSProperty_font_family,
1960 : eCSSProperty_font_style,
1961 : eCSSProperty_font_variant,
1962 : eCSSProperty_font_weight,
1963 : eCSSProperty_font_size,
1964 : eCSSProperty_line_height,
1965 : eCSSProperty_font_size_adjust, // XXX Added LDB.
1966 : eCSSProperty_font_stretch, // XXX Added LDB.
1967 : eCSSProperty__x_system_font,
1968 : eCSSProperty_font_feature_settings,
1969 : eCSSProperty_font_language_override,
1970 : eCSSProperty_UNKNOWN
1971 : };
1972 :
1973 : static const nsCSSProperty gListStyleSubpropTable[] = {
1974 : eCSSProperty_list_style_type,
1975 : eCSSProperty_list_style_image,
1976 : eCSSProperty_list_style_position,
1977 : eCSSProperty_UNKNOWN
1978 : };
1979 :
1980 : static const nsCSSProperty gMarginSubpropTable[] = {
1981 : // Code relies on these being in top-right-bottom-left order.
1982 : eCSSProperty_margin_top,
1983 : eCSSProperty_margin_right_value,
1984 : eCSSProperty_margin_bottom,
1985 : eCSSProperty_margin_left_value,
1986 : // extras:
1987 : eCSSProperty_margin_left_ltr_source,
1988 : eCSSProperty_margin_left_rtl_source,
1989 : eCSSProperty_margin_right_ltr_source,
1990 : eCSSProperty_margin_right_rtl_source,
1991 : eCSSProperty_UNKNOWN
1992 : };
1993 :
1994 : static const nsCSSProperty gMarginLeftSubpropTable[] = {
1995 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1996 : eCSSProperty_margin_left_value,
1997 : eCSSProperty_margin_left_ltr_source,
1998 : eCSSProperty_margin_left_rtl_source,
1999 : eCSSProperty_UNKNOWN
2000 : };
2001 :
2002 : static const nsCSSProperty gMarginRightSubpropTable[] = {
2003 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2004 : eCSSProperty_margin_right_value,
2005 : eCSSProperty_margin_right_ltr_source,
2006 : eCSSProperty_margin_right_rtl_source,
2007 : eCSSProperty_UNKNOWN
2008 : };
2009 :
2010 : static const nsCSSProperty gMarginStartSubpropTable[] = {
2011 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2012 : eCSSProperty_margin_start_value,
2013 : eCSSProperty_margin_left_ltr_source,
2014 : eCSSProperty_margin_right_rtl_source,
2015 : eCSSProperty_UNKNOWN
2016 : };
2017 :
2018 : static const nsCSSProperty gMarginEndSubpropTable[] = {
2019 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2020 : eCSSProperty_margin_end_value,
2021 : eCSSProperty_margin_right_ltr_source,
2022 : eCSSProperty_margin_left_rtl_source,
2023 : eCSSProperty_UNKNOWN
2024 : };
2025 :
2026 :
2027 : static const nsCSSProperty gOutlineSubpropTable[] = {
2028 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
2029 : // It also depends on the color being third.
2030 : eCSSProperty_outline_width,
2031 : eCSSProperty_outline_style,
2032 : eCSSProperty_outline_color,
2033 : eCSSProperty_UNKNOWN
2034 : };
2035 :
2036 : static const nsCSSProperty gColumnsSubpropTable[] = {
2037 : eCSSProperty__moz_column_count,
2038 : eCSSProperty__moz_column_width,
2039 : eCSSProperty_UNKNOWN
2040 : };
2041 :
2042 : static const nsCSSProperty gColumnRuleSubpropTable[] = {
2043 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
2044 : // It also depends on the color being third.
2045 : eCSSProperty__moz_column_rule_width,
2046 : eCSSProperty__moz_column_rule_style,
2047 : eCSSProperty__moz_column_rule_color,
2048 : eCSSProperty_UNKNOWN
2049 : };
2050 :
2051 : static const nsCSSProperty gOverflowSubpropTable[] = {
2052 : eCSSProperty_overflow_x,
2053 : eCSSProperty_overflow_y,
2054 : eCSSProperty_UNKNOWN
2055 : };
2056 :
2057 : static const nsCSSProperty gPaddingSubpropTable[] = {
2058 : // Code relies on these being in top-right-bottom-left order.
2059 : eCSSProperty_padding_top,
2060 : eCSSProperty_padding_right_value,
2061 : eCSSProperty_padding_bottom,
2062 : eCSSProperty_padding_left_value,
2063 : // extras:
2064 : eCSSProperty_padding_left_ltr_source,
2065 : eCSSProperty_padding_left_rtl_source,
2066 : eCSSProperty_padding_right_ltr_source,
2067 : eCSSProperty_padding_right_rtl_source,
2068 : eCSSProperty_UNKNOWN
2069 : };
2070 :
2071 : static const nsCSSProperty gPaddingLeftSubpropTable[] = {
2072 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2073 : eCSSProperty_padding_left_value,
2074 : eCSSProperty_padding_left_ltr_source,
2075 : eCSSProperty_padding_left_rtl_source,
2076 : eCSSProperty_UNKNOWN
2077 : };
2078 :
2079 : static const nsCSSProperty gPaddingRightSubpropTable[] = {
2080 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2081 : eCSSProperty_padding_right_value,
2082 : eCSSProperty_padding_right_ltr_source,
2083 : eCSSProperty_padding_right_rtl_source,
2084 : eCSSProperty_UNKNOWN
2085 : };
2086 :
2087 : static const nsCSSProperty gPaddingStartSubpropTable[] = {
2088 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2089 : eCSSProperty_padding_start_value,
2090 : eCSSProperty_padding_left_ltr_source,
2091 : eCSSProperty_padding_right_rtl_source,
2092 : eCSSProperty_UNKNOWN
2093 : };
2094 :
2095 : static const nsCSSProperty gPaddingEndSubpropTable[] = {
2096 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2097 : eCSSProperty_padding_end_value,
2098 : eCSSProperty_padding_right_ltr_source,
2099 : eCSSProperty_padding_left_rtl_source,
2100 : eCSSProperty_UNKNOWN
2101 : };
2102 :
2103 : static const nsCSSProperty gTextDecorationSubpropTable[] = {
2104 : eCSSProperty_text_blink,
2105 : eCSSProperty_text_decoration_color,
2106 : eCSSProperty_text_decoration_line,
2107 : eCSSProperty_text_decoration_style,
2108 : eCSSProperty_UNKNOWN
2109 : };
2110 :
2111 : static const nsCSSProperty gTransitionSubpropTable[] = {
2112 : eCSSProperty_transition_property,
2113 : eCSSProperty_transition_duration,
2114 : eCSSProperty_transition_timing_function,
2115 : eCSSProperty_transition_delay,
2116 : eCSSProperty_UNKNOWN
2117 : };
2118 :
2119 : static const nsCSSProperty gBorderImageSubpropTable[] = {
2120 : eCSSProperty_border_image_source,
2121 : eCSSProperty_border_image_slice,
2122 : eCSSProperty_border_image_width,
2123 : eCSSProperty_border_image_outset,
2124 : eCSSProperty_border_image_repeat,
2125 : eCSSProperty_UNKNOWN
2126 : };
2127 :
2128 : static const nsCSSProperty gMarkerSubpropTable[] = {
2129 : eCSSProperty_marker_start,
2130 : eCSSProperty_marker_mid,
2131 : eCSSProperty_marker_end,
2132 : eCSSProperty_UNKNOWN
2133 : };
2134 :
2135 : const nsCSSProperty *const
2136 : nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = {
2137 : #define CSS_PROP_DOMPROP_PREFIXED(prop_) prop_
2138 : // Need an extra level of macro nesting to force expansion of method_
2139 : // params before they get pasted.
2140 : #define NSCSSPROPS_INNER_MACRO(method_) g##method_##SubpropTable,
2141 : #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) NSCSSPROPS_INNER_MACRO(method_)
2142 : #include "nsCSSPropList.h"
2143 : #undef CSS_PROP_SHORTHAND
2144 : #undef NSCSSPROPS_INNER_MACRO
2145 : #undef CSS_PROP_DOMPROP_PREFIXED
2146 : };
2147 :
2148 :
2149 : #define ENUM_DATA_FOR_PROPERTY(name_, id_, method_, flags_, parsevariant_, \
2150 : kwtable_, stylestructoffset_, animtype_) \
2151 : ePropertyIndex_for_##id_,
2152 :
2153 : // The order of these enums must match the g*Flags arrays in nsRuleNode.cpp.
2154 :
2155 : enum FontCheckCounter {
2156 : #define CSS_PROP_FONT ENUM_DATA_FOR_PROPERTY
2157 : #include "nsCSSPropList.h"
2158 : #undef CSS_PROP_FONT
2159 : ePropertyCount_for_Font
2160 : };
2161 :
2162 : enum DisplayCheckCounter {
2163 : #define CSS_PROP_DISPLAY ENUM_DATA_FOR_PROPERTY
2164 : #include "nsCSSPropList.h"
2165 : #undef CSS_PROP_DISPLAY
2166 : ePropertyCount_for_Display
2167 : };
2168 :
2169 : enum VisibilityCheckCounter {
2170 : #define CSS_PROP_VISIBILITY ENUM_DATA_FOR_PROPERTY
2171 : #include "nsCSSPropList.h"
2172 : #undef CSS_PROP_VISIBILITY
2173 : ePropertyCount_for_Visibility
2174 : };
2175 :
2176 : enum MarginCheckCounter {
2177 : #define CSS_PROP_MARGIN ENUM_DATA_FOR_PROPERTY
2178 : #include "nsCSSPropList.h"
2179 : #undef CSS_PROP_MARGIN
2180 : ePropertyCount_for_Margin
2181 : };
2182 :
2183 : enum BorderCheckCounter {
2184 : #define CSS_PROP_BORDER ENUM_DATA_FOR_PROPERTY
2185 : #include "nsCSSPropList.h"
2186 : #undef CSS_PROP_BORDER
2187 : ePropertyCount_for_Border
2188 : };
2189 :
2190 : enum PaddingCheckCounter {
2191 : #define CSS_PROP_PADDING ENUM_DATA_FOR_PROPERTY
2192 : #include "nsCSSPropList.h"
2193 : #undef CSS_PROP_PADDING
2194 : ePropertyCount_for_Padding
2195 : };
2196 :
2197 : enum OutlineCheckCounter {
2198 : #define CSS_PROP_OUTLINE ENUM_DATA_FOR_PROPERTY
2199 : #include "nsCSSPropList.h"
2200 : #undef CSS_PROP_OUTLINE
2201 : ePropertyCount_for_Outline
2202 : };
2203 :
2204 : enum ListCheckCounter {
2205 : #define CSS_PROP_LIST ENUM_DATA_FOR_PROPERTY
2206 : #include "nsCSSPropList.h"
2207 : #undef CSS_PROP_LIST
2208 : ePropertyCount_for_List
2209 : };
2210 :
2211 : enum ColorCheckCounter {
2212 : #define CSS_PROP_COLOR ENUM_DATA_FOR_PROPERTY
2213 : #include "nsCSSPropList.h"
2214 : #undef CSS_PROP_COLOR
2215 : ePropertyCount_for_Color
2216 : };
2217 :
2218 : enum BackgroundCheckCounter {
2219 : #define CSS_PROP_BACKGROUND ENUM_DATA_FOR_PROPERTY
2220 : #include "nsCSSPropList.h"
2221 : #undef CSS_PROP_BACKGROUND
2222 : ePropertyCount_for_Background
2223 : };
2224 :
2225 : enum PositionCheckCounter {
2226 : #define CSS_PROP_POSITION ENUM_DATA_FOR_PROPERTY
2227 : #include "nsCSSPropList.h"
2228 : #undef CSS_PROP_POSITION
2229 : ePropertyCount_for_Position
2230 : };
2231 :
2232 : enum TableCheckCounter {
2233 : #define CSS_PROP_TABLE ENUM_DATA_FOR_PROPERTY
2234 : #include "nsCSSPropList.h"
2235 : #undef CSS_PROP_TABLE
2236 : ePropertyCount_for_Table
2237 : };
2238 :
2239 : enum TableBorderCheckCounter {
2240 : #define CSS_PROP_TABLEBORDER ENUM_DATA_FOR_PROPERTY
2241 : #include "nsCSSPropList.h"
2242 : #undef CSS_PROP_TABLEBORDER
2243 : ePropertyCount_for_TableBorder
2244 : };
2245 :
2246 : enum ContentCheckCounter {
2247 : #define CSS_PROP_CONTENT ENUM_DATA_FOR_PROPERTY
2248 : #include "nsCSSPropList.h"
2249 : #undef CSS_PROP_CONTENT
2250 : ePropertyCount_for_Content
2251 : };
2252 :
2253 : enum QuotesCheckCounter {
2254 : #define CSS_PROP_QUOTES ENUM_DATA_FOR_PROPERTY
2255 : #include "nsCSSPropList.h"
2256 : #undef CSS_PROP_QUOTES
2257 : ePropertyCount_for_Quotes
2258 : };
2259 :
2260 : enum TextCheckCounter {
2261 : #define CSS_PROP_TEXT ENUM_DATA_FOR_PROPERTY
2262 : #include "nsCSSPropList.h"
2263 : #undef CSS_PROP_TEXT
2264 : ePropertyCount_for_Text
2265 : };
2266 :
2267 : enum TextResetCheckCounter {
2268 : #define CSS_PROP_TEXTRESET ENUM_DATA_FOR_PROPERTY
2269 : #include "nsCSSPropList.h"
2270 : #undef CSS_PROP_TEXTRESET
2271 : ePropertyCount_for_TextReset
2272 : };
2273 :
2274 : enum UserInterfaceCheckCounter {
2275 : #define CSS_PROP_USERINTERFACE ENUM_DATA_FOR_PROPERTY
2276 : #include "nsCSSPropList.h"
2277 : #undef CSS_PROP_USERINTERFACE
2278 : ePropertyCount_for_UserInterface
2279 : };
2280 :
2281 : enum UIResetCheckCounter {
2282 : #define CSS_PROP_UIRESET ENUM_DATA_FOR_PROPERTY
2283 : #include "nsCSSPropList.h"
2284 : #undef CSS_PROP_UIRESET
2285 : ePropertyCount_for_UIReset
2286 : };
2287 :
2288 : enum XULCheckCounter {
2289 : #define CSS_PROP_XUL ENUM_DATA_FOR_PROPERTY
2290 : #include "nsCSSPropList.h"
2291 : #undef CSS_PROP_XUL
2292 : ePropertyCount_for_XUL
2293 : };
2294 :
2295 : enum SVGCheckCounter {
2296 : #define CSS_PROP_SVG ENUM_DATA_FOR_PROPERTY
2297 : #include "nsCSSPropList.h"
2298 : #undef CSS_PROP_SVG
2299 : ePropertyCount_for_SVG
2300 : };
2301 :
2302 : enum SVGResetCheckCounter {
2303 : #define CSS_PROP_SVGRESET ENUM_DATA_FOR_PROPERTY
2304 : #include "nsCSSPropList.h"
2305 : #undef CSS_PROP_SVGRESET
2306 : ePropertyCount_for_SVGReset
2307 : };
2308 :
2309 : enum ColumnCheckCounter {
2310 : #define CSS_PROP_COLUMN ENUM_DATA_FOR_PROPERTY
2311 : #include "nsCSSPropList.h"
2312 : #undef CSS_PROP_COLUMN
2313 : ePropertyCount_for_Column
2314 : };
2315 :
2316 : #undef ENUM_DATA_FOR_PROPERTY
2317 :
2318 : /* static */ const size_t
2319 : nsCSSProps::gPropertyCountInStruct[nsStyleStructID_Length] = {
2320 : #define STYLE_STRUCT(name, checkdata_cb, ctor_args) \
2321 : ePropertyCount_for_##name,
2322 : #include "nsStyleStructList.h"
2323 : #undef STYLE_STRUCT
2324 : };
2325 :
2326 : /* static */ const size_t
2327 : nsCSSProps::gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands] = {
2328 :
2329 : #define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, parsevariant_, \
2330 : kwtable_) \
2331 : size_t(-1),
2332 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
2333 : stylestruct_, stylestructoffset_, animtype_) \
2334 : ePropertyIndex_for_##id_,
2335 : #include "nsCSSPropList.h"
2336 : #undef CSS_PROP
2337 : #undef CSS_PROP_BACKENDONLY
2338 :
2339 : };
|