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 328536 : SortPropertyAndCount(const void* s1, const void* s2, void *closure)
99 : {
100 328536 : const PropertyAndCount *pc1 = static_cast<const PropertyAndCount*>(s1);
101 328536 : const PropertyAndCount *pc2 = static_cast<const PropertyAndCount*>(s2);
102 : // Primary sort by count (lowest to highest)
103 328536 : if (pc1->count != pc2->count)
104 144612 : return pc1->count - pc2->count;
105 : // Secondary sort by property index (highest to lowest)
106 183924 : return pc2->property - pc1->property;
107 : }
108 :
109 : void
110 1404 : nsCSSProps::AddRefTable(void)
111 : {
112 1404 : if (0 == gTableRefCount++) {
113 1404 : NS_ABORT_IF_FALSE(!gPropertyTable, "pre existing array!");
114 1404 : NS_ABORT_IF_FALSE(!gFontDescTable, "pre existing array!");
115 :
116 1404 : gPropertyTable = new nsStaticCaseInsensitiveNameTable();
117 1404 : if (gPropertyTable) {
118 : #ifdef DEBUG
119 : {
120 : // let's verify the table...
121 393120 : for (PRInt32 index = 0; index < eCSSProperty_COUNT; ++index) {
122 783432 : nsCAutoString temp1(kCSSRawProperties[index]);
123 783432 : nsCAutoString temp2(kCSSRawProperties[index]);
124 391716 : ToLowerCase(temp1);
125 391716 : NS_ABORT_IF_FALSE(temp1.Equals(temp2), "upper case char in prop table");
126 391716 : NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'),
127 : "underscore char in prop table");
128 : }
129 : }
130 : #endif
131 1404 : gPropertyTable->Init(kCSSRawProperties, eCSSProperty_COUNT);
132 : }
133 :
134 1404 : gFontDescTable = new nsStaticCaseInsensitiveNameTable();
135 1404 : if (gFontDescTable) {
136 : #ifdef DEBUG
137 : {
138 : // let's verify the table...
139 12636 : for (PRInt32 index = 0; index < eCSSFontDesc_COUNT; ++index) {
140 22464 : nsCAutoString temp1(kCSSRawFontDescs[index]);
141 22464 : nsCAutoString temp2(kCSSRawFontDescs[index]);
142 11232 : ToLowerCase(temp1);
143 11232 : NS_ABORT_IF_FALSE(temp1.Equals(temp2), "upper case char in desc table");
144 11232 : NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'),
145 : "underscore char in desc table");
146 : }
147 : }
148 : #endif
149 1404 : gFontDescTable->Init(kCSSRawFontDescs, eCSSFontDesc_COUNT);
150 : }
151 :
152 1404 : BuildShorthandsContainingTable();
153 : }
154 1404 : }
155 :
156 : #undef DEBUG_SHORTHANDS_CONTAINING
157 :
158 : bool
159 1404 : nsCSSProps::BuildShorthandsContainingTable()
160 : {
161 : PRUint32 occurrenceCounts[eCSSProperty_COUNT_no_shorthands];
162 1404 : memset(occurrenceCounts, 0, sizeof(occurrenceCounts));
163 : PropertyAndCount subpropCounts[eCSSProperty_COUNT -
164 : eCSSProperty_COUNT_no_shorthands];
165 64584 : 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 63180 : subpropCounts[shorthand - eCSSProperty_COUNT_no_shorthands];
174 63180 : subpropCountsEntry.property = shorthand;
175 63180 : subpropCountsEntry.count = 0;
176 384696 : for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
177 : *subprops != eCSSProperty_UNKNOWN;
178 : ++subprops) {
179 321516 : NS_ABORT_IF_FALSE(0 < *subprops &&
180 : *subprops < eCSSProperty_COUNT_no_shorthands,
181 : "subproperty must be a longhand");
182 321516 : ++occurrenceCounts[*subprops];
183 321516 : ++subpropCountsEntry.count;
184 : }
185 : }
186 :
187 1404 : PRUint32 poolEntries = 0;
188 329940 : for (nsCSSProperty longhand = nsCSSProperty(0);
189 : longhand < eCSSProperty_COUNT_no_shorthands;
190 : longhand = nsCSSProperty(longhand + 1)) {
191 328536 : PRUint32 count = occurrenceCounts[longhand];
192 328536 : if (count > 0)
193 : // leave room for terminator
194 158652 : poolEntries += count + 1;
195 : }
196 :
197 2808 : gShorthandsContainingPool = new nsCSSProperty[poolEntries];
198 1404 : if (!gShorthandsContainingPool)
199 0 : return false;
200 :
201 : // Initialize all entries to point to their null-terminator.
202 : {
203 1404 : nsCSSProperty *poolCursor = gShorthandsContainingPool - 1;
204 : nsCSSProperty *lastTerminator =
205 1404 : gShorthandsContainingPool + poolEntries - 1;
206 329940 : for (nsCSSProperty longhand = nsCSSProperty(0);
207 : longhand < eCSSProperty_COUNT_no_shorthands;
208 : longhand = nsCSSProperty(longhand + 1)) {
209 328536 : PRUint32 count = occurrenceCounts[longhand];
210 328536 : if (count > 0) {
211 158652 : poolCursor += count + 1;
212 158652 : gShorthandsContainingTable[longhand] = poolCursor;
213 158652 : *poolCursor = eCSSProperty_UNKNOWN;
214 : } else {
215 169884 : gShorthandsContainingTable[longhand] = lastTerminator;
216 : }
217 : }
218 1404 : 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 1404 : sizeof(subpropCounts[0]), SortPropertyAndCount, nsnull);
225 :
226 : // Fill in all the entries in gShorthandsContainingTable
227 65988 : for (const PropertyAndCount *shorthandAndCount = subpropCounts,
228 1404 : *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 384696 : for (const nsCSSProperty* subprops =
237 63180 : SubpropertyEntryFor(shorthandAndCount->property);
238 : *subprops != eCSSProperty_UNKNOWN;
239 : ++subprops) {
240 321516 : *(--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 64584 : for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands;
262 : shorthand < eCSSProperty_COUNT;
263 : shorthand = nsCSSProperty(shorthand + 1)) {
264 384696 : for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
265 : *subprops != eCSSProperty_UNKNOWN;
266 : ++subprops) {
267 321516 : PRUint32 count = 0;
268 1395576 : for (const nsCSSProperty *shcont = ShorthandsContaining(*subprops);
269 : *shcont != eCSSProperty_UNKNOWN;
270 : ++shcont) {
271 1074060 : if (*shcont == shorthand)
272 321516 : ++count;
273 : }
274 321516 : 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 329940 : for (nsCSSProperty longhand = nsCSSProperty(0);
282 : longhand < eCSSProperty_COUNT_no_shorthands;
283 : longhand = nsCSSProperty(longhand + 1)) {
284 650052 : for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand);
285 : *shorthands != eCSSProperty_UNKNOWN;
286 : ++shorthands) {
287 321516 : PRUint32 count = 0;
288 3164616 : for (const nsCSSProperty* subprops = SubpropertyEntryFor(*shorthands);
289 : *subprops != eCSSProperty_UNKNOWN;
290 : ++subprops) {
291 2843100 : if (*subprops == longhand)
292 321516 : ++count;
293 : }
294 321516 : 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 1404 : return true;
302 : }
303 :
304 : void
305 1403 : nsCSSProps::ReleaseTable(void)
306 : {
307 1403 : if (0 == --gTableRefCount) {
308 1403 : delete gPropertyTable;
309 1403 : gPropertyTable = nsnull;
310 :
311 1403 : delete gFontDescTable;
312 1403 : gFontDescTable = nsnull;
313 :
314 1403 : delete [] gShorthandsContainingPool;
315 1403 : gShorthandsContainingPool = nsnull;
316 : }
317 1403 : }
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::kBorderImageKTable[] = {
692 : eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_STRETCH,
693 : eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT,
694 : eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_ROUND,
695 : eCSSKeyword_UNKNOWN,-1
696 : };
697 :
698 : const PRInt32 nsCSSProps::kBorderStyleKTable[] = {
699 : eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE,
700 : eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN,
701 : eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
702 : eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
703 : eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
704 : eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
705 : eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
706 : eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
707 : eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
708 : eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
709 : eCSSKeyword_UNKNOWN,-1
710 : };
711 :
712 : const PRInt32 nsCSSProps::kBorderWidthKTable[] = {
713 : eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN,
714 : eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM,
715 : eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK,
716 : eCSSKeyword_UNKNOWN,-1
717 : };
718 :
719 : const PRInt32 nsCSSProps::kBoxPropSourceKTable[] = {
720 : eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL,
721 : eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL,
722 : eCSSKeyword_UNKNOWN,-1
723 : };
724 :
725 : const PRInt32 nsCSSProps::kBoxShadowTypeKTable[] = {
726 : eCSSKeyword_inset, NS_STYLE_BOX_SHADOW_INSET,
727 : eCSSKeyword_UNKNOWN,-1
728 : };
729 :
730 : const PRInt32 nsCSSProps::kBoxSizingKTable[] = {
731 : eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT,
732 : eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER,
733 : eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING,
734 : eCSSKeyword_UNKNOWN,-1
735 : };
736 :
737 : const PRInt32 nsCSSProps::kCaptionSideKTable[] = {
738 : eCSSKeyword_top, NS_STYLE_CAPTION_SIDE_TOP,
739 : eCSSKeyword_right, NS_STYLE_CAPTION_SIDE_RIGHT,
740 : eCSSKeyword_bottom, NS_STYLE_CAPTION_SIDE_BOTTOM,
741 : eCSSKeyword_left, NS_STYLE_CAPTION_SIDE_LEFT,
742 : eCSSKeyword_top_outside, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE,
743 : eCSSKeyword_bottom_outside, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
744 : eCSSKeyword_UNKNOWN, -1
745 : };
746 :
747 : const PRInt32 nsCSSProps::kClearKTable[] = {
748 : eCSSKeyword_none, NS_STYLE_CLEAR_NONE,
749 : eCSSKeyword_left, NS_STYLE_CLEAR_LEFT,
750 : eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT,
751 : eCSSKeyword_both, NS_STYLE_CLEAR_LEFT_AND_RIGHT,
752 : eCSSKeyword_UNKNOWN,-1
753 : };
754 :
755 : const PRInt32 nsCSSProps::kColorKTable[] = {
756 : eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder,
757 : eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption,
758 : eCSSKeyword_appworkspace, LookAndFeel::eColorID_appworkspace,
759 : eCSSKeyword_background, LookAndFeel::eColorID_background,
760 : eCSSKeyword_buttonface, LookAndFeel::eColorID_buttonface,
761 : eCSSKeyword_buttonhighlight, LookAndFeel::eColorID_buttonhighlight,
762 : eCSSKeyword_buttonshadow, LookAndFeel::eColorID_buttonshadow,
763 : eCSSKeyword_buttontext, LookAndFeel::eColorID_buttontext,
764 : eCSSKeyword_captiontext, LookAndFeel::eColorID_captiontext,
765 : eCSSKeyword_graytext, LookAndFeel::eColorID_graytext,
766 : eCSSKeyword_highlight, LookAndFeel::eColorID_highlight,
767 : eCSSKeyword_highlighttext, LookAndFeel::eColorID_highlighttext,
768 : eCSSKeyword_inactiveborder, LookAndFeel::eColorID_inactiveborder,
769 : eCSSKeyword_inactivecaption, LookAndFeel::eColorID_inactivecaption,
770 : eCSSKeyword_inactivecaptiontext, LookAndFeel::eColorID_inactivecaptiontext,
771 : eCSSKeyword_infobackground, LookAndFeel::eColorID_infobackground,
772 : eCSSKeyword_infotext, LookAndFeel::eColorID_infotext,
773 : eCSSKeyword_menu, LookAndFeel::eColorID_menu,
774 : eCSSKeyword_menutext, LookAndFeel::eColorID_menutext,
775 : eCSSKeyword_scrollbar, LookAndFeel::eColorID_scrollbar,
776 : eCSSKeyword_threeddarkshadow, LookAndFeel::eColorID_threeddarkshadow,
777 : eCSSKeyword_threedface, LookAndFeel::eColorID_threedface,
778 : eCSSKeyword_threedhighlight, LookAndFeel::eColorID_threedhighlight,
779 : eCSSKeyword_threedlightshadow, LookAndFeel::eColorID_threedlightshadow,
780 : eCSSKeyword_threedshadow, LookAndFeel::eColorID_threedshadow,
781 : eCSSKeyword_window, LookAndFeel::eColorID_window,
782 : eCSSKeyword_windowframe, LookAndFeel::eColorID_windowframe,
783 : eCSSKeyword_windowtext, LookAndFeel::eColorID_windowtext,
784 : eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT,
785 : eCSSKeyword__moz_buttondefault, LookAndFeel::eColorID__moz_buttondefault,
786 : eCSSKeyword__moz_buttonhoverface, LookAndFeel::eColorID__moz_buttonhoverface,
787 : eCSSKeyword__moz_buttonhovertext, LookAndFeel::eColorID__moz_buttonhovertext,
788 : eCSSKeyword__moz_cellhighlight, LookAndFeel::eColorID__moz_cellhighlight,
789 : eCSSKeyword__moz_cellhighlighttext, LookAndFeel::eColorID__moz_cellhighlighttext,
790 : eCSSKeyword__moz_eventreerow, LookAndFeel::eColorID__moz_eventreerow,
791 : eCSSKeyword__moz_field, LookAndFeel::eColorID__moz_field,
792 : eCSSKeyword__moz_fieldtext, LookAndFeel::eColorID__moz_fieldtext,
793 : eCSSKeyword__moz_default_background_color, NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR,
794 : eCSSKeyword__moz_default_color, NS_COLOR_MOZ_DEFAULT_COLOR,
795 : eCSSKeyword__moz_dialog, LookAndFeel::eColorID__moz_dialog,
796 : eCSSKeyword__moz_dialogtext, LookAndFeel::eColorID__moz_dialogtext,
797 : eCSSKeyword__moz_dragtargetzone, LookAndFeel::eColorID__moz_dragtargetzone,
798 : eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT,
799 : eCSSKeyword__moz_html_cellhighlight, LookAndFeel::eColorID__moz_html_cellhighlight,
800 : eCSSKeyword__moz_html_cellhighlighttext, LookAndFeel::eColorID__moz_html_cellhighlighttext,
801 : eCSSKeyword__moz_mac_chrome_active, LookAndFeel::eColorID__moz_mac_chrome_active,
802 : eCSSKeyword__moz_mac_chrome_inactive, LookAndFeel::eColorID__moz_mac_chrome_inactive,
803 : eCSSKeyword__moz_mac_focusring, LookAndFeel::eColorID__moz_mac_focusring,
804 : eCSSKeyword__moz_mac_menuselect, LookAndFeel::eColorID__moz_mac_menuselect,
805 : eCSSKeyword__moz_mac_menushadow, LookAndFeel::eColorID__moz_mac_menushadow,
806 : eCSSKeyword__moz_mac_menutextdisable, LookAndFeel::eColorID__moz_mac_menutextdisable,
807 : eCSSKeyword__moz_mac_menutextselect, LookAndFeel::eColorID__moz_mac_menutextselect,
808 : eCSSKeyword__moz_mac_disabledtoolbartext, LookAndFeel::eColorID__moz_mac_disabledtoolbartext,
809 : eCSSKeyword__moz_mac_alternateprimaryhighlight, LookAndFeel::eColorID__moz_mac_alternateprimaryhighlight,
810 : eCSSKeyword__moz_mac_secondaryhighlight, LookAndFeel::eColorID__moz_mac_secondaryhighlight,
811 : eCSSKeyword__moz_menuhover, LookAndFeel::eColorID__moz_menuhover,
812 : eCSSKeyword__moz_menuhovertext, LookAndFeel::eColorID__moz_menuhovertext,
813 : eCSSKeyword__moz_menubartext, LookAndFeel::eColorID__moz_menubartext,
814 : eCSSKeyword__moz_menubarhovertext, LookAndFeel::eColorID__moz_menubarhovertext,
815 : eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow,
816 : eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT,
817 : eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR,
818 : eCSSKeyword__moz_win_mediatext, LookAndFeel::eColorID__moz_win_mediatext,
819 : eCSSKeyword__moz_win_communicationstext, LookAndFeel::eColorID__moz_win_communicationstext,
820 : eCSSKeyword__moz_nativehyperlinktext, LookAndFeel::eColorID__moz_nativehyperlinktext,
821 : eCSSKeyword__moz_comboboxtext, LookAndFeel::eColorID__moz_comboboxtext,
822 : eCSSKeyword__moz_combobox, LookAndFeel::eColorID__moz_combobox,
823 : eCSSKeyword_UNKNOWN,-1
824 : };
825 :
826 : const PRInt32 nsCSSProps::kContentKTable[] = {
827 : eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE,
828 : eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE,
829 : eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE,
830 : eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE,
831 : eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT,
832 : eCSSKeyword_UNKNOWN,-1
833 : };
834 :
835 : const PRInt32 nsCSSProps::kCursorKTable[] = {
836 : // CSS 2.0
837 : eCSSKeyword_auto, NS_STYLE_CURSOR_AUTO,
838 : eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR,
839 : eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT,
840 : eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER,
841 : eCSSKeyword_move, NS_STYLE_CURSOR_MOVE,
842 : eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE,
843 : eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE,
844 : eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE,
845 : eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE,
846 : eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE,
847 : eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE,
848 : eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE,
849 : eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE,
850 : eCSSKeyword_text, NS_STYLE_CURSOR_TEXT,
851 : eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT,
852 : eCSSKeyword_help, NS_STYLE_CURSOR_HELP,
853 : // CSS 2.1
854 : eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING,
855 : // CSS3 basic user interface module
856 : eCSSKeyword_copy, NS_STYLE_CURSOR_COPY,
857 : eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS,
858 : eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU,
859 : eCSSKeyword_cell, NS_STYLE_CURSOR_CELL,
860 : eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED,
861 : eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE,
862 : eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE,
863 : eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP,
864 : eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT,
865 : eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL,
866 : eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE,
867 : eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE,
868 : eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE,
869 : eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE,
870 : eCSSKeyword_none, NS_STYLE_CURSOR_NONE,
871 : // -moz- prefixed vendor specific
872 : eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB,
873 : eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING,
874 : eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_MOZ_ZOOM_IN,
875 : eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_MOZ_ZOOM_OUT,
876 : eCSSKeyword_UNKNOWN,-1
877 : };
878 :
879 : const PRInt32 nsCSSProps::kDirectionKTable[] = {
880 : eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR,
881 : eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL,
882 : eCSSKeyword_UNKNOWN,-1
883 : };
884 :
885 : const PRInt32 nsCSSProps::kDisplayKTable[] = {
886 : eCSSKeyword_none, NS_STYLE_DISPLAY_NONE,
887 : eCSSKeyword_inline, NS_STYLE_DISPLAY_INLINE,
888 : eCSSKeyword_block, NS_STYLE_DISPLAY_BLOCK,
889 : eCSSKeyword_inline_block, NS_STYLE_DISPLAY_INLINE_BLOCK,
890 : eCSSKeyword_list_item, NS_STYLE_DISPLAY_LIST_ITEM,
891 : eCSSKeyword_table, NS_STYLE_DISPLAY_TABLE,
892 : eCSSKeyword_inline_table, NS_STYLE_DISPLAY_INLINE_TABLE,
893 : eCSSKeyword_table_row_group, NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
894 : eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
895 : eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
896 : eCSSKeyword_table_row, NS_STYLE_DISPLAY_TABLE_ROW,
897 : eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
898 : eCSSKeyword_table_column, NS_STYLE_DISPLAY_TABLE_COLUMN,
899 : eCSSKeyword_table_cell, NS_STYLE_DISPLAY_TABLE_CELL,
900 : eCSSKeyword_table_caption, NS_STYLE_DISPLAY_TABLE_CAPTION,
901 : // Make sure this is kept in sync with the code in
902 : // nsCSSFrameConstructor::ConstructXULFrame
903 : eCSSKeyword__moz_box, NS_STYLE_DISPLAY_BOX,
904 : eCSSKeyword__moz_inline_box, NS_STYLE_DISPLAY_INLINE_BOX,
905 : #ifdef MOZ_XUL
906 : eCSSKeyword__moz_grid, NS_STYLE_DISPLAY_GRID,
907 : eCSSKeyword__moz_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID,
908 : eCSSKeyword__moz_grid_group, NS_STYLE_DISPLAY_GRID_GROUP,
909 : eCSSKeyword__moz_grid_line, NS_STYLE_DISPLAY_GRID_LINE,
910 : eCSSKeyword__moz_stack, NS_STYLE_DISPLAY_STACK,
911 : eCSSKeyword__moz_inline_stack, NS_STYLE_DISPLAY_INLINE_STACK,
912 : eCSSKeyword__moz_deck, NS_STYLE_DISPLAY_DECK,
913 : eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP,
914 : eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX,
915 : #endif
916 : eCSSKeyword_UNKNOWN,-1
917 : };
918 :
919 : const PRInt32 nsCSSProps::kEmptyCellsKTable[] = {
920 : eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW,
921 : eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE,
922 : eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND,
923 : eCSSKeyword_UNKNOWN,-1
924 : };
925 :
926 : const PRInt32 nsCSSProps::kFloatKTable[] = {
927 : eCSSKeyword_none, NS_STYLE_FLOAT_NONE,
928 : eCSSKeyword_left, NS_STYLE_FLOAT_LEFT,
929 : eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
930 : eCSSKeyword_UNKNOWN,-1
931 : };
932 :
933 : const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
934 : eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT,
935 : eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN,
936 : eCSSKeyword_UNKNOWN,-1
937 : };
938 :
939 : const PRInt32 nsCSSProps::kFontKTable[] = {
940 : // CSS2.
941 : eCSSKeyword_caption, NS_STYLE_FONT_CAPTION,
942 : eCSSKeyword_icon, NS_STYLE_FONT_ICON,
943 : eCSSKeyword_menu, NS_STYLE_FONT_MENU,
944 : eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX,
945 : eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION,
946 : eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR,
947 :
948 : // Proposed for CSS3.
949 : eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW,
950 : eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT,
951 : eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE,
952 : eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP,
953 : eCSSKeyword__moz_info, NS_STYLE_FONT_INFO,
954 : eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG,
955 : eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON,
956 : eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU,
957 : eCSSKeyword__moz_list, NS_STYLE_FONT_LIST,
958 : eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD,
959 : eCSSKeyword_UNKNOWN,-1
960 : };
961 :
962 : const PRInt32 nsCSSProps::kFontSizeKTable[] = {
963 : eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL,
964 : eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL,
965 : eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL,
966 : eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM,
967 : eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE,
968 : eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE,
969 : eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
970 : eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
971 : eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
972 : eCSSKeyword_UNKNOWN,-1
973 : };
974 :
975 : const PRInt32 nsCSSProps::kFontStretchKTable[] = {
976 : eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED,
977 : eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED,
978 : eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED,
979 : eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED,
980 : eCSSKeyword_normal, NS_STYLE_FONT_STRETCH_NORMAL,
981 : eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED,
982 : eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
983 : eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED,
984 : eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED,
985 : eCSSKeyword_UNKNOWN,-1
986 : };
987 :
988 : const PRInt32 nsCSSProps::kFontStyleKTable[] = {
989 : eCSSKeyword_normal, NS_STYLE_FONT_STYLE_NORMAL,
990 : eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC,
991 : eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE,
992 : eCSSKeyword_UNKNOWN,-1
993 : };
994 :
995 : const PRInt32 nsCSSProps::kFontVariantKTable[] = {
996 : eCSSKeyword_normal, NS_STYLE_FONT_VARIANT_NORMAL,
997 : eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS,
998 : eCSSKeyword_UNKNOWN,-1
999 : };
1000 :
1001 : const PRInt32 nsCSSProps::kFontWeightKTable[] = {
1002 : eCSSKeyword_normal, NS_STYLE_FONT_WEIGHT_NORMAL,
1003 : eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD,
1004 : eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER,
1005 : eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER,
1006 : eCSSKeyword_UNKNOWN,-1
1007 : };
1008 :
1009 : const PRInt32 nsCSSProps::kIMEModeKTable[] = {
1010 : eCSSKeyword_normal, NS_STYLE_IME_MODE_NORMAL,
1011 : eCSSKeyword_auto, NS_STYLE_IME_MODE_AUTO,
1012 : eCSSKeyword_active, NS_STYLE_IME_MODE_ACTIVE,
1013 : eCSSKeyword_disabled, NS_STYLE_IME_MODE_DISABLED,
1014 : eCSSKeyword_inactive, NS_STYLE_IME_MODE_INACTIVE,
1015 : eCSSKeyword_UNKNOWN,-1
1016 : };
1017 :
1018 : const PRInt32 nsCSSProps::kLineHeightKTable[] = {
1019 : // -moz- prefixed, intended for internal use for single-line controls
1020 : eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT,
1021 : eCSSKeyword_UNKNOWN,-1
1022 : };
1023 :
1024 : const PRInt32 nsCSSProps::kListStylePositionKTable[] = {
1025 : eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE,
1026 : eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE,
1027 : eCSSKeyword_UNKNOWN,-1
1028 : };
1029 :
1030 : const PRInt32 nsCSSProps::kListStyleKTable[] = {
1031 : eCSSKeyword_none, NS_STYLE_LIST_STYLE_NONE,
1032 : eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC,
1033 : eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE,
1034 : eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE,
1035 : eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL,
1036 : eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO,
1037 : eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN,
1038 : eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN,
1039 : eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK,
1040 : eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA,
1041 : eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN,
1042 : eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA,
1043 : eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN,
1044 : eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW,
1045 : eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN,
1046 : eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN,
1047 : eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC,
1048 : eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA,
1049 : eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA,
1050 : eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA,
1051 : eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA,
1052 : eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM,
1053 : eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH,
1054 : eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL,
1055 : eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL,
1056 : eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL,
1057 : eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL,
1058 : eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL,
1059 : eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL,
1060 : eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC,
1061 : eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN,
1062 : eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU,
1063 : eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI,
1064 : eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI,
1065 : eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI,
1066 : eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA,
1067 : eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA,
1068 : eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM,
1069 : eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI,
1070 : eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL,
1071 : eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU,
1072 : eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI,
1073 : eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO,
1074 : eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR,
1075 : eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER,
1076 : eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL,
1077 : eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT,
1078 : eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME,
1079 : eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC,
1080 : eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM,
1081 : eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER,
1082 : eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET,
1083 : eCSSKeyword_UNKNOWN,-1
1084 : };
1085 :
1086 : const PRInt32 nsCSSProps::kOrientKTable[] = {
1087 : eCSSKeyword_horizontal, NS_STYLE_ORIENT_HORIZONTAL,
1088 : eCSSKeyword_vertical, NS_STYLE_ORIENT_VERTICAL,
1089 : eCSSKeyword_UNKNOWN, -1
1090 : };
1091 :
1092 : // Same as kBorderStyleKTable except 'hidden'.
1093 : const PRInt32 nsCSSProps::kOutlineStyleKTable[] = {
1094 : eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE,
1095 : eCSSKeyword_auto, NS_STYLE_BORDER_STYLE_AUTO,
1096 : eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED,
1097 : eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED,
1098 : eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID,
1099 : eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE,
1100 : eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE,
1101 : eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE,
1102 : eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET,
1103 : eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET,
1104 : eCSSKeyword_UNKNOWN,-1
1105 : };
1106 :
1107 : const PRInt32 nsCSSProps::kOutlineColorKTable[] = {
1108 : eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR,
1109 : eCSSKeyword_UNKNOWN,-1
1110 : };
1111 :
1112 : const PRInt32 nsCSSProps::kOverflowKTable[] = {
1113 : eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO,
1114 : eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
1115 : eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
1116 : eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
1117 : // Deprecated:
1118 : eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
1119 : eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
1120 : eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
1121 : eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
1122 : eCSSKeyword_UNKNOWN,-1
1123 : };
1124 :
1125 : const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
1126 : eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO,
1127 : eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
1128 : eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
1129 : eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
1130 : // Deprecated:
1131 : eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
1132 : eCSSKeyword_UNKNOWN,-1
1133 : };
1134 :
1135 : const PRInt32 nsCSSProps::kPageBreakKTable[] = {
1136 : eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO,
1137 : eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
1138 : eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
1139 : eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT,
1140 : eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT,
1141 : eCSSKeyword_UNKNOWN,-1
1142 : };
1143 :
1144 : const PRInt32 nsCSSProps::kPageBreakInsideKTable[] = {
1145 : eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO,
1146 : eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
1147 : eCSSKeyword_UNKNOWN,-1
1148 : };
1149 :
1150 : const PRInt32 nsCSSProps::kPageMarksKTable[] = {
1151 : eCSSKeyword_none, NS_STYLE_PAGE_MARKS_NONE,
1152 : eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP,
1153 : eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER,
1154 : eCSSKeyword_UNKNOWN,-1
1155 : };
1156 :
1157 : const PRInt32 nsCSSProps::kPageSizeKTable[] = {
1158 : eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE,
1159 : eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT,
1160 : eCSSKeyword_UNKNOWN,-1
1161 : };
1162 :
1163 : const PRInt32 nsCSSProps::kPointerEventsKTable[] = {
1164 : eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE,
1165 : eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED,
1166 : eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL,
1167 : eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE,
1168 : eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE,
1169 : eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED,
1170 : eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL,
1171 : eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE,
1172 : eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL,
1173 : eCSSKeyword_auto, NS_STYLE_POINTER_EVENTS_AUTO,
1174 : eCSSKeyword_UNKNOWN, -1
1175 : };
1176 :
1177 : const PRInt32 nsCSSProps::kPositionKTable[] = {
1178 : eCSSKeyword_static, NS_STYLE_POSITION_STATIC,
1179 : eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE,
1180 : eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE,
1181 : eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED,
1182 : eCSSKeyword_UNKNOWN,-1
1183 : };
1184 :
1185 : const PRInt32 nsCSSProps::kRadialGradientShapeKTable[] = {
1186 : eCSSKeyword_circle, NS_STYLE_GRADIENT_SHAPE_CIRCULAR,
1187 : eCSSKeyword_ellipse, NS_STYLE_GRADIENT_SHAPE_ELLIPTICAL,
1188 : eCSSKeyword_UNKNOWN,-1
1189 : };
1190 :
1191 : const PRInt32 nsCSSProps::kRadialGradientSizeKTable[] = {
1192 : eCSSKeyword_closest_side, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE,
1193 : eCSSKeyword_closest_corner, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER,
1194 : eCSSKeyword_farthest_side, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE,
1195 : eCSSKeyword_farthest_corner, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER,
1196 : // synonyms
1197 : eCSSKeyword_contain, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE,
1198 : eCSSKeyword_cover, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER,
1199 : eCSSKeyword_UNKNOWN,-1
1200 : };
1201 :
1202 : const PRInt32 nsCSSProps::kResizeKTable[] = {
1203 : eCSSKeyword_none, NS_STYLE_RESIZE_NONE,
1204 : eCSSKeyword_both, NS_STYLE_RESIZE_BOTH,
1205 : eCSSKeyword_horizontal, NS_STYLE_RESIZE_HORIZONTAL,
1206 : eCSSKeyword_vertical, NS_STYLE_RESIZE_VERTICAL,
1207 : eCSSKeyword_UNKNOWN,-1
1208 : };
1209 :
1210 : const PRInt32 nsCSSProps::kStackSizingKTable[] = {
1211 : eCSSKeyword_ignore, NS_STYLE_STACK_SIZING_IGNORE,
1212 : eCSSKeyword_stretch_to_fit, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT,
1213 : eCSSKeyword_UNKNOWN,-1
1214 : };
1215 :
1216 : const PRInt32 nsCSSProps::kTableLayoutKTable[] = {
1217 : eCSSKeyword_auto, NS_STYLE_TABLE_LAYOUT_AUTO,
1218 : eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED,
1219 : eCSSKeyword_UNKNOWN,-1
1220 : };
1221 :
1222 : const PRInt32 nsCSSProps::kTextAlignKTable[] = {
1223 : eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
1224 : eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
1225 : eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
1226 : eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
1227 : eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER,
1228 : eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT,
1229 : eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT,
1230 : eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
1231 : eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END,
1232 : eCSSKeyword_UNKNOWN,-1
1233 : };
1234 :
1235 : const PRInt32 nsCSSProps::kTextAlignLastKTable[] = {
1236 : eCSSKeyword_auto, NS_STYLE_TEXT_ALIGN_AUTO,
1237 : eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT,
1238 : eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT,
1239 : eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER,
1240 : eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY,
1241 : eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
1242 : eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END,
1243 : eCSSKeyword_UNKNOWN,-1
1244 : };
1245 :
1246 : const PRInt32 nsCSSProps::kTextBlinkKTable[] = {
1247 : eCSSKeyword_none, NS_STYLE_TEXT_BLINK_NONE,
1248 : eCSSKeyword_blink, NS_STYLE_TEXT_BLINK_BLINK,
1249 : eCSSKeyword_UNKNOWN,-1
1250 : };
1251 :
1252 : const PRInt32 nsCSSProps::kTextDecorationLineKTable[] = {
1253 : eCSSKeyword_none, NS_STYLE_TEXT_DECORATION_LINE_NONE,
1254 : eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE,
1255 : eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_LINE_OVERLINE,
1256 : eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH,
1257 : eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_LINE_PREF_ANCHORS,
1258 : eCSSKeyword_UNKNOWN,-1
1259 : };
1260 :
1261 : const PRInt32 nsCSSProps::kTextDecorationStyleKTable[] = {
1262 : eCSSKeyword__moz_none, NS_STYLE_TEXT_DECORATION_STYLE_NONE,
1263 : eCSSKeyword_solid, NS_STYLE_TEXT_DECORATION_STYLE_SOLID,
1264 : eCSSKeyword_double, NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE,
1265 : eCSSKeyword_dotted, NS_STYLE_TEXT_DECORATION_STYLE_DOTTED,
1266 : eCSSKeyword_dashed, NS_STYLE_TEXT_DECORATION_STYLE_DASHED,
1267 : eCSSKeyword_wavy, NS_STYLE_TEXT_DECORATION_STYLE_WAVY,
1268 : eCSSKeyword_UNKNOWN,-1
1269 : };
1270 :
1271 : const PRInt32 nsCSSProps::kTextOverflowKTable[] = {
1272 : eCSSKeyword_clip, NS_STYLE_TEXT_OVERFLOW_CLIP,
1273 : eCSSKeyword_ellipsis, NS_STYLE_TEXT_OVERFLOW_ELLIPSIS,
1274 : eCSSKeyword_UNKNOWN, -1
1275 : };
1276 :
1277 : const PRInt32 nsCSSProps::kTextTransformKTable[] = {
1278 : eCSSKeyword_none, NS_STYLE_TEXT_TRANSFORM_NONE,
1279 : eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE,
1280 : eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE,
1281 : eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE,
1282 : eCSSKeyword_UNKNOWN,-1
1283 : };
1284 :
1285 : const PRInt32 nsCSSProps::kTransitionTimingFunctionKTable[] = {
1286 : eCSSKeyword_ease, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE,
1287 : eCSSKeyword_linear, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR,
1288 : eCSSKeyword_ease_in, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN,
1289 : eCSSKeyword_ease_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_OUT,
1290 : eCSSKeyword_ease_in_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT,
1291 : eCSSKeyword_step_start, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START,
1292 : eCSSKeyword_step_end, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END,
1293 : eCSSKeyword_UNKNOWN,-1
1294 : };
1295 :
1296 : const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
1297 : eCSSKeyword_normal, NS_STYLE_UNICODE_BIDI_NORMAL,
1298 : eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
1299 : eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
1300 : eCSSKeyword__moz_isolate, NS_STYLE_UNICODE_BIDI_ISOLATE,
1301 : eCSSKeyword__moz_plaintext, NS_STYLE_UNICODE_BIDI_PLAINTEXT,
1302 : eCSSKeyword_UNKNOWN,-1
1303 : };
1304 :
1305 : const PRInt32 nsCSSProps::kUserFocusKTable[] = {
1306 : eCSSKeyword_none, NS_STYLE_USER_FOCUS_NONE,
1307 : eCSSKeyword_normal, NS_STYLE_USER_FOCUS_NORMAL,
1308 : eCSSKeyword_ignore, NS_STYLE_USER_FOCUS_IGNORE,
1309 : eCSSKeyword_select_all, NS_STYLE_USER_FOCUS_SELECT_ALL,
1310 : eCSSKeyword_select_before, NS_STYLE_USER_FOCUS_SELECT_BEFORE,
1311 : eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER,
1312 : eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME,
1313 : eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU,
1314 : eCSSKeyword_UNKNOWN,-1
1315 : };
1316 :
1317 : const PRInt32 nsCSSProps::kUserInputKTable[] = {
1318 : eCSSKeyword_none, NS_STYLE_USER_INPUT_NONE,
1319 : eCSSKeyword_auto, NS_STYLE_USER_INPUT_AUTO,
1320 : eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED,
1321 : eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED,
1322 : eCSSKeyword_UNKNOWN,-1
1323 : };
1324 :
1325 : const PRInt32 nsCSSProps::kUserModifyKTable[] = {
1326 : eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY,
1327 : eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE,
1328 : eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY,
1329 : eCSSKeyword_UNKNOWN,-1
1330 : };
1331 :
1332 : const PRInt32 nsCSSProps::kUserSelectKTable[] = {
1333 : eCSSKeyword_none, NS_STYLE_USER_SELECT_NONE,
1334 : eCSSKeyword_auto, NS_STYLE_USER_SELECT_AUTO,
1335 : eCSSKeyword_text, NS_STYLE_USER_SELECT_TEXT,
1336 : eCSSKeyword_element, NS_STYLE_USER_SELECT_ELEMENT,
1337 : eCSSKeyword_elements, NS_STYLE_USER_SELECT_ELEMENTS,
1338 : eCSSKeyword_all, NS_STYLE_USER_SELECT_ALL,
1339 : eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE,
1340 : eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE,
1341 : eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL,
1342 : eCSSKeyword__moz_none, NS_STYLE_USER_SELECT_MOZ_NONE,
1343 : eCSSKeyword_UNKNOWN,-1
1344 : };
1345 :
1346 : const PRInt32 nsCSSProps::kVerticalAlignKTable[] = {
1347 : eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE,
1348 : eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB,
1349 : eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER,
1350 : eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP,
1351 : eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP,
1352 : eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE,
1353 : eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE,
1354 : eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM,
1355 : eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM,
1356 : eCSSKeyword_UNKNOWN,-1
1357 : };
1358 :
1359 : const PRInt32 nsCSSProps::kVisibilityKTable[] = {
1360 : eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE,
1361 : eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN,
1362 : eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE,
1363 : eCSSKeyword_UNKNOWN,-1
1364 : };
1365 :
1366 : const PRInt32 nsCSSProps::kWhitespaceKTable[] = {
1367 : eCSSKeyword_normal, NS_STYLE_WHITESPACE_NORMAL,
1368 : eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE,
1369 : eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP,
1370 : eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP,
1371 : eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE,
1372 : eCSSKeyword_UNKNOWN,-1
1373 : };
1374 :
1375 : const PRInt32 nsCSSProps::kWidthKTable[] = {
1376 : eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT,
1377 : eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT,
1378 : eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT,
1379 : eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE,
1380 : eCSSKeyword_UNKNOWN,-1
1381 : };
1382 :
1383 : const PRInt32 nsCSSProps::kWindowShadowKTable[] = {
1384 : eCSSKeyword_none, NS_STYLE_WINDOW_SHADOW_NONE,
1385 : eCSSKeyword_default, NS_STYLE_WINDOW_SHADOW_DEFAULT,
1386 : eCSSKeyword_menu, NS_STYLE_WINDOW_SHADOW_MENU,
1387 : eCSSKeyword_tooltip, NS_STYLE_WINDOW_SHADOW_TOOLTIP,
1388 : eCSSKeyword_sheet, NS_STYLE_WINDOW_SHADOW_SHEET,
1389 : eCSSKeyword_UNKNOWN,-1
1390 : };
1391 :
1392 : const PRInt32 nsCSSProps::kWordwrapKTable[] = {
1393 : eCSSKeyword_normal, NS_STYLE_WORDWRAP_NORMAL,
1394 : eCSSKeyword_break_word, NS_STYLE_WORDWRAP_BREAK_WORD,
1395 : eCSSKeyword_UNKNOWN,-1
1396 : };
1397 :
1398 : const PRInt32 nsCSSProps::kHyphensKTable[] = {
1399 : eCSSKeyword_none, NS_STYLE_HYPHENS_NONE,
1400 : eCSSKeyword_manual, NS_STYLE_HYPHENS_MANUAL,
1401 : eCSSKeyword_auto, NS_STYLE_HYPHENS_AUTO,
1402 : eCSSKeyword_UNKNOWN,-1
1403 : };
1404 :
1405 : // Specific keyword tables for XUL.properties
1406 : const PRInt32 nsCSSProps::kBoxAlignKTable[] = {
1407 : eCSSKeyword_stretch, NS_STYLE_BOX_ALIGN_STRETCH,
1408 : eCSSKeyword_start, NS_STYLE_BOX_ALIGN_START,
1409 : eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER,
1410 : eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE,
1411 : eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END,
1412 : eCSSKeyword_UNKNOWN,-1
1413 : };
1414 :
1415 : const PRInt32 nsCSSProps::kBoxDirectionKTable[] = {
1416 : eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL,
1417 : eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE,
1418 : eCSSKeyword_UNKNOWN,-1
1419 : };
1420 :
1421 : const PRInt32 nsCSSProps::kBoxOrientKTable[] = {
1422 : eCSSKeyword_horizontal, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1423 : eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL,
1424 : eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL,
1425 : eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL,
1426 : eCSSKeyword_UNKNOWN,-1
1427 : };
1428 :
1429 : const PRInt32 nsCSSProps::kBoxPackKTable[] = {
1430 : eCSSKeyword_start, NS_STYLE_BOX_PACK_START,
1431 : eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER,
1432 : eCSSKeyword_end, NS_STYLE_BOX_PACK_END,
1433 : eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY,
1434 : eCSSKeyword_UNKNOWN,-1
1435 : };
1436 :
1437 : // keyword tables for SVG properties
1438 :
1439 : const PRInt32 nsCSSProps::kDominantBaselineKTable[] = {
1440 : eCSSKeyword_auto, NS_STYLE_DOMINANT_BASELINE_AUTO,
1441 : eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT,
1442 : eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE,
1443 : eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE,
1444 : eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC,
1445 : eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING,
1446 : eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC,
1447 : eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL,
1448 : eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL,
1449 : eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE,
1450 : eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE,
1451 : eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE,
1452 : eCSSKeyword_UNKNOWN, -1
1453 : };
1454 :
1455 : const PRInt32 nsCSSProps::kFillRuleKTable[] = {
1456 : eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO,
1457 : eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD,
1458 : eCSSKeyword_UNKNOWN, -1
1459 : };
1460 :
1461 : const PRInt32 nsCSSProps::kImageRenderingKTable[] = {
1462 : eCSSKeyword_auto, NS_STYLE_IMAGE_RENDERING_AUTO,
1463 : eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED,
1464 : eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY,
1465 : eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES,
1466 : eCSSKeyword_UNKNOWN, -1
1467 : };
1468 :
1469 : const PRInt32 nsCSSProps::kShapeRenderingKTable[] = {
1470 : eCSSKeyword_auto, NS_STYLE_SHAPE_RENDERING_AUTO,
1471 : eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED,
1472 : eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES,
1473 : eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION,
1474 : eCSSKeyword_UNKNOWN, -1
1475 : };
1476 :
1477 : const PRInt32 nsCSSProps::kStrokeLinecapKTable[] = {
1478 : eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT,
1479 : eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND,
1480 : eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE,
1481 : eCSSKeyword_UNKNOWN, -1
1482 : };
1483 :
1484 : const PRInt32 nsCSSProps::kStrokeLinejoinKTable[] = {
1485 : eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER,
1486 : eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND,
1487 : eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL,
1488 : eCSSKeyword_UNKNOWN, -1
1489 : };
1490 :
1491 : const PRInt32 nsCSSProps::kTextAnchorKTable[] = {
1492 : eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START,
1493 : eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE,
1494 : eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END,
1495 : eCSSKeyword_UNKNOWN, -1
1496 : };
1497 :
1498 : const PRInt32 nsCSSProps::kTextRenderingKTable[] = {
1499 : eCSSKeyword_auto, NS_STYLE_TEXT_RENDERING_AUTO,
1500 : eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED,
1501 : eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY,
1502 : eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION,
1503 : eCSSKeyword_UNKNOWN, -1
1504 : };
1505 :
1506 : const PRInt32 nsCSSProps::kColorInterpolationKTable[] = {
1507 : eCSSKeyword_auto, NS_STYLE_COLOR_INTERPOLATION_AUTO,
1508 : eCSSKeyword_srgb, NS_STYLE_COLOR_INTERPOLATION_SRGB,
1509 : eCSSKeyword_linearrgb, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB,
1510 : eCSSKeyword_UNKNOWN, -1
1511 : };
1512 :
1513 : const PRInt32 nsCSSProps::kColumnFillKTable[] = {
1514 : eCSSKeyword_auto, NS_STYLE_COLUMN_FILL_AUTO,
1515 : eCSSKeyword_balance, NS_STYLE_COLUMN_FILL_BALANCE,
1516 : eCSSKeyword_UNKNOWN, -1
1517 : };
1518 :
1519 : bool
1520 0 : nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const PRInt32 aTable[], PRInt32& aResult)
1521 : {
1522 0 : PRInt32 index = 0;
1523 0 : while (eCSSKeyword_UNKNOWN != nsCSSKeyword(aTable[index])) {
1524 0 : if (aKeyword == nsCSSKeyword(aTable[index])) {
1525 0 : aResult = aTable[index+1];
1526 0 : return true;
1527 : }
1528 0 : index += 2;
1529 : }
1530 0 : return false;
1531 : }
1532 :
1533 : nsCSSKeyword
1534 0 : nsCSSProps::ValueToKeywordEnum(PRInt32 aValue, const PRInt32 aTable[])
1535 : {
1536 0 : PRInt32 i = 1;
1537 0 : for (;;) {
1538 0 : if (aTable[i] == -1 && aTable[i-1] == eCSSKeyword_UNKNOWN) {
1539 : break;
1540 : }
1541 0 : if (aValue == aTable[i]) {
1542 0 : return nsCSSKeyword(aTable[i-1]);
1543 : }
1544 0 : i += 2;
1545 : }
1546 0 : return eCSSKeyword_UNKNOWN;
1547 : }
1548 :
1549 : const nsAFlatCString&
1550 0 : nsCSSProps::ValueToKeyword(PRInt32 aValue, const PRInt32 aTable[])
1551 : {
1552 0 : nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
1553 0 : if (keyword == eCSSKeyword_UNKNOWN) {
1554 0 : static nsDependentCString sNullStr("");
1555 0 : return sNullStr;
1556 : } else {
1557 0 : return nsCSSKeywords::GetStringValue(keyword);
1558 : }
1559 : }
1560 :
1561 : /* static */ const PRInt32* const
1562 : nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = {
1563 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1564 : stylestruct_, stylestructoffset_, animtype_) \
1565 : kwtable_,
1566 : #include "nsCSSPropList.h"
1567 : #undef CSS_PROP
1568 : };
1569 :
1570 : const nsAFlatCString&
1571 0 : nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, PRInt32 aValue)
1572 : {
1573 0 : NS_ABORT_IF_FALSE(aProp >= 0 && aProp < eCSSProperty_COUNT,
1574 : "property out of range");
1575 :
1576 0 : const PRInt32* kwtable = nsnull;
1577 0 : if (aProp < eCSSProperty_COUNT_no_shorthands)
1578 0 : kwtable = kKeywordTableTable[aProp];
1579 :
1580 0 : if (kwtable)
1581 0 : return ValueToKeyword(aValue, kwtable);
1582 :
1583 0 : static nsDependentCString sNullStr("");
1584 0 : return sNullStr;
1585 : }
1586 :
1587 0 : bool nsCSSProps::GetColorName(PRInt32 aPropValue, nsCString &aStr)
1588 : {
1589 0 : bool rv = false;
1590 :
1591 : // first get the keyword corresponding to the property Value from the color table
1592 0 : nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable);
1593 :
1594 : // next get the name as a string from the keywords table
1595 0 : if (keyword != eCSSKeyword_UNKNOWN) {
1596 0 : nsCSSKeywords::AddRefTable();
1597 0 : aStr = nsCSSKeywords::GetStringValue(keyword);
1598 0 : nsCSSKeywords::ReleaseTable();
1599 0 : rv = true;
1600 : }
1601 0 : return rv;
1602 : }
1603 :
1604 : const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = {
1605 : // Note that this uses the special BackendOnly style struct ID
1606 : // (which does need to be valid for storing in the
1607 : // nsCSSCompressedDataBlock::mStyleBits bitfield).
1608 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1609 : stylestruct_, stylestructoffset_, animtype_) \
1610 : eStyleStruct_##stylestruct_,
1611 :
1612 : #include "nsCSSPropList.h"
1613 :
1614 : #undef CSS_PROP
1615 : };
1616 :
1617 : const nsStyleAnimType
1618 : nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = {
1619 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1620 : stylestruct_, stylestructoffset_, animtype_) \
1621 : animtype_,
1622 : #include "nsCSSPropList.h"
1623 : #undef CSS_PROP
1624 : };
1625 :
1626 : const ptrdiff_t
1627 : nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = {
1628 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1629 : stylestruct_, stylestructoffset_, animtype_) \
1630 : stylestructoffset_,
1631 : #include "nsCSSPropList.h"
1632 : #undef CSS_PROP
1633 : };
1634 :
1635 : const PRUint32 nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
1636 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
1637 : stylestruct_, stylestructoffset_, animtype_) \
1638 : flags_,
1639 : #include "nsCSSPropList.h"
1640 : #undef CSS_PROP
1641 : #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) flags_,
1642 : #include "nsCSSPropList.h"
1643 : #undef CSS_PROP_SHORTHAND
1644 : };
1645 :
1646 : static const nsCSSProperty gAnimationSubpropTable[] = {
1647 : eCSSProperty_animation_duration,
1648 : eCSSProperty_animation_timing_function,
1649 : eCSSProperty_animation_delay,
1650 : eCSSProperty_animation_direction,
1651 : eCSSProperty_animation_fill_mode,
1652 : eCSSProperty_animation_iteration_count,
1653 : // List animation-name last so we serialize it last, in case it has
1654 : // a value that conflicts with one of the other properties. (See
1655 : // how Declaration::GetValue serializes 'animation'.
1656 : eCSSProperty_animation_name,
1657 : eCSSProperty_UNKNOWN
1658 : };
1659 :
1660 : static const nsCSSProperty gBorderRadiusSubpropTable[] = {
1661 : // Code relies on these being in topleft-topright-bottomright-bottomleft
1662 : // order.
1663 : eCSSProperty_border_top_left_radius,
1664 : eCSSProperty_border_top_right_radius,
1665 : eCSSProperty_border_bottom_right_radius,
1666 : eCSSProperty_border_bottom_left_radius,
1667 : eCSSProperty_UNKNOWN
1668 : };
1669 :
1670 : static const nsCSSProperty gOutlineRadiusSubpropTable[] = {
1671 : // Code relies on these being in topleft-topright-bottomright-bottomleft
1672 : // order.
1673 : eCSSProperty__moz_outline_radius_topLeft,
1674 : eCSSProperty__moz_outline_radius_topRight,
1675 : eCSSProperty__moz_outline_radius_bottomRight,
1676 : eCSSProperty__moz_outline_radius_bottomLeft,
1677 : eCSSProperty_UNKNOWN
1678 : };
1679 :
1680 : static const nsCSSProperty gBackgroundSubpropTable[] = {
1681 : eCSSProperty_background_color,
1682 : eCSSProperty_background_image,
1683 : eCSSProperty_background_repeat,
1684 : eCSSProperty_background_attachment,
1685 : eCSSProperty_background_position,
1686 : eCSSProperty_background_clip,
1687 : eCSSProperty_background_origin,
1688 : eCSSProperty_background_size,
1689 : eCSSProperty_UNKNOWN
1690 : };
1691 :
1692 : static const nsCSSProperty gBorderSubpropTable[] = {
1693 : eCSSProperty_border_top_width,
1694 : eCSSProperty_border_right_width_value,
1695 : eCSSProperty_border_right_width_ltr_source,
1696 : eCSSProperty_border_right_width_rtl_source,
1697 : eCSSProperty_border_bottom_width,
1698 : eCSSProperty_border_left_width_value,
1699 : eCSSProperty_border_left_width_ltr_source,
1700 : eCSSProperty_border_left_width_rtl_source,
1701 : eCSSProperty_border_top_style,
1702 : eCSSProperty_border_right_style_value,
1703 : eCSSProperty_border_right_style_ltr_source,
1704 : eCSSProperty_border_right_style_rtl_source,
1705 : eCSSProperty_border_bottom_style,
1706 : eCSSProperty_border_left_style_value,
1707 : eCSSProperty_border_left_style_ltr_source,
1708 : eCSSProperty_border_left_style_rtl_source,
1709 : eCSSProperty_border_top_color,
1710 : eCSSProperty_border_right_color_value,
1711 : eCSSProperty_border_right_color_ltr_source,
1712 : eCSSProperty_border_right_color_rtl_source,
1713 : eCSSProperty_border_bottom_color,
1714 : eCSSProperty_border_left_color_value,
1715 : eCSSProperty_border_left_color_ltr_source,
1716 : eCSSProperty_border_left_color_rtl_source,
1717 : eCSSProperty_border_top_colors,
1718 : eCSSProperty_border_right_colors,
1719 : eCSSProperty_border_bottom_colors,
1720 : eCSSProperty_border_left_colors,
1721 : eCSSProperty_border_image,
1722 : eCSSProperty_UNKNOWN
1723 : };
1724 :
1725 : static const nsCSSProperty gBorderBottomSubpropTable[] = {
1726 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1727 : // It also depends on the color being third.
1728 : eCSSProperty_border_bottom_width,
1729 : eCSSProperty_border_bottom_style,
1730 : eCSSProperty_border_bottom_color,
1731 : eCSSProperty_UNKNOWN
1732 : };
1733 :
1734 : MOZ_STATIC_ASSERT(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
1735 : NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
1736 : "box side constants not top/right/bottom/left == 0/1/2/3");
1737 : static const nsCSSProperty gBorderColorSubpropTable[] = {
1738 : // Code relies on these being in top-right-bottom-left order.
1739 : // Code relies on these matching the NS_SIDE_* constants.
1740 : eCSSProperty_border_top_color,
1741 : eCSSProperty_border_right_color_value,
1742 : eCSSProperty_border_bottom_color,
1743 : eCSSProperty_border_left_color_value,
1744 : // extras:
1745 : eCSSProperty_border_left_color_ltr_source,
1746 : eCSSProperty_border_left_color_rtl_source,
1747 : eCSSProperty_border_right_color_ltr_source,
1748 : eCSSProperty_border_right_color_rtl_source,
1749 : eCSSProperty_UNKNOWN
1750 : };
1751 :
1752 : static const nsCSSProperty gBorderEndColorSubpropTable[] = {
1753 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1754 : eCSSProperty_border_end_color_value,
1755 : eCSSProperty_border_right_color_ltr_source,
1756 : eCSSProperty_border_left_color_rtl_source,
1757 : eCSSProperty_UNKNOWN
1758 : };
1759 :
1760 : static const nsCSSProperty gBorderLeftColorSubpropTable[] = {
1761 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1762 : eCSSProperty_border_left_color_value,
1763 : eCSSProperty_border_left_color_ltr_source,
1764 : eCSSProperty_border_left_color_rtl_source,
1765 : eCSSProperty_UNKNOWN
1766 : };
1767 :
1768 : static const nsCSSProperty gBorderRightColorSubpropTable[] = {
1769 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1770 : eCSSProperty_border_right_color_value,
1771 : eCSSProperty_border_right_color_ltr_source,
1772 : eCSSProperty_border_right_color_rtl_source,
1773 : eCSSProperty_UNKNOWN
1774 : };
1775 :
1776 : static const nsCSSProperty gBorderStartColorSubpropTable[] = {
1777 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1778 : eCSSProperty_border_start_color_value,
1779 : eCSSProperty_border_left_color_ltr_source,
1780 : eCSSProperty_border_right_color_rtl_source,
1781 : eCSSProperty_UNKNOWN
1782 : };
1783 :
1784 : static const nsCSSProperty gBorderEndSubpropTable[] = {
1785 : // nsCSSDeclaration.cpp output the subproperties in this order.
1786 : // It also depends on the color being third.
1787 : eCSSProperty_border_end_width_value,
1788 : eCSSProperty_border_end_style_value,
1789 : eCSSProperty_border_end_color_value,
1790 : // extras:
1791 : eCSSProperty_border_right_width_ltr_source,
1792 : eCSSProperty_border_left_width_rtl_source,
1793 : eCSSProperty_border_right_style_ltr_source,
1794 : eCSSProperty_border_left_style_rtl_source,
1795 : eCSSProperty_border_right_color_ltr_source,
1796 : eCSSProperty_border_left_color_rtl_source,
1797 : eCSSProperty_UNKNOWN
1798 : };
1799 :
1800 : static const nsCSSProperty gBorderLeftSubpropTable[] = {
1801 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1802 : // It also depends on the color being third.
1803 : eCSSProperty_border_left_width_value,
1804 : eCSSProperty_border_left_style_value,
1805 : eCSSProperty_border_left_color_value,
1806 : // extras:
1807 : eCSSProperty_border_left_width_ltr_source,
1808 : eCSSProperty_border_left_width_rtl_source,
1809 : eCSSProperty_border_left_style_ltr_source,
1810 : eCSSProperty_border_left_style_rtl_source,
1811 : eCSSProperty_border_left_color_ltr_source,
1812 : eCSSProperty_border_left_color_rtl_source,
1813 : eCSSProperty_UNKNOWN
1814 : };
1815 :
1816 : static const nsCSSProperty gBorderRightSubpropTable[] = {
1817 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1818 : // It also depends on the color being third.
1819 : eCSSProperty_border_right_width_value,
1820 : eCSSProperty_border_right_style_value,
1821 : eCSSProperty_border_right_color_value,
1822 : // extras:
1823 : eCSSProperty_border_right_width_ltr_source,
1824 : eCSSProperty_border_right_width_rtl_source,
1825 : eCSSProperty_border_right_style_ltr_source,
1826 : eCSSProperty_border_right_style_rtl_source,
1827 : eCSSProperty_border_right_color_ltr_source,
1828 : eCSSProperty_border_right_color_rtl_source,
1829 : eCSSProperty_UNKNOWN
1830 : };
1831 :
1832 : static const nsCSSProperty gBorderStartSubpropTable[] = {
1833 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1834 : // It also depends on the color being third.
1835 : eCSSProperty_border_start_width_value,
1836 : eCSSProperty_border_start_style_value,
1837 : eCSSProperty_border_start_color_value,
1838 : // extras:
1839 : eCSSProperty_border_left_width_ltr_source,
1840 : eCSSProperty_border_right_width_rtl_source,
1841 : eCSSProperty_border_left_style_ltr_source,
1842 : eCSSProperty_border_right_style_rtl_source,
1843 : eCSSProperty_border_left_color_ltr_source,
1844 : eCSSProperty_border_right_color_rtl_source,
1845 : eCSSProperty_UNKNOWN
1846 : };
1847 :
1848 : static const nsCSSProperty gBorderStyleSubpropTable[] = {
1849 : // Code relies on these being in top-right-bottom-left order.
1850 : eCSSProperty_border_top_style,
1851 : eCSSProperty_border_right_style_value,
1852 : eCSSProperty_border_bottom_style,
1853 : eCSSProperty_border_left_style_value,
1854 : // extras:
1855 : eCSSProperty_border_left_style_ltr_source,
1856 : eCSSProperty_border_left_style_rtl_source,
1857 : eCSSProperty_border_right_style_ltr_source,
1858 : eCSSProperty_border_right_style_rtl_source,
1859 : eCSSProperty_UNKNOWN
1860 : };
1861 :
1862 : static const nsCSSProperty gBorderLeftStyleSubpropTable[] = {
1863 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1864 : eCSSProperty_border_left_style_value,
1865 : eCSSProperty_border_left_style_ltr_source,
1866 : eCSSProperty_border_left_style_rtl_source,
1867 : eCSSProperty_UNKNOWN
1868 : };
1869 :
1870 : static const nsCSSProperty gBorderRightStyleSubpropTable[] = {
1871 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1872 : eCSSProperty_border_right_style_value,
1873 : eCSSProperty_border_right_style_ltr_source,
1874 : eCSSProperty_border_right_style_rtl_source,
1875 : eCSSProperty_UNKNOWN
1876 : };
1877 :
1878 : static const nsCSSProperty gBorderStartStyleSubpropTable[] = {
1879 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1880 : eCSSProperty_border_start_style_value,
1881 : eCSSProperty_border_left_style_ltr_source,
1882 : eCSSProperty_border_right_style_rtl_source,
1883 : eCSSProperty_UNKNOWN
1884 : };
1885 :
1886 : static const nsCSSProperty gBorderEndStyleSubpropTable[] = {
1887 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1888 : eCSSProperty_border_end_style_value,
1889 : eCSSProperty_border_right_style_ltr_source,
1890 : eCSSProperty_border_left_style_rtl_source,
1891 : eCSSProperty_UNKNOWN
1892 : };
1893 :
1894 : static const nsCSSProperty gBorderTopSubpropTable[] = {
1895 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
1896 : // It also depends on the color being third.
1897 : eCSSProperty_border_top_width,
1898 : eCSSProperty_border_top_style,
1899 : eCSSProperty_border_top_color,
1900 : eCSSProperty_UNKNOWN
1901 : };
1902 :
1903 : static const nsCSSProperty gBorderWidthSubpropTable[] = {
1904 : // Code relies on these being in top-right-bottom-left order.
1905 : eCSSProperty_border_top_width,
1906 : eCSSProperty_border_right_width_value,
1907 : eCSSProperty_border_bottom_width,
1908 : eCSSProperty_border_left_width_value,
1909 : // extras:
1910 : eCSSProperty_border_left_width_ltr_source,
1911 : eCSSProperty_border_left_width_rtl_source,
1912 : eCSSProperty_border_right_width_ltr_source,
1913 : eCSSProperty_border_right_width_rtl_source,
1914 : eCSSProperty_UNKNOWN
1915 : };
1916 :
1917 : static const nsCSSProperty gBorderLeftWidthSubpropTable[] = {
1918 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1919 : eCSSProperty_border_left_width_value,
1920 : eCSSProperty_border_left_width_ltr_source,
1921 : eCSSProperty_border_left_width_rtl_source,
1922 : eCSSProperty_UNKNOWN
1923 : };
1924 :
1925 : static const nsCSSProperty gBorderRightWidthSubpropTable[] = {
1926 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1927 : eCSSProperty_border_right_width_value,
1928 : eCSSProperty_border_right_width_ltr_source,
1929 : eCSSProperty_border_right_width_rtl_source,
1930 : eCSSProperty_UNKNOWN
1931 : };
1932 :
1933 : static const nsCSSProperty gBorderStartWidthSubpropTable[] = {
1934 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1935 : eCSSProperty_border_start_width_value,
1936 : eCSSProperty_border_left_width_ltr_source,
1937 : eCSSProperty_border_right_width_rtl_source,
1938 : eCSSProperty_UNKNOWN
1939 : };
1940 :
1941 : static const nsCSSProperty gBorderEndWidthSubpropTable[] = {
1942 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1943 : eCSSProperty_border_end_width_value,
1944 : eCSSProperty_border_right_width_ltr_source,
1945 : eCSSProperty_border_left_width_rtl_source,
1946 : eCSSProperty_UNKNOWN
1947 : };
1948 :
1949 : static const nsCSSProperty gFontSubpropTable[] = {
1950 : eCSSProperty_font_family,
1951 : eCSSProperty_font_style,
1952 : eCSSProperty_font_variant,
1953 : eCSSProperty_font_weight,
1954 : eCSSProperty_font_size,
1955 : eCSSProperty_line_height,
1956 : eCSSProperty_font_size_adjust, // XXX Added LDB.
1957 : eCSSProperty_font_stretch, // XXX Added LDB.
1958 : eCSSProperty__x_system_font,
1959 : eCSSProperty_font_feature_settings,
1960 : eCSSProperty_font_language_override,
1961 : eCSSProperty_UNKNOWN
1962 : };
1963 :
1964 : static const nsCSSProperty gListStyleSubpropTable[] = {
1965 : eCSSProperty_list_style_type,
1966 : eCSSProperty_list_style_image,
1967 : eCSSProperty_list_style_position,
1968 : eCSSProperty_UNKNOWN
1969 : };
1970 :
1971 : static const nsCSSProperty gMarginSubpropTable[] = {
1972 : // Code relies on these being in top-right-bottom-left order.
1973 : eCSSProperty_margin_top,
1974 : eCSSProperty_margin_right_value,
1975 : eCSSProperty_margin_bottom,
1976 : eCSSProperty_margin_left_value,
1977 : // extras:
1978 : eCSSProperty_margin_left_ltr_source,
1979 : eCSSProperty_margin_left_rtl_source,
1980 : eCSSProperty_margin_right_ltr_source,
1981 : eCSSProperty_margin_right_rtl_source,
1982 : eCSSProperty_UNKNOWN
1983 : };
1984 :
1985 : static const nsCSSProperty gMarginLeftSubpropTable[] = {
1986 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1987 : eCSSProperty_margin_left_value,
1988 : eCSSProperty_margin_left_ltr_source,
1989 : eCSSProperty_margin_left_rtl_source,
1990 : eCSSProperty_UNKNOWN
1991 : };
1992 :
1993 : static const nsCSSProperty gMarginRightSubpropTable[] = {
1994 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
1995 : eCSSProperty_margin_right_value,
1996 : eCSSProperty_margin_right_ltr_source,
1997 : eCSSProperty_margin_right_rtl_source,
1998 : eCSSProperty_UNKNOWN
1999 : };
2000 :
2001 : static const nsCSSProperty gMarginStartSubpropTable[] = {
2002 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2003 : eCSSProperty_margin_start_value,
2004 : eCSSProperty_margin_left_ltr_source,
2005 : eCSSProperty_margin_right_rtl_source,
2006 : eCSSProperty_UNKNOWN
2007 : };
2008 :
2009 : static const nsCSSProperty gMarginEndSubpropTable[] = {
2010 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2011 : eCSSProperty_margin_end_value,
2012 : eCSSProperty_margin_right_ltr_source,
2013 : eCSSProperty_margin_left_rtl_source,
2014 : eCSSProperty_UNKNOWN
2015 : };
2016 :
2017 :
2018 : static const nsCSSProperty gOutlineSubpropTable[] = {
2019 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
2020 : // It also depends on the color being third.
2021 : eCSSProperty_outline_width,
2022 : eCSSProperty_outline_style,
2023 : eCSSProperty_outline_color,
2024 : eCSSProperty_UNKNOWN
2025 : };
2026 :
2027 : static const nsCSSProperty gColumnsSubpropTable[] = {
2028 : eCSSProperty__moz_column_count,
2029 : eCSSProperty__moz_column_width,
2030 : eCSSProperty_UNKNOWN
2031 : };
2032 :
2033 : static const nsCSSProperty gColumnRuleSubpropTable[] = {
2034 : // nsCSSDeclaration.cpp outputs the subproperties in this order.
2035 : // It also depends on the color being third.
2036 : eCSSProperty__moz_column_rule_width,
2037 : eCSSProperty__moz_column_rule_style,
2038 : eCSSProperty__moz_column_rule_color,
2039 : eCSSProperty_UNKNOWN
2040 : };
2041 :
2042 : static const nsCSSProperty gOverflowSubpropTable[] = {
2043 : eCSSProperty_overflow_x,
2044 : eCSSProperty_overflow_y,
2045 : eCSSProperty_UNKNOWN
2046 : };
2047 :
2048 : static const nsCSSProperty gPaddingSubpropTable[] = {
2049 : // Code relies on these being in top-right-bottom-left order.
2050 : eCSSProperty_padding_top,
2051 : eCSSProperty_padding_right_value,
2052 : eCSSProperty_padding_bottom,
2053 : eCSSProperty_padding_left_value,
2054 : // extras:
2055 : eCSSProperty_padding_left_ltr_source,
2056 : eCSSProperty_padding_left_rtl_source,
2057 : eCSSProperty_padding_right_ltr_source,
2058 : eCSSProperty_padding_right_rtl_source,
2059 : eCSSProperty_UNKNOWN
2060 : };
2061 :
2062 : static const nsCSSProperty gPaddingLeftSubpropTable[] = {
2063 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2064 : eCSSProperty_padding_left_value,
2065 : eCSSProperty_padding_left_ltr_source,
2066 : eCSSProperty_padding_left_rtl_source,
2067 : eCSSProperty_UNKNOWN
2068 : };
2069 :
2070 : static const nsCSSProperty gPaddingRightSubpropTable[] = {
2071 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2072 : eCSSProperty_padding_right_value,
2073 : eCSSProperty_padding_right_ltr_source,
2074 : eCSSProperty_padding_right_rtl_source,
2075 : eCSSProperty_UNKNOWN
2076 : };
2077 :
2078 : static const nsCSSProperty gPaddingStartSubpropTable[] = {
2079 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2080 : eCSSProperty_padding_start_value,
2081 : eCSSProperty_padding_left_ltr_source,
2082 : eCSSProperty_padding_right_rtl_source,
2083 : eCSSProperty_UNKNOWN
2084 : };
2085 :
2086 : static const nsCSSProperty gPaddingEndSubpropTable[] = {
2087 : // nsCSSParser::ParseDirectionalBoxProperty depends on this order
2088 : eCSSProperty_padding_end_value,
2089 : eCSSProperty_padding_right_ltr_source,
2090 : eCSSProperty_padding_left_rtl_source,
2091 : eCSSProperty_UNKNOWN
2092 : };
2093 :
2094 : static const nsCSSProperty gTextDecorationSubpropTable[] = {
2095 : eCSSProperty_text_blink,
2096 : eCSSProperty_text_decoration_color,
2097 : eCSSProperty_text_decoration_line,
2098 : eCSSProperty_text_decoration_style,
2099 : eCSSProperty_UNKNOWN
2100 : };
2101 :
2102 : static const nsCSSProperty gTransitionSubpropTable[] = {
2103 : eCSSProperty_transition_property,
2104 : eCSSProperty_transition_duration,
2105 : eCSSProperty_transition_timing_function,
2106 : eCSSProperty_transition_delay,
2107 : eCSSProperty_UNKNOWN
2108 : };
2109 :
2110 : static const nsCSSProperty gMarkerSubpropTable[] = {
2111 : eCSSProperty_marker_start,
2112 : eCSSProperty_marker_mid,
2113 : eCSSProperty_marker_end,
2114 : eCSSProperty_UNKNOWN
2115 : };
2116 :
2117 : const nsCSSProperty *const
2118 : nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = {
2119 : #define CSS_PROP_DOMPROP_PREFIXED(prop_) prop_
2120 : // Need an extra level of macro nesting to force expansion of method_
2121 : // params before they get pasted.
2122 : #define NSCSSPROPS_INNER_MACRO(method_) g##method_##SubpropTable,
2123 : #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) NSCSSPROPS_INNER_MACRO(method_)
2124 : #include "nsCSSPropList.h"
2125 : #undef CSS_PROP_SHORTHAND
2126 : #undef NSCSSPROPS_INNER_MACRO
2127 : #undef CSS_PROP_DOMPROP_PREFIXED
2128 : };
2129 :
2130 :
2131 : #define ENUM_DATA_FOR_PROPERTY(name_, id_, method_, flags_, parsevariant_, \
2132 : kwtable_, stylestructoffset_, animtype_) \
2133 : ePropertyIndex_for_##id_,
2134 :
2135 : // The order of these enums must match the g*Flags arrays in nsRuleNode.cpp.
2136 :
2137 : enum FontCheckCounter {
2138 : #define CSS_PROP_FONT ENUM_DATA_FOR_PROPERTY
2139 : #include "nsCSSPropList.h"
2140 : #undef CSS_PROP_FONT
2141 : ePropertyCount_for_Font
2142 : };
2143 :
2144 : enum DisplayCheckCounter {
2145 : #define CSS_PROP_DISPLAY ENUM_DATA_FOR_PROPERTY
2146 : #include "nsCSSPropList.h"
2147 : #undef CSS_PROP_DISPLAY
2148 : ePropertyCount_for_Display
2149 : };
2150 :
2151 : enum VisibilityCheckCounter {
2152 : #define CSS_PROP_VISIBILITY ENUM_DATA_FOR_PROPERTY
2153 : #include "nsCSSPropList.h"
2154 : #undef CSS_PROP_VISIBILITY
2155 : ePropertyCount_for_Visibility
2156 : };
2157 :
2158 : enum MarginCheckCounter {
2159 : #define CSS_PROP_MARGIN ENUM_DATA_FOR_PROPERTY
2160 : #include "nsCSSPropList.h"
2161 : #undef CSS_PROP_MARGIN
2162 : ePropertyCount_for_Margin
2163 : };
2164 :
2165 : enum BorderCheckCounter {
2166 : #define CSS_PROP_BORDER ENUM_DATA_FOR_PROPERTY
2167 : #include "nsCSSPropList.h"
2168 : #undef CSS_PROP_BORDER
2169 : ePropertyCount_for_Border
2170 : };
2171 :
2172 : enum PaddingCheckCounter {
2173 : #define CSS_PROP_PADDING ENUM_DATA_FOR_PROPERTY
2174 : #include "nsCSSPropList.h"
2175 : #undef CSS_PROP_PADDING
2176 : ePropertyCount_for_Padding
2177 : };
2178 :
2179 : enum OutlineCheckCounter {
2180 : #define CSS_PROP_OUTLINE ENUM_DATA_FOR_PROPERTY
2181 : #include "nsCSSPropList.h"
2182 : #undef CSS_PROP_OUTLINE
2183 : ePropertyCount_for_Outline
2184 : };
2185 :
2186 : enum ListCheckCounter {
2187 : #define CSS_PROP_LIST ENUM_DATA_FOR_PROPERTY
2188 : #include "nsCSSPropList.h"
2189 : #undef CSS_PROP_LIST
2190 : ePropertyCount_for_List
2191 : };
2192 :
2193 : enum ColorCheckCounter {
2194 : #define CSS_PROP_COLOR ENUM_DATA_FOR_PROPERTY
2195 : #include "nsCSSPropList.h"
2196 : #undef CSS_PROP_COLOR
2197 : ePropertyCount_for_Color
2198 : };
2199 :
2200 : enum BackgroundCheckCounter {
2201 : #define CSS_PROP_BACKGROUND ENUM_DATA_FOR_PROPERTY
2202 : #include "nsCSSPropList.h"
2203 : #undef CSS_PROP_BACKGROUND
2204 : ePropertyCount_for_Background
2205 : };
2206 :
2207 : enum PositionCheckCounter {
2208 : #define CSS_PROP_POSITION ENUM_DATA_FOR_PROPERTY
2209 : #include "nsCSSPropList.h"
2210 : #undef CSS_PROP_POSITION
2211 : ePropertyCount_for_Position
2212 : };
2213 :
2214 : enum TableCheckCounter {
2215 : #define CSS_PROP_TABLE ENUM_DATA_FOR_PROPERTY
2216 : #include "nsCSSPropList.h"
2217 : #undef CSS_PROP_TABLE
2218 : ePropertyCount_for_Table
2219 : };
2220 :
2221 : enum TableBorderCheckCounter {
2222 : #define CSS_PROP_TABLEBORDER ENUM_DATA_FOR_PROPERTY
2223 : #include "nsCSSPropList.h"
2224 : #undef CSS_PROP_TABLEBORDER
2225 : ePropertyCount_for_TableBorder
2226 : };
2227 :
2228 : enum ContentCheckCounter {
2229 : #define CSS_PROP_CONTENT ENUM_DATA_FOR_PROPERTY
2230 : #include "nsCSSPropList.h"
2231 : #undef CSS_PROP_CONTENT
2232 : ePropertyCount_for_Content
2233 : };
2234 :
2235 : enum QuotesCheckCounter {
2236 : #define CSS_PROP_QUOTES ENUM_DATA_FOR_PROPERTY
2237 : #include "nsCSSPropList.h"
2238 : #undef CSS_PROP_QUOTES
2239 : ePropertyCount_for_Quotes
2240 : };
2241 :
2242 : enum TextCheckCounter {
2243 : #define CSS_PROP_TEXT ENUM_DATA_FOR_PROPERTY
2244 : #include "nsCSSPropList.h"
2245 : #undef CSS_PROP_TEXT
2246 : ePropertyCount_for_Text
2247 : };
2248 :
2249 : enum TextResetCheckCounter {
2250 : #define CSS_PROP_TEXTRESET ENUM_DATA_FOR_PROPERTY
2251 : #include "nsCSSPropList.h"
2252 : #undef CSS_PROP_TEXTRESET
2253 : ePropertyCount_for_TextReset
2254 : };
2255 :
2256 : enum UserInterfaceCheckCounter {
2257 : #define CSS_PROP_USERINTERFACE ENUM_DATA_FOR_PROPERTY
2258 : #include "nsCSSPropList.h"
2259 : #undef CSS_PROP_USERINTERFACE
2260 : ePropertyCount_for_UserInterface
2261 : };
2262 :
2263 : enum UIResetCheckCounter {
2264 : #define CSS_PROP_UIRESET ENUM_DATA_FOR_PROPERTY
2265 : #include "nsCSSPropList.h"
2266 : #undef CSS_PROP_UIRESET
2267 : ePropertyCount_for_UIReset
2268 : };
2269 :
2270 : enum XULCheckCounter {
2271 : #define CSS_PROP_XUL ENUM_DATA_FOR_PROPERTY
2272 : #include "nsCSSPropList.h"
2273 : #undef CSS_PROP_XUL
2274 : ePropertyCount_for_XUL
2275 : };
2276 :
2277 : enum SVGCheckCounter {
2278 : #define CSS_PROP_SVG ENUM_DATA_FOR_PROPERTY
2279 : #include "nsCSSPropList.h"
2280 : #undef CSS_PROP_SVG
2281 : ePropertyCount_for_SVG
2282 : };
2283 :
2284 : enum SVGResetCheckCounter {
2285 : #define CSS_PROP_SVGRESET ENUM_DATA_FOR_PROPERTY
2286 : #include "nsCSSPropList.h"
2287 : #undef CSS_PROP_SVGRESET
2288 : ePropertyCount_for_SVGReset
2289 : };
2290 :
2291 : enum ColumnCheckCounter {
2292 : #define CSS_PROP_COLUMN ENUM_DATA_FOR_PROPERTY
2293 : #include "nsCSSPropList.h"
2294 : #undef CSS_PROP_COLUMN
2295 : ePropertyCount_for_Column
2296 : };
2297 :
2298 : #undef ENUM_DATA_FOR_PROPERTY
2299 :
2300 : /* static */ const size_t
2301 : nsCSSProps::gPropertyCountInStruct[nsStyleStructID_Length] = {
2302 : #define STYLE_STRUCT(name, checkdata_cb, ctor_args) \
2303 : ePropertyCount_for_##name,
2304 : #include "nsStyleStructList.h"
2305 : #undef STYLE_STRUCT
2306 : };
2307 :
2308 : /* static */ const size_t
2309 : nsCSSProps::gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands] = {
2310 :
2311 : #define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, parsevariant_, \
2312 : kwtable_) \
2313 : size_t(-1),
2314 : #define CSS_PROP(name_, id_, method_, flags_, parsevariant_, kwtable_, \
2315 : stylestruct_, stylestructoffset_, animtype_) \
2316 : ePropertyIndex_for_##id_,
2317 : #include "nsCSSPropList.h"
2318 : #undef CSS_PROP
2319 : #undef CSS_PROP_BACKENDONLY
2320 :
2321 : };
|