|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /* |
|
7 * methods for dealing with CSS properties and tables of the keyword |
|
8 * values they accept |
|
9 */ |
|
10 |
|
11 #include "mozilla/ArrayUtils.h" |
|
12 |
|
13 #include "nsCSSProps.h" |
|
14 #include "nsCSSKeywords.h" |
|
15 #include "nsLayoutUtils.h" |
|
16 #include "nsStyleConsts.h" |
|
17 #include "nsIWidget.h" |
|
18 #include "nsThemeConstants.h" // For system widget appearance types |
|
19 |
|
20 #include "mozilla/LookAndFeel.h" // for system colors |
|
21 |
|
22 #include "nsString.h" |
|
23 #include "nsStaticNameTable.h" |
|
24 |
|
25 #include "mozilla/Preferences.h" |
|
26 |
|
27 using namespace mozilla; |
|
28 |
|
29 typedef nsCSSProps::KTableValue KTableValue; |
|
30 |
|
31 // required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it |
|
32 extern const char* const kCSSRawProperties[]; |
|
33 |
|
34 // define an array of all CSS properties |
|
35 const char* const kCSSRawProperties[eCSSProperty_COUNT_with_aliases] = { |
|
36 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ |
|
37 stylestruct_, stylestructoffset_, animtype_) \ |
|
38 #name_, |
|
39 #include "nsCSSPropList.h" |
|
40 #undef CSS_PROP |
|
41 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) #name_, |
|
42 #include "nsCSSPropList.h" |
|
43 #undef CSS_PROP_SHORTHAND |
|
44 #define CSS_PROP_ALIAS(aliasname_, id_, method_, pref_) #aliasname_, |
|
45 #include "nsCSSPropAliasList.h" |
|
46 #undef CSS_PROP_ALIAS |
|
47 }; |
|
48 |
|
49 using namespace mozilla; |
|
50 |
|
51 static int32_t gPropertyTableRefCount; |
|
52 static nsStaticCaseInsensitiveNameTable* gPropertyTable; |
|
53 static nsStaticCaseInsensitiveNameTable* gFontDescTable; |
|
54 |
|
55 /* static */ nsCSSProperty * |
|
56 nsCSSProps::gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands]; |
|
57 /* static */ nsCSSProperty* nsCSSProps::gShorthandsContainingPool = nullptr; |
|
58 |
|
59 static const char* const kCSSRawFontDescs[] = { |
|
60 #define CSS_FONT_DESC(name_, method_) #name_, |
|
61 #include "nsCSSFontDescList.h" |
|
62 #undef CSS_FONT_DESC |
|
63 }; |
|
64 |
|
65 struct PropertyAndCount { |
|
66 nsCSSProperty property; |
|
67 uint32_t count; |
|
68 }; |
|
69 |
|
70 static int |
|
71 SortPropertyAndCount(const void* s1, const void* s2, void *closure) |
|
72 { |
|
73 const PropertyAndCount *pc1 = static_cast<const PropertyAndCount*>(s1); |
|
74 const PropertyAndCount *pc2 = static_cast<const PropertyAndCount*>(s2); |
|
75 // Primary sort by count (lowest to highest) |
|
76 if (pc1->count != pc2->count) |
|
77 return pc1->count - pc2->count; |
|
78 // Secondary sort by property index (highest to lowest) |
|
79 return pc2->property - pc1->property; |
|
80 } |
|
81 |
|
82 // We need eCSSAliasCount so we can make gAliases nonzero size when there |
|
83 // are no aliases. |
|
84 enum { |
|
85 eCSSAliasCount = eCSSProperty_COUNT_with_aliases - eCSSProperty_COUNT |
|
86 }; |
|
87 |
|
88 // The names are in kCSSRawProperties. |
|
89 static nsCSSProperty gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = { |
|
90 #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \ |
|
91 eCSSProperty_##propid_ , |
|
92 #include "nsCSSPropAliasList.h" |
|
93 #undef CSS_PROP_ALIAS |
|
94 }; |
|
95 |
|
96 nsStaticCaseInsensitiveNameTable* |
|
97 CreateStaticTable(const char* const aRawTable[], int32_t aSize) |
|
98 { |
|
99 auto table = new nsStaticCaseInsensitiveNameTable(); |
|
100 if (table) { |
|
101 #ifdef DEBUG |
|
102 // let's verify the table... |
|
103 for (int32_t index = 0; index < aSize; ++index) { |
|
104 nsAutoCString temp1(aRawTable[index]); |
|
105 nsAutoCString temp2(aRawTable[index]); |
|
106 ToLowerCase(temp1); |
|
107 NS_ABORT_IF_FALSE(temp1.Equals(temp2), |
|
108 "upper case char in case insensitive name table"); |
|
109 NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'), |
|
110 "underscore char in case insensitive name table"); |
|
111 } |
|
112 #endif |
|
113 table->Init(aRawTable, aSize); |
|
114 } |
|
115 return table; |
|
116 } |
|
117 |
|
118 void |
|
119 nsCSSProps::AddRefTable(void) |
|
120 { |
|
121 if (0 == gPropertyTableRefCount++) { |
|
122 NS_ABORT_IF_FALSE(!gPropertyTable, "pre existing array!"); |
|
123 NS_ABORT_IF_FALSE(!gFontDescTable, "pre existing array!"); |
|
124 |
|
125 gPropertyTable = CreateStaticTable( |
|
126 kCSSRawProperties, eCSSProperty_COUNT_with_aliases); |
|
127 gFontDescTable = CreateStaticTable(kCSSRawFontDescs, eCSSFontDesc_COUNT); |
|
128 |
|
129 BuildShorthandsContainingTable(); |
|
130 |
|
131 static bool prefObserversInited = false; |
|
132 if (!prefObserversInited) { |
|
133 prefObserversInited = true; |
|
134 |
|
135 #define OBSERVE_PROP(pref_, id_) \ |
|
136 if (pref_[0]) { \ |
|
137 Preferences::AddBoolVarCache(&gPropertyEnabled[id_], \ |
|
138 pref_); \ |
|
139 } |
|
140 |
|
141 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ |
|
142 kwtable_, stylestruct_, stylestructoffset_, animtype_) \ |
|
143 OBSERVE_PROP(pref_, eCSSProperty_##id_) |
|
144 #include "nsCSSPropList.h" |
|
145 #undef CSS_PROP |
|
146 |
|
147 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ |
|
148 OBSERVE_PROP(pref_, eCSSProperty_##id_) |
|
149 #include "nsCSSPropList.h" |
|
150 #undef CSS_PROP_SHORTHAND |
|
151 |
|
152 #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \ |
|
153 OBSERVE_PROP(pref_, eCSSPropertyAlias_##aliasmethod_) |
|
154 #include "nsCSSPropAliasList.h" |
|
155 #undef CSS_PROP_ALIAS |
|
156 |
|
157 #undef OBSERVE_PROP |
|
158 } |
|
159 } |
|
160 } |
|
161 |
|
162 #undef DEBUG_SHORTHANDS_CONTAINING |
|
163 |
|
164 bool |
|
165 nsCSSProps::BuildShorthandsContainingTable() |
|
166 { |
|
167 uint32_t occurrenceCounts[eCSSProperty_COUNT_no_shorthands]; |
|
168 memset(occurrenceCounts, 0, sizeof(occurrenceCounts)); |
|
169 PropertyAndCount subpropCounts[eCSSProperty_COUNT - |
|
170 eCSSProperty_COUNT_no_shorthands]; |
|
171 for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands; |
|
172 shorthand < eCSSProperty_COUNT; |
|
173 shorthand = nsCSSProperty(shorthand + 1)) { |
|
174 #ifdef DEBUG_SHORTHANDS_CONTAINING |
|
175 printf("Considering shorthand property '%s'.\n", |
|
176 nsCSSProps::GetStringValue(shorthand).get()); |
|
177 #endif |
|
178 PropertyAndCount &subpropCountsEntry = |
|
179 subpropCounts[shorthand - eCSSProperty_COUNT_no_shorthands]; |
|
180 subpropCountsEntry.property = shorthand; |
|
181 subpropCountsEntry.count = 0; |
|
182 if (nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS)) { |
|
183 // Don't put shorthands that are acting as aliases in the |
|
184 // shorthands-containing lists. |
|
185 continue; |
|
186 } |
|
187 for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand); |
|
188 *subprops != eCSSProperty_UNKNOWN; |
|
189 ++subprops) { |
|
190 NS_ABORT_IF_FALSE(0 <= *subprops && |
|
191 *subprops < eCSSProperty_COUNT_no_shorthands, |
|
192 "subproperty must be a longhand"); |
|
193 ++occurrenceCounts[*subprops]; |
|
194 ++subpropCountsEntry.count; |
|
195 } |
|
196 } |
|
197 |
|
198 uint32_t poolEntries = 0; |
|
199 for (nsCSSProperty longhand = nsCSSProperty(0); |
|
200 longhand < eCSSProperty_COUNT_no_shorthands; |
|
201 longhand = nsCSSProperty(longhand + 1)) { |
|
202 uint32_t count = occurrenceCounts[longhand]; |
|
203 if (count > 0) |
|
204 // leave room for terminator |
|
205 poolEntries += count + 1; |
|
206 } |
|
207 |
|
208 gShorthandsContainingPool = new nsCSSProperty[poolEntries]; |
|
209 if (!gShorthandsContainingPool) |
|
210 return false; |
|
211 |
|
212 // Initialize all entries to point to their null-terminator. |
|
213 { |
|
214 nsCSSProperty *poolCursor = gShorthandsContainingPool - 1; |
|
215 nsCSSProperty *lastTerminator = |
|
216 gShorthandsContainingPool + poolEntries - 1; |
|
217 for (nsCSSProperty longhand = nsCSSProperty(0); |
|
218 longhand < eCSSProperty_COUNT_no_shorthands; |
|
219 longhand = nsCSSProperty(longhand + 1)) { |
|
220 uint32_t count = occurrenceCounts[longhand]; |
|
221 if (count > 0) { |
|
222 poolCursor += count + 1; |
|
223 gShorthandsContainingTable[longhand] = poolCursor; |
|
224 *poolCursor = eCSSProperty_UNKNOWN; |
|
225 } else { |
|
226 gShorthandsContainingTable[longhand] = lastTerminator; |
|
227 } |
|
228 } |
|
229 NS_ABORT_IF_FALSE(poolCursor == lastTerminator, "miscalculation"); |
|
230 } |
|
231 |
|
232 // Sort with lowest count at the start and highest at the end, and |
|
233 // within counts sort in reverse property index order. |
|
234 NS_QuickSort(&subpropCounts, ArrayLength(subpropCounts), |
|
235 sizeof(subpropCounts[0]), SortPropertyAndCount, nullptr); |
|
236 |
|
237 // Fill in all the entries in gShorthandsContainingTable |
|
238 for (const PropertyAndCount *shorthandAndCount = subpropCounts, |
|
239 *shorthandAndCountEnd = ArrayEnd(subpropCounts); |
|
240 shorthandAndCount < shorthandAndCountEnd; |
|
241 ++shorthandAndCount) { |
|
242 #ifdef DEBUG_SHORTHANDS_CONTAINING |
|
243 printf("Entering %u subprops for '%s'.\n", |
|
244 shorthandAndCount->count, |
|
245 nsCSSProps::GetStringValue(shorthandAndCount->property).get()); |
|
246 #endif |
|
247 if (nsCSSProps::PropHasFlags(shorthandAndCount->property, |
|
248 CSS_PROPERTY_IS_ALIAS)) { |
|
249 // Don't put shorthands that are acting as aliases in the |
|
250 // shorthands-containing lists. |
|
251 continue; |
|
252 } |
|
253 for (const nsCSSProperty* subprops = |
|
254 SubpropertyEntryFor(shorthandAndCount->property); |
|
255 *subprops != eCSSProperty_UNKNOWN; |
|
256 ++subprops) { |
|
257 *(--gShorthandsContainingTable[*subprops]) = shorthandAndCount->property; |
|
258 } |
|
259 } |
|
260 |
|
261 #ifdef DEBUG_SHORTHANDS_CONTAINING |
|
262 for (nsCSSProperty longhand = nsCSSProperty(0); |
|
263 longhand < eCSSProperty_COUNT_no_shorthands; |
|
264 longhand = nsCSSProperty(longhand + 1)) { |
|
265 printf("Property %s is in %d shorthands.\n", |
|
266 nsCSSProps::GetStringValue(longhand).get(), |
|
267 occurrenceCounts[longhand]); |
|
268 for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand); |
|
269 *shorthands != eCSSProperty_UNKNOWN; |
|
270 ++shorthands) { |
|
271 printf(" %s\n", nsCSSProps::GetStringValue(*shorthands).get()); |
|
272 } |
|
273 } |
|
274 #endif |
|
275 |
|
276 #ifdef DEBUG |
|
277 // Verify that all values that should be are present. |
|
278 for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands; |
|
279 shorthand < eCSSProperty_COUNT; |
|
280 shorthand = nsCSSProperty(shorthand + 1)) { |
|
281 if (nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS)) { |
|
282 // Don't put shorthands that are acting as aliases in the |
|
283 // shorthands-containing lists. |
|
284 continue; |
|
285 } |
|
286 for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand); |
|
287 *subprops != eCSSProperty_UNKNOWN; |
|
288 ++subprops) { |
|
289 uint32_t count = 0; |
|
290 for (const nsCSSProperty *shcont = ShorthandsContaining(*subprops); |
|
291 *shcont != eCSSProperty_UNKNOWN; |
|
292 ++shcont) { |
|
293 if (*shcont == shorthand) |
|
294 ++count; |
|
295 } |
|
296 NS_ABORT_IF_FALSE(count == 1, |
|
297 "subproperty of shorthand should have shorthand" |
|
298 " in its ShorthandsContaining() table"); |
|
299 } |
|
300 } |
|
301 |
|
302 // Verify that there are no extra values |
|
303 for (nsCSSProperty longhand = nsCSSProperty(0); |
|
304 longhand < eCSSProperty_COUNT_no_shorthands; |
|
305 longhand = nsCSSProperty(longhand + 1)) { |
|
306 for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand); |
|
307 *shorthands != eCSSProperty_UNKNOWN; |
|
308 ++shorthands) { |
|
309 uint32_t count = 0; |
|
310 for (const nsCSSProperty* subprops = SubpropertyEntryFor(*shorthands); |
|
311 *subprops != eCSSProperty_UNKNOWN; |
|
312 ++subprops) { |
|
313 if (*subprops == longhand) |
|
314 ++count; |
|
315 } |
|
316 NS_ABORT_IF_FALSE(count == 1, |
|
317 "longhand should be in subproperty table of " |
|
318 "property in its ShorthandsContaining() table"); |
|
319 } |
|
320 } |
|
321 #endif |
|
322 |
|
323 return true; |
|
324 } |
|
325 |
|
326 void |
|
327 nsCSSProps::ReleaseTable(void) |
|
328 { |
|
329 if (0 == --gPropertyTableRefCount) { |
|
330 delete gPropertyTable; |
|
331 gPropertyTable = nullptr; |
|
332 |
|
333 delete gFontDescTable; |
|
334 gFontDescTable = nullptr; |
|
335 |
|
336 delete [] gShorthandsContainingPool; |
|
337 gShorthandsContainingPool = nullptr; |
|
338 } |
|
339 } |
|
340 |
|
341 /* static */ bool |
|
342 nsCSSProps::IsInherited(nsCSSProperty aProperty) |
|
343 { |
|
344 MOZ_ASSERT(!IsShorthand(aProperty)); |
|
345 |
|
346 nsStyleStructID sid = kSIDTable[aProperty]; |
|
347 return nsCachedStyleData::IsInherited(sid); |
|
348 } |
|
349 |
|
350 /* static */ bool |
|
351 nsCSSProps::IsCustomPropertyName(const nsACString& aProperty) |
|
352 { |
|
353 // Custom properties don't need to have a character after the "--" prefix. |
|
354 return aProperty.Length() >= CSS_CUSTOM_NAME_PREFIX_LENGTH && |
|
355 StringBeginsWith(aProperty, NS_LITERAL_CSTRING("--")); |
|
356 } |
|
357 |
|
358 /* static */ bool |
|
359 nsCSSProps::IsCustomPropertyName(const nsAString& aProperty) |
|
360 { |
|
361 return aProperty.Length() >= CSS_CUSTOM_NAME_PREFIX_LENGTH && |
|
362 StringBeginsWith(aProperty, NS_LITERAL_STRING("--")); |
|
363 } |
|
364 |
|
365 nsCSSProperty |
|
366 nsCSSProps::LookupProperty(const nsACString& aProperty, |
|
367 EnabledState aEnabled) |
|
368 { |
|
369 NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref"); |
|
370 |
|
371 if (nsLayoutUtils::CSSVariablesEnabled() && |
|
372 IsCustomPropertyName(aProperty)) { |
|
373 return eCSSPropertyExtra_variable; |
|
374 } |
|
375 |
|
376 nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty)); |
|
377 if (MOZ_LIKELY(res < eCSSProperty_COUNT)) { |
|
378 if (res != eCSSProperty_UNKNOWN && !IsEnabled(res, aEnabled)) { |
|
379 res = eCSSProperty_UNKNOWN; |
|
380 } |
|
381 return res; |
|
382 } |
|
383 MOZ_ASSERT(eCSSAliasCount != 0, |
|
384 "'res' must be an alias at this point so we better have some!"); |
|
385 // We intentionally don't support eEnabledInUASheets or eEnabledInChromeOrCertifiedApp |
|
386 // for aliases yet because it's unlikely there will be a need for it. |
|
387 if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { |
|
388 res = gAliases[res - eCSSProperty_COUNT]; |
|
389 NS_ABORT_IF_FALSE(0 <= res && res < eCSSProperty_COUNT, |
|
390 "aliases must not point to other aliases"); |
|
391 if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { |
|
392 return res; |
|
393 } |
|
394 } |
|
395 return eCSSProperty_UNKNOWN; |
|
396 } |
|
397 |
|
398 nsCSSProperty |
|
399 nsCSSProps::LookupProperty(const nsAString& aProperty, EnabledState aEnabled) |
|
400 { |
|
401 if (nsLayoutUtils::CSSVariablesEnabled() && |
|
402 IsCustomPropertyName(aProperty)) { |
|
403 return eCSSPropertyExtra_variable; |
|
404 } |
|
405 |
|
406 // This is faster than converting and calling |
|
407 // LookupProperty(nsACString&). The table will do its own |
|
408 // converting and avoid a PromiseFlatCString() call. |
|
409 NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref"); |
|
410 nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty)); |
|
411 if (MOZ_LIKELY(res < eCSSProperty_COUNT)) { |
|
412 if (res != eCSSProperty_UNKNOWN && !IsEnabled(res, aEnabled)) { |
|
413 res = eCSSProperty_UNKNOWN; |
|
414 } |
|
415 return res; |
|
416 } |
|
417 MOZ_ASSERT(eCSSAliasCount != 0, |
|
418 "'res' must be an alias at this point so we better have some!"); |
|
419 // We intentionally don't support eEnabledInUASheets for aliases yet |
|
420 // because it's unlikely there will be a need for it. |
|
421 if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { |
|
422 res = gAliases[res - eCSSProperty_COUNT]; |
|
423 NS_ABORT_IF_FALSE(0 <= res && res < eCSSProperty_COUNT, |
|
424 "aliases must not point to other aliases"); |
|
425 if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { |
|
426 return res; |
|
427 } |
|
428 } |
|
429 return eCSSProperty_UNKNOWN; |
|
430 } |
|
431 |
|
432 nsCSSFontDesc |
|
433 nsCSSProps::LookupFontDesc(const nsACString& aFontDesc) |
|
434 { |
|
435 NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref"); |
|
436 return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); |
|
437 } |
|
438 |
|
439 nsCSSFontDesc |
|
440 nsCSSProps::LookupFontDesc(const nsAString& aFontDesc) |
|
441 { |
|
442 NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref"); |
|
443 nsCSSFontDesc which = nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); |
|
444 |
|
445 // font-variant-alternates enabled ==> layout.css.font-features.enabled is true |
|
446 bool fontFeaturesEnabled = |
|
447 nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates); |
|
448 |
|
449 // check for unprefixed font-feature-settings/font-language-override |
|
450 if (which == eCSSFontDesc_UNKNOWN && fontFeaturesEnabled) { |
|
451 nsAutoString prefixedProp; |
|
452 prefixedProp.AppendLiteral("-moz-"); |
|
453 prefixedProp.Append(aFontDesc); |
|
454 which = nsCSSFontDesc(gFontDescTable->Lookup(prefixedProp)); |
|
455 } |
|
456 return which; |
|
457 } |
|
458 |
|
459 const nsAFlatCString& |
|
460 nsCSSProps::GetStringValue(nsCSSProperty aProperty) |
|
461 { |
|
462 NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref"); |
|
463 if (gPropertyTable) { |
|
464 return gPropertyTable->GetStringValue(int32_t(aProperty)); |
|
465 } else { |
|
466 static nsDependentCString sNullStr(""); |
|
467 return sNullStr; |
|
468 } |
|
469 } |
|
470 |
|
471 const nsAFlatCString& |
|
472 nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID) |
|
473 { |
|
474 NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref"); |
|
475 if (gFontDescTable) { |
|
476 return gFontDescTable->GetStringValue(int32_t(aFontDescID)); |
|
477 } else { |
|
478 static nsDependentCString sNullStr(""); |
|
479 return sNullStr; |
|
480 } |
|
481 } |
|
482 |
|
483 nsCSSProperty |
|
484 nsCSSProps::OtherNameFor(nsCSSProperty aProperty) |
|
485 { |
|
486 switch (aProperty) { |
|
487 case eCSSProperty_border_left_color_value: |
|
488 return eCSSProperty_border_left_color; |
|
489 case eCSSProperty_border_left_style_value: |
|
490 return eCSSProperty_border_left_style; |
|
491 case eCSSProperty_border_left_width_value: |
|
492 return eCSSProperty_border_left_width; |
|
493 case eCSSProperty_border_right_color_value: |
|
494 return eCSSProperty_border_right_color; |
|
495 case eCSSProperty_border_right_style_value: |
|
496 return eCSSProperty_border_right_style; |
|
497 case eCSSProperty_border_right_width_value: |
|
498 return eCSSProperty_border_right_width; |
|
499 case eCSSProperty_margin_left_value: |
|
500 return eCSSProperty_margin_left; |
|
501 case eCSSProperty_margin_right_value: |
|
502 return eCSSProperty_margin_right; |
|
503 case eCSSProperty_padding_left_value: |
|
504 return eCSSProperty_padding_left; |
|
505 case eCSSProperty_padding_right_value: |
|
506 return eCSSProperty_padding_right; |
|
507 default: |
|
508 NS_ABORT_IF_FALSE(false, "bad caller"); |
|
509 } |
|
510 return eCSSProperty_UNKNOWN; |
|
511 } |
|
512 |
|
513 /***************************************************************************/ |
|
514 |
|
515 const KTableValue nsCSSProps::kAnimationDirectionKTable[] = { |
|
516 eCSSKeyword_normal, NS_STYLE_ANIMATION_DIRECTION_NORMAL, |
|
517 eCSSKeyword_reverse, NS_STYLE_ANIMATION_DIRECTION_REVERSE, |
|
518 eCSSKeyword_alternate, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE, |
|
519 eCSSKeyword_alternate_reverse, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE_REVERSE, |
|
520 eCSSKeyword_UNKNOWN,-1 |
|
521 }; |
|
522 |
|
523 const KTableValue nsCSSProps::kAnimationFillModeKTable[] = { |
|
524 eCSSKeyword_none, NS_STYLE_ANIMATION_FILL_MODE_NONE, |
|
525 eCSSKeyword_forwards, NS_STYLE_ANIMATION_FILL_MODE_FORWARDS, |
|
526 eCSSKeyword_backwards, NS_STYLE_ANIMATION_FILL_MODE_BACKWARDS, |
|
527 eCSSKeyword_both, NS_STYLE_ANIMATION_FILL_MODE_BOTH, |
|
528 eCSSKeyword_UNKNOWN,-1 |
|
529 }; |
|
530 |
|
531 const KTableValue nsCSSProps::kAnimationIterationCountKTable[] = { |
|
532 eCSSKeyword_infinite, NS_STYLE_ANIMATION_ITERATION_COUNT_INFINITE, |
|
533 eCSSKeyword_UNKNOWN,-1 |
|
534 }; |
|
535 |
|
536 const KTableValue nsCSSProps::kAnimationPlayStateKTable[] = { |
|
537 eCSSKeyword_running, NS_STYLE_ANIMATION_PLAY_STATE_RUNNING, |
|
538 eCSSKeyword_paused, NS_STYLE_ANIMATION_PLAY_STATE_PAUSED, |
|
539 eCSSKeyword_UNKNOWN,-1 |
|
540 }; |
|
541 |
|
542 const KTableValue nsCSSProps::kAppearanceKTable[] = { |
|
543 eCSSKeyword_none, NS_THEME_NONE, |
|
544 eCSSKeyword_button, NS_THEME_BUTTON, |
|
545 eCSSKeyword_radio, NS_THEME_RADIO, |
|
546 eCSSKeyword_checkbox, NS_THEME_CHECKBOX, |
|
547 eCSSKeyword_button_bevel, NS_THEME_BUTTON_BEVEL, |
|
548 eCSSKeyword_toolbox, NS_THEME_TOOLBOX, |
|
549 eCSSKeyword_toolbar, NS_THEME_TOOLBAR, |
|
550 eCSSKeyword_toolbarbutton, NS_THEME_TOOLBAR_BUTTON, |
|
551 eCSSKeyword_toolbargripper, NS_THEME_TOOLBAR_GRIPPER, |
|
552 eCSSKeyword_dualbutton, NS_THEME_TOOLBAR_DUAL_BUTTON, |
|
553 eCSSKeyword_toolbarbutton_dropdown, NS_THEME_TOOLBAR_BUTTON_DROPDOWN, |
|
554 eCSSKeyword_button_arrow_up, NS_THEME_BUTTON_ARROW_UP, |
|
555 eCSSKeyword_button_arrow_down, NS_THEME_BUTTON_ARROW_DOWN, |
|
556 eCSSKeyword_button_arrow_next, NS_THEME_BUTTON_ARROW_NEXT, |
|
557 eCSSKeyword_button_arrow_previous, NS_THEME_BUTTON_ARROW_PREVIOUS, |
|
558 eCSSKeyword_meterbar, NS_THEME_METERBAR, |
|
559 eCSSKeyword_meterchunk, NS_THEME_METERBAR_CHUNK, |
|
560 eCSSKeyword_number_input, NS_THEME_NUMBER_INPUT, |
|
561 eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR, |
|
562 eCSSKeyword_splitter, NS_THEME_SPLITTER, |
|
563 eCSSKeyword_statusbar, NS_THEME_STATUSBAR, |
|
564 eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL, |
|
565 eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL, |
|
566 eCSSKeyword_resizer, NS_THEME_RESIZER, |
|
567 eCSSKeyword_listbox, NS_THEME_LISTBOX, |
|
568 eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM, |
|
569 eCSSKeyword_treeview, NS_THEME_TREEVIEW, |
|
570 eCSSKeyword_treeitem, NS_THEME_TREEVIEW_TREEITEM, |
|
571 eCSSKeyword_treetwisty, NS_THEME_TREEVIEW_TWISTY, |
|
572 eCSSKeyword_treetwistyopen, NS_THEME_TREEVIEW_TWISTY_OPEN, |
|
573 eCSSKeyword_treeline, NS_THEME_TREEVIEW_LINE, |
|
574 eCSSKeyword_treeheader, NS_THEME_TREEVIEW_HEADER, |
|
575 eCSSKeyword_treeheadercell, NS_THEME_TREEVIEW_HEADER_CELL, |
|
576 eCSSKeyword_treeheadersortarrow, NS_THEME_TREEVIEW_HEADER_SORTARROW, |
|
577 eCSSKeyword_progressbar, NS_THEME_PROGRESSBAR, |
|
578 eCSSKeyword_progresschunk, NS_THEME_PROGRESSBAR_CHUNK, |
|
579 eCSSKeyword_progressbar_vertical, NS_THEME_PROGRESSBAR_VERTICAL, |
|
580 eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL, |
|
581 eCSSKeyword_tab, NS_THEME_TAB, |
|
582 eCSSKeyword_tabpanels, NS_THEME_TAB_PANELS, |
|
583 eCSSKeyword_tabpanel, NS_THEME_TAB_PANEL, |
|
584 eCSSKeyword_tab_scroll_arrow_back, NS_THEME_TAB_SCROLLARROW_BACK, |
|
585 eCSSKeyword_tab_scroll_arrow_forward, NS_THEME_TAB_SCROLLARROW_FORWARD, |
|
586 eCSSKeyword_tooltip, NS_THEME_TOOLTIP, |
|
587 eCSSKeyword_spinner, NS_THEME_SPINNER, |
|
588 eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON, |
|
589 eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON, |
|
590 eCSSKeyword_spinner_textfield, NS_THEME_SPINNER_TEXTFIELD, |
|
591 eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR, |
|
592 eCSSKeyword_scrollbar_small, NS_THEME_SCROLLBAR_SMALL, |
|
593 eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP, |
|
594 eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN, |
|
595 eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT, |
|
596 eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT, |
|
597 eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL, |
|
598 eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL, |
|
599 eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL, |
|
600 eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL, |
|
601 eCSSKeyword_textfield, NS_THEME_TEXTFIELD, |
|
602 eCSSKeyword_textfield_multiline, NS_THEME_TEXTFIELD_MULTILINE, |
|
603 eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET, |
|
604 eCSSKeyword_searchfield, NS_THEME_SEARCHFIELD, |
|
605 eCSSKeyword_menulist, NS_THEME_DROPDOWN, |
|
606 eCSSKeyword_menulist_button, NS_THEME_DROPDOWN_BUTTON, |
|
607 eCSSKeyword_menulist_text, NS_THEME_DROPDOWN_TEXT, |
|
608 eCSSKeyword_menulist_textfield, NS_THEME_DROPDOWN_TEXTFIELD, |
|
609 eCSSKeyword_range, NS_THEME_RANGE, |
|
610 eCSSKeyword_range_thumb, NS_THEME_RANGE_THUMB, |
|
611 eCSSKeyword_scale_horizontal, NS_THEME_SCALE_HORIZONTAL, |
|
612 eCSSKeyword_scale_vertical, NS_THEME_SCALE_VERTICAL, |
|
613 eCSSKeyword_scalethumb_horizontal, NS_THEME_SCALE_THUMB_HORIZONTAL, |
|
614 eCSSKeyword_scalethumb_vertical, NS_THEME_SCALE_THUMB_VERTICAL, |
|
615 eCSSKeyword_scalethumbstart, NS_THEME_SCALE_THUMB_START, |
|
616 eCSSKeyword_scalethumbend, NS_THEME_SCALE_THUMB_END, |
|
617 eCSSKeyword_scalethumbtick, NS_THEME_SCALE_TICK, |
|
618 eCSSKeyword_groupbox, NS_THEME_GROUPBOX, |
|
619 eCSSKeyword_checkbox_container, NS_THEME_CHECKBOX_CONTAINER, |
|
620 eCSSKeyword_radio_container, NS_THEME_RADIO_CONTAINER, |
|
621 eCSSKeyword_checkbox_label, NS_THEME_CHECKBOX_LABEL, |
|
622 eCSSKeyword_radio_label, NS_THEME_RADIO_LABEL, |
|
623 eCSSKeyword_button_focus, NS_THEME_BUTTON_FOCUS, |
|
624 eCSSKeyword_window, NS_THEME_WINDOW, |
|
625 eCSSKeyword_dialog, NS_THEME_DIALOG, |
|
626 eCSSKeyword_menubar, NS_THEME_MENUBAR, |
|
627 eCSSKeyword_menupopup, NS_THEME_MENUPOPUP, |
|
628 eCSSKeyword_menuitem, NS_THEME_MENUITEM, |
|
629 eCSSKeyword_checkmenuitem, NS_THEME_CHECKMENUITEM, |
|
630 eCSSKeyword_radiomenuitem, NS_THEME_RADIOMENUITEM, |
|
631 eCSSKeyword_menucheckbox, NS_THEME_MENUCHECKBOX, |
|
632 eCSSKeyword_menuradio, NS_THEME_MENURADIO, |
|
633 eCSSKeyword_menuseparator, NS_THEME_MENUSEPARATOR, |
|
634 eCSSKeyword_menuarrow, NS_THEME_MENUARROW, |
|
635 eCSSKeyword_menuimage, NS_THEME_MENUIMAGE, |
|
636 eCSSKeyword_menuitemtext, NS_THEME_MENUITEMTEXT, |
|
637 eCSSKeyword__moz_win_media_toolbox, NS_THEME_WIN_MEDIA_TOOLBOX, |
|
638 eCSSKeyword__moz_win_communications_toolbox, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX, |
|
639 eCSSKeyword__moz_win_browsertabbar_toolbox, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX, |
|
640 eCSSKeyword__moz_win_glass, NS_THEME_WIN_GLASS, |
|
641 eCSSKeyword__moz_win_borderless_glass, NS_THEME_WIN_BORDERLESS_GLASS, |
|
642 eCSSKeyword__moz_mac_unified_toolbar, NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR, |
|
643 eCSSKeyword__moz_mac_fullscreen_button, NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON, |
|
644 eCSSKeyword__moz_mac_help_button, NS_THEME_MOZ_MAC_HELP_BUTTON, |
|
645 eCSSKeyword__moz_window_titlebar, NS_THEME_WINDOW_TITLEBAR, |
|
646 eCSSKeyword__moz_window_titlebar_maximized, NS_THEME_WINDOW_TITLEBAR_MAXIMIZED, |
|
647 eCSSKeyword__moz_window_frame_left, NS_THEME_WINDOW_FRAME_LEFT, |
|
648 eCSSKeyword__moz_window_frame_right, NS_THEME_WINDOW_FRAME_RIGHT, |
|
649 eCSSKeyword__moz_window_frame_bottom, NS_THEME_WINDOW_FRAME_BOTTOM, |
|
650 eCSSKeyword__moz_window_button_close, NS_THEME_WINDOW_BUTTON_CLOSE, |
|
651 eCSSKeyword__moz_window_button_minimize, NS_THEME_WINDOW_BUTTON_MINIMIZE, |
|
652 eCSSKeyword__moz_window_button_maximize, NS_THEME_WINDOW_BUTTON_MAXIMIZE, |
|
653 eCSSKeyword__moz_window_button_restore, NS_THEME_WINDOW_BUTTON_RESTORE, |
|
654 eCSSKeyword__moz_window_button_box, NS_THEME_WINDOW_BUTTON_BOX, |
|
655 eCSSKeyword__moz_window_button_box_maximized, NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED, |
|
656 eCSSKeyword__moz_win_exclude_glass, NS_THEME_WIN_EXCLUDE_GLASS, |
|
657 eCSSKeyword_UNKNOWN,-1 |
|
658 }; |
|
659 |
|
660 const KTableValue nsCSSProps::kBackfaceVisibilityKTable[] = { |
|
661 eCSSKeyword_visible, NS_STYLE_BACKFACE_VISIBILITY_VISIBLE, |
|
662 eCSSKeyword_hidden, NS_STYLE_BACKFACE_VISIBILITY_HIDDEN, |
|
663 eCSSKeyword_UNKNOWN,-1 |
|
664 }; |
|
665 |
|
666 const KTableValue nsCSSProps::kTransformStyleKTable[] = { |
|
667 eCSSKeyword_flat, NS_STYLE_TRANSFORM_STYLE_FLAT, |
|
668 eCSSKeyword_preserve_3d, NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D, |
|
669 eCSSKeyword_UNKNOWN,-1 |
|
670 }; |
|
671 |
|
672 const KTableValue nsCSSProps::kBackgroundAttachmentKTable[] = { |
|
673 eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED, |
|
674 eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL, |
|
675 eCSSKeyword_local, NS_STYLE_BG_ATTACHMENT_LOCAL, |
|
676 eCSSKeyword_UNKNOWN,-1 |
|
677 }; |
|
678 |
|
679 const KTableValue nsCSSProps::kBackgroundInlinePolicyKTable[] = { |
|
680 eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX, |
|
681 eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS, |
|
682 eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX, |
|
683 eCSSKeyword_UNKNOWN,-1 |
|
684 }; |
|
685 |
|
686 static_assert(NS_STYLE_BG_CLIP_BORDER == NS_STYLE_BG_ORIGIN_BORDER && |
|
687 NS_STYLE_BG_CLIP_PADDING == NS_STYLE_BG_ORIGIN_PADDING && |
|
688 NS_STYLE_BG_CLIP_CONTENT == NS_STYLE_BG_ORIGIN_CONTENT, |
|
689 "bg-clip and bg-origin style constants must agree"); |
|
690 const KTableValue nsCSSProps::kBackgroundOriginKTable[] = { |
|
691 eCSSKeyword_border_box, NS_STYLE_BG_ORIGIN_BORDER, |
|
692 eCSSKeyword_padding_box, NS_STYLE_BG_ORIGIN_PADDING, |
|
693 eCSSKeyword_content_box, NS_STYLE_BG_ORIGIN_CONTENT, |
|
694 eCSSKeyword_UNKNOWN,-1 |
|
695 }; |
|
696 |
|
697 // Note: Don't change this table unless you update |
|
698 // parseBackgroundPosition! |
|
699 |
|
700 const KTableValue nsCSSProps::kBackgroundPositionKTable[] = { |
|
701 eCSSKeyword_center, NS_STYLE_BG_POSITION_CENTER, |
|
702 eCSSKeyword_top, NS_STYLE_BG_POSITION_TOP, |
|
703 eCSSKeyword_bottom, NS_STYLE_BG_POSITION_BOTTOM, |
|
704 eCSSKeyword_left, NS_STYLE_BG_POSITION_LEFT, |
|
705 eCSSKeyword_right, NS_STYLE_BG_POSITION_RIGHT, |
|
706 eCSSKeyword_UNKNOWN,-1 |
|
707 }; |
|
708 |
|
709 const KTableValue nsCSSProps::kBackgroundRepeatKTable[] = { |
|
710 eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_NO_REPEAT, |
|
711 eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_REPEAT, |
|
712 eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_REPEAT_X, |
|
713 eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_REPEAT_Y, |
|
714 eCSSKeyword_UNKNOWN,-1 |
|
715 }; |
|
716 |
|
717 const KTableValue nsCSSProps::kBackgroundRepeatPartKTable[] = { |
|
718 eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_NO_REPEAT, |
|
719 eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_REPEAT, |
|
720 eCSSKeyword_UNKNOWN,-1 |
|
721 }; |
|
722 |
|
723 const KTableValue nsCSSProps::kBackgroundSizeKTable[] = { |
|
724 eCSSKeyword_contain, NS_STYLE_BG_SIZE_CONTAIN, |
|
725 eCSSKeyword_cover, NS_STYLE_BG_SIZE_COVER, |
|
726 eCSSKeyword_UNKNOWN,-1 |
|
727 }; |
|
728 |
|
729 const KTableValue nsCSSProps::kBlendModeKTable[] = { |
|
730 eCSSKeyword_normal, NS_STYLE_BLEND_NORMAL, |
|
731 eCSSKeyword_multiply, NS_STYLE_BLEND_MULTIPLY, |
|
732 eCSSKeyword_screen, NS_STYLE_BLEND_SCREEN, |
|
733 eCSSKeyword_overlay, NS_STYLE_BLEND_OVERLAY, |
|
734 eCSSKeyword_darken, NS_STYLE_BLEND_DARKEN, |
|
735 eCSSKeyword_lighten, NS_STYLE_BLEND_LIGHTEN, |
|
736 eCSSKeyword_color_dodge, NS_STYLE_BLEND_COLOR_DODGE, |
|
737 eCSSKeyword_color_burn, NS_STYLE_BLEND_COLOR_BURN, |
|
738 eCSSKeyword_hard_light, NS_STYLE_BLEND_HARD_LIGHT, |
|
739 eCSSKeyword_soft_light, NS_STYLE_BLEND_SOFT_LIGHT, |
|
740 eCSSKeyword_difference, NS_STYLE_BLEND_DIFFERENCE, |
|
741 eCSSKeyword_exclusion, NS_STYLE_BLEND_EXCLUSION, |
|
742 eCSSKeyword_hue, NS_STYLE_BLEND_HUE, |
|
743 eCSSKeyword_saturation, NS_STYLE_BLEND_SATURATION, |
|
744 eCSSKeyword_color, NS_STYLE_BLEND_COLOR, |
|
745 eCSSKeyword_luminosity, NS_STYLE_BLEND_LUMINOSITY, |
|
746 eCSSKeyword_UNKNOWN,-1 |
|
747 }; |
|
748 |
|
749 const KTableValue nsCSSProps::kBorderCollapseKTable[] = { |
|
750 eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE, |
|
751 eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE, |
|
752 eCSSKeyword_UNKNOWN,-1 |
|
753 }; |
|
754 |
|
755 const KTableValue nsCSSProps::kBorderColorKTable[] = { |
|
756 eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, |
|
757 eCSSKeyword_UNKNOWN,-1 |
|
758 }; |
|
759 |
|
760 const KTableValue nsCSSProps::kBorderImageRepeatKTable[] = { |
|
761 eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH, |
|
762 eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT, |
|
763 eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_REPEAT_ROUND, |
|
764 eCSSKeyword_UNKNOWN,-1 |
|
765 }; |
|
766 |
|
767 const KTableValue nsCSSProps::kBorderImageSliceKTable[] = { |
|
768 eCSSKeyword_fill, NS_STYLE_BORDER_IMAGE_SLICE_FILL, |
|
769 eCSSKeyword_UNKNOWN,-1 |
|
770 }; |
|
771 |
|
772 const KTableValue nsCSSProps::kBorderStyleKTable[] = { |
|
773 eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE, |
|
774 eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN, |
|
775 eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED, |
|
776 eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED, |
|
777 eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID, |
|
778 eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE, |
|
779 eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE, |
|
780 eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE, |
|
781 eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET, |
|
782 eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET, |
|
783 eCSSKeyword_UNKNOWN,-1 |
|
784 }; |
|
785 |
|
786 const KTableValue nsCSSProps::kBorderWidthKTable[] = { |
|
787 eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN, |
|
788 eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM, |
|
789 eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK, |
|
790 eCSSKeyword_UNKNOWN,-1 |
|
791 }; |
|
792 |
|
793 const KTableValue nsCSSProps::kBoxPropSourceKTable[] = { |
|
794 eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL, |
|
795 eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL, |
|
796 eCSSKeyword_UNKNOWN,-1 |
|
797 }; |
|
798 |
|
799 const KTableValue nsCSSProps::kBoxShadowTypeKTable[] = { |
|
800 eCSSKeyword_inset, NS_STYLE_BOX_SHADOW_INSET, |
|
801 eCSSKeyword_UNKNOWN,-1 |
|
802 }; |
|
803 |
|
804 const KTableValue nsCSSProps::kBoxSizingKTable[] = { |
|
805 eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT, |
|
806 eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER, |
|
807 eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING, |
|
808 eCSSKeyword_UNKNOWN,-1 |
|
809 }; |
|
810 |
|
811 const KTableValue nsCSSProps::kCaptionSideKTable[] = { |
|
812 eCSSKeyword_top, NS_STYLE_CAPTION_SIDE_TOP, |
|
813 eCSSKeyword_right, NS_STYLE_CAPTION_SIDE_RIGHT, |
|
814 eCSSKeyword_bottom, NS_STYLE_CAPTION_SIDE_BOTTOM, |
|
815 eCSSKeyword_left, NS_STYLE_CAPTION_SIDE_LEFT, |
|
816 eCSSKeyword_top_outside, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE, |
|
817 eCSSKeyword_bottom_outside, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE, |
|
818 eCSSKeyword_UNKNOWN, -1 |
|
819 }; |
|
820 |
|
821 const KTableValue nsCSSProps::kClearKTable[] = { |
|
822 eCSSKeyword_none, NS_STYLE_CLEAR_NONE, |
|
823 eCSSKeyword_left, NS_STYLE_CLEAR_LEFT, |
|
824 eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT, |
|
825 eCSSKeyword_both, NS_STYLE_CLEAR_BOTH, |
|
826 eCSSKeyword_UNKNOWN,-1 |
|
827 }; |
|
828 |
|
829 // See also kContextPatternKTable for SVG paint-specific values |
|
830 const KTableValue nsCSSProps::kColorKTable[] = { |
|
831 eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder, |
|
832 eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption, |
|
833 eCSSKeyword_appworkspace, LookAndFeel::eColorID_appworkspace, |
|
834 eCSSKeyword_background, LookAndFeel::eColorID_background, |
|
835 eCSSKeyword_buttonface, LookAndFeel::eColorID_buttonface, |
|
836 eCSSKeyword_buttonhighlight, LookAndFeel::eColorID_buttonhighlight, |
|
837 eCSSKeyword_buttonshadow, LookAndFeel::eColorID_buttonshadow, |
|
838 eCSSKeyword_buttontext, LookAndFeel::eColorID_buttontext, |
|
839 eCSSKeyword_captiontext, LookAndFeel::eColorID_captiontext, |
|
840 eCSSKeyword_graytext, LookAndFeel::eColorID_graytext, |
|
841 eCSSKeyword_highlight, LookAndFeel::eColorID_highlight, |
|
842 eCSSKeyword_highlighttext, LookAndFeel::eColorID_highlighttext, |
|
843 eCSSKeyword_inactiveborder, LookAndFeel::eColorID_inactiveborder, |
|
844 eCSSKeyword_inactivecaption, LookAndFeel::eColorID_inactivecaption, |
|
845 eCSSKeyword_inactivecaptiontext, LookAndFeel::eColorID_inactivecaptiontext, |
|
846 eCSSKeyword_infobackground, LookAndFeel::eColorID_infobackground, |
|
847 eCSSKeyword_infotext, LookAndFeel::eColorID_infotext, |
|
848 eCSSKeyword_menu, LookAndFeel::eColorID_menu, |
|
849 eCSSKeyword_menutext, LookAndFeel::eColorID_menutext, |
|
850 eCSSKeyword_scrollbar, LookAndFeel::eColorID_scrollbar, |
|
851 eCSSKeyword_threeddarkshadow, LookAndFeel::eColorID_threeddarkshadow, |
|
852 eCSSKeyword_threedface, LookAndFeel::eColorID_threedface, |
|
853 eCSSKeyword_threedhighlight, LookAndFeel::eColorID_threedhighlight, |
|
854 eCSSKeyword_threedlightshadow, LookAndFeel::eColorID_threedlightshadow, |
|
855 eCSSKeyword_threedshadow, LookAndFeel::eColorID_threedshadow, |
|
856 eCSSKeyword_window, LookAndFeel::eColorID_window, |
|
857 eCSSKeyword_windowframe, LookAndFeel::eColorID_windowframe, |
|
858 eCSSKeyword_windowtext, LookAndFeel::eColorID_windowtext, |
|
859 eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT, |
|
860 eCSSKeyword__moz_buttondefault, LookAndFeel::eColorID__moz_buttondefault, |
|
861 eCSSKeyword__moz_buttonhoverface, LookAndFeel::eColorID__moz_buttonhoverface, |
|
862 eCSSKeyword__moz_buttonhovertext, LookAndFeel::eColorID__moz_buttonhovertext, |
|
863 eCSSKeyword__moz_cellhighlight, LookAndFeel::eColorID__moz_cellhighlight, |
|
864 eCSSKeyword__moz_cellhighlighttext, LookAndFeel::eColorID__moz_cellhighlighttext, |
|
865 eCSSKeyword__moz_eventreerow, LookAndFeel::eColorID__moz_eventreerow, |
|
866 eCSSKeyword__moz_field, LookAndFeel::eColorID__moz_field, |
|
867 eCSSKeyword__moz_fieldtext, LookAndFeel::eColorID__moz_fieldtext, |
|
868 eCSSKeyword__moz_default_background_color, NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR, |
|
869 eCSSKeyword__moz_default_color, NS_COLOR_MOZ_DEFAULT_COLOR, |
|
870 eCSSKeyword__moz_dialog, LookAndFeel::eColorID__moz_dialog, |
|
871 eCSSKeyword__moz_dialogtext, LookAndFeel::eColorID__moz_dialogtext, |
|
872 eCSSKeyword__moz_dragtargetzone, LookAndFeel::eColorID__moz_dragtargetzone, |
|
873 eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT, |
|
874 eCSSKeyword__moz_html_cellhighlight, LookAndFeel::eColorID__moz_html_cellhighlight, |
|
875 eCSSKeyword__moz_html_cellhighlighttext, LookAndFeel::eColorID__moz_html_cellhighlighttext, |
|
876 eCSSKeyword__moz_mac_chrome_active, LookAndFeel::eColorID__moz_mac_chrome_active, |
|
877 eCSSKeyword__moz_mac_chrome_inactive, LookAndFeel::eColorID__moz_mac_chrome_inactive, |
|
878 eCSSKeyword__moz_mac_focusring, LookAndFeel::eColorID__moz_mac_focusring, |
|
879 eCSSKeyword__moz_mac_menuselect, LookAndFeel::eColorID__moz_mac_menuselect, |
|
880 eCSSKeyword__moz_mac_menushadow, LookAndFeel::eColorID__moz_mac_menushadow, |
|
881 eCSSKeyword__moz_mac_menutextdisable, LookAndFeel::eColorID__moz_mac_menutextdisable, |
|
882 eCSSKeyword__moz_mac_menutextselect, LookAndFeel::eColorID__moz_mac_menutextselect, |
|
883 eCSSKeyword__moz_mac_disabledtoolbartext, LookAndFeel::eColorID__moz_mac_disabledtoolbartext, |
|
884 eCSSKeyword__moz_mac_secondaryhighlight, LookAndFeel::eColorID__moz_mac_secondaryhighlight, |
|
885 eCSSKeyword__moz_menuhover, LookAndFeel::eColorID__moz_menuhover, |
|
886 eCSSKeyword__moz_menuhovertext, LookAndFeel::eColorID__moz_menuhovertext, |
|
887 eCSSKeyword__moz_menubartext, LookAndFeel::eColorID__moz_menubartext, |
|
888 eCSSKeyword__moz_menubarhovertext, LookAndFeel::eColorID__moz_menubarhovertext, |
|
889 eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow, |
|
890 eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT, |
|
891 eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR, |
|
892 eCSSKeyword__moz_win_mediatext, LookAndFeel::eColorID__moz_win_mediatext, |
|
893 eCSSKeyword__moz_win_communicationstext, LookAndFeel::eColorID__moz_win_communicationstext, |
|
894 eCSSKeyword__moz_nativehyperlinktext, LookAndFeel::eColorID__moz_nativehyperlinktext, |
|
895 eCSSKeyword__moz_comboboxtext, LookAndFeel::eColorID__moz_comboboxtext, |
|
896 eCSSKeyword__moz_combobox, LookAndFeel::eColorID__moz_combobox, |
|
897 eCSSKeyword_UNKNOWN,-1 |
|
898 }; |
|
899 |
|
900 const KTableValue nsCSSProps::kContentKTable[] = { |
|
901 eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE, |
|
902 eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE, |
|
903 eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE, |
|
904 eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE, |
|
905 eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT, |
|
906 eCSSKeyword_UNKNOWN,-1 |
|
907 }; |
|
908 |
|
909 const KTableValue nsCSSProps::kControlCharacterVisibilityKTable[] = { |
|
910 eCSSKeyword_hidden, NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN, |
|
911 eCSSKeyword_visible, NS_STYLE_CONTROL_CHARACTER_VISIBILITY_VISIBLE, |
|
912 eCSSKeyword_UNKNOWN,-1 |
|
913 }; |
|
914 |
|
915 const KTableValue nsCSSProps::kCursorKTable[] = { |
|
916 // CSS 2.0 |
|
917 eCSSKeyword_auto, NS_STYLE_CURSOR_AUTO, |
|
918 eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR, |
|
919 eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT, |
|
920 eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER, |
|
921 eCSSKeyword_move, NS_STYLE_CURSOR_MOVE, |
|
922 eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE, |
|
923 eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE, |
|
924 eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE, |
|
925 eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE, |
|
926 eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE, |
|
927 eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE, |
|
928 eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE, |
|
929 eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE, |
|
930 eCSSKeyword_text, NS_STYLE_CURSOR_TEXT, |
|
931 eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT, |
|
932 eCSSKeyword_help, NS_STYLE_CURSOR_HELP, |
|
933 // CSS 2.1 |
|
934 eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING, |
|
935 // CSS3 basic user interface module |
|
936 eCSSKeyword_copy, NS_STYLE_CURSOR_COPY, |
|
937 eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS, |
|
938 eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU, |
|
939 eCSSKeyword_cell, NS_STYLE_CURSOR_CELL, |
|
940 eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED, |
|
941 eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE, |
|
942 eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE, |
|
943 eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP, |
|
944 eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT, |
|
945 eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL, |
|
946 eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE, |
|
947 eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE, |
|
948 eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE, |
|
949 eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE, |
|
950 eCSSKeyword_none, NS_STYLE_CURSOR_NONE, |
|
951 eCSSKeyword_grab, NS_STYLE_CURSOR_GRAB, |
|
952 eCSSKeyword_grabbing, NS_STYLE_CURSOR_GRABBING, |
|
953 eCSSKeyword_zoom_in, NS_STYLE_CURSOR_ZOOM_IN, |
|
954 eCSSKeyword_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT, |
|
955 // -moz- prefixed vendor specific |
|
956 eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB, |
|
957 eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING, |
|
958 eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_ZOOM_IN, |
|
959 eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT, |
|
960 eCSSKeyword_UNKNOWN,-1 |
|
961 }; |
|
962 |
|
963 const KTableValue nsCSSProps::kDirectionKTable[] = { |
|
964 eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR, |
|
965 eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL, |
|
966 eCSSKeyword_UNKNOWN,-1 |
|
967 }; |
|
968 |
|
969 KTableValue nsCSSProps::kDisplayKTable[] = { |
|
970 eCSSKeyword_none, NS_STYLE_DISPLAY_NONE, |
|
971 eCSSKeyword_inline, NS_STYLE_DISPLAY_INLINE, |
|
972 eCSSKeyword_block, NS_STYLE_DISPLAY_BLOCK, |
|
973 eCSSKeyword_inline_block, NS_STYLE_DISPLAY_INLINE_BLOCK, |
|
974 eCSSKeyword_list_item, NS_STYLE_DISPLAY_LIST_ITEM, |
|
975 eCSSKeyword_table, NS_STYLE_DISPLAY_TABLE, |
|
976 eCSSKeyword_inline_table, NS_STYLE_DISPLAY_INLINE_TABLE, |
|
977 eCSSKeyword_table_row_group, NS_STYLE_DISPLAY_TABLE_ROW_GROUP, |
|
978 eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP, |
|
979 eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP, |
|
980 eCSSKeyword_table_row, NS_STYLE_DISPLAY_TABLE_ROW, |
|
981 eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP, |
|
982 eCSSKeyword_table_column, NS_STYLE_DISPLAY_TABLE_COLUMN, |
|
983 eCSSKeyword_table_cell, NS_STYLE_DISPLAY_TABLE_CELL, |
|
984 eCSSKeyword_table_caption, NS_STYLE_DISPLAY_TABLE_CAPTION, |
|
985 // Make sure this is kept in sync with the code in |
|
986 // nsCSSFrameConstructor::ConstructXULFrame |
|
987 eCSSKeyword__moz_box, NS_STYLE_DISPLAY_BOX, |
|
988 eCSSKeyword__moz_inline_box, NS_STYLE_DISPLAY_INLINE_BOX, |
|
989 #ifdef MOZ_XUL |
|
990 eCSSKeyword__moz_grid, NS_STYLE_DISPLAY_XUL_GRID, |
|
991 eCSSKeyword__moz_inline_grid, NS_STYLE_DISPLAY_INLINE_XUL_GRID, |
|
992 eCSSKeyword__moz_grid_group, NS_STYLE_DISPLAY_XUL_GRID_GROUP, |
|
993 eCSSKeyword__moz_grid_line, NS_STYLE_DISPLAY_XUL_GRID_LINE, |
|
994 eCSSKeyword__moz_stack, NS_STYLE_DISPLAY_STACK, |
|
995 eCSSKeyword__moz_inline_stack, NS_STYLE_DISPLAY_INLINE_STACK, |
|
996 eCSSKeyword__moz_deck, NS_STYLE_DISPLAY_DECK, |
|
997 eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP, |
|
998 eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX, |
|
999 #endif |
|
1000 eCSSKeyword_flex, NS_STYLE_DISPLAY_FLEX, |
|
1001 eCSSKeyword_inline_flex, NS_STYLE_DISPLAY_INLINE_FLEX, |
|
1002 // The next two entries are controlled by the layout.css.grid.enabled pref. |
|
1003 eCSSKeyword_grid, NS_STYLE_DISPLAY_GRID, |
|
1004 eCSSKeyword_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID, |
|
1005 eCSSKeyword_UNKNOWN,-1 |
|
1006 }; |
|
1007 |
|
1008 const KTableValue nsCSSProps::kEmptyCellsKTable[] = { |
|
1009 eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW, |
|
1010 eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE, |
|
1011 eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND, |
|
1012 eCSSKeyword_UNKNOWN,-1 |
|
1013 }; |
|
1014 |
|
1015 const KTableValue nsCSSProps::kAlignContentKTable[] = { |
|
1016 eCSSKeyword_flex_start, NS_STYLE_ALIGN_CONTENT_FLEX_START, |
|
1017 eCSSKeyword_flex_end, NS_STYLE_ALIGN_CONTENT_FLEX_END, |
|
1018 eCSSKeyword_center, NS_STYLE_ALIGN_CONTENT_CENTER, |
|
1019 eCSSKeyword_space_between, NS_STYLE_ALIGN_CONTENT_SPACE_BETWEEN, |
|
1020 eCSSKeyword_space_around, NS_STYLE_ALIGN_CONTENT_SPACE_AROUND, |
|
1021 eCSSKeyword_stretch, NS_STYLE_ALIGN_CONTENT_STRETCH, |
|
1022 eCSSKeyword_UNKNOWN,-1 |
|
1023 }; |
|
1024 |
|
1025 const KTableValue nsCSSProps::kAlignItemsKTable[] = { |
|
1026 eCSSKeyword_flex_start, NS_STYLE_ALIGN_ITEMS_FLEX_START, |
|
1027 eCSSKeyword_flex_end, NS_STYLE_ALIGN_ITEMS_FLEX_END, |
|
1028 eCSSKeyword_center, NS_STYLE_ALIGN_ITEMS_CENTER, |
|
1029 eCSSKeyword_baseline, NS_STYLE_ALIGN_ITEMS_BASELINE, |
|
1030 eCSSKeyword_stretch, NS_STYLE_ALIGN_ITEMS_STRETCH, |
|
1031 eCSSKeyword_UNKNOWN,-1 |
|
1032 }; |
|
1033 |
|
1034 // Note: 'align-self' takes the same keywords as 'align-items', plus 'auto'. |
|
1035 const KTableValue nsCSSProps::kAlignSelfKTable[] = { |
|
1036 eCSSKeyword_flex_start, NS_STYLE_ALIGN_ITEMS_FLEX_START, |
|
1037 eCSSKeyword_flex_end, NS_STYLE_ALIGN_ITEMS_FLEX_END, |
|
1038 eCSSKeyword_center, NS_STYLE_ALIGN_ITEMS_CENTER, |
|
1039 eCSSKeyword_baseline, NS_STYLE_ALIGN_ITEMS_BASELINE, |
|
1040 eCSSKeyword_stretch, NS_STYLE_ALIGN_ITEMS_STRETCH, |
|
1041 eCSSKeyword_auto, NS_STYLE_ALIGN_SELF_AUTO, |
|
1042 eCSSKeyword_UNKNOWN,-1 |
|
1043 }; |
|
1044 |
|
1045 const KTableValue nsCSSProps::kFlexDirectionKTable[] = { |
|
1046 eCSSKeyword_row, NS_STYLE_FLEX_DIRECTION_ROW, |
|
1047 eCSSKeyword_row_reverse, NS_STYLE_FLEX_DIRECTION_ROW_REVERSE, |
|
1048 eCSSKeyword_column, NS_STYLE_FLEX_DIRECTION_COLUMN, |
|
1049 eCSSKeyword_column_reverse, NS_STYLE_FLEX_DIRECTION_COLUMN_REVERSE, |
|
1050 eCSSKeyword_UNKNOWN,-1 |
|
1051 }; |
|
1052 |
|
1053 const KTableValue nsCSSProps::kFlexWrapKTable[] = { |
|
1054 eCSSKeyword_nowrap, NS_STYLE_FLEX_WRAP_NOWRAP, |
|
1055 eCSSKeyword_wrap, NS_STYLE_FLEX_WRAP_WRAP, |
|
1056 eCSSKeyword_wrap_reverse, NS_STYLE_FLEX_WRAP_WRAP_REVERSE, |
|
1057 eCSSKeyword_UNKNOWN,-1 |
|
1058 }; |
|
1059 |
|
1060 const KTableValue nsCSSProps::kJustifyContentKTable[] = { |
|
1061 eCSSKeyword_flex_start, NS_STYLE_JUSTIFY_CONTENT_FLEX_START, |
|
1062 eCSSKeyword_flex_end, NS_STYLE_JUSTIFY_CONTENT_FLEX_END, |
|
1063 eCSSKeyword_center, NS_STYLE_JUSTIFY_CONTENT_CENTER, |
|
1064 eCSSKeyword_space_between, NS_STYLE_JUSTIFY_CONTENT_SPACE_BETWEEN, |
|
1065 eCSSKeyword_space_around, NS_STYLE_JUSTIFY_CONTENT_SPACE_AROUND, |
|
1066 eCSSKeyword_UNKNOWN,-1 |
|
1067 }; |
|
1068 |
|
1069 const KTableValue nsCSSProps::kFloatKTable[] = { |
|
1070 eCSSKeyword_none, NS_STYLE_FLOAT_NONE, |
|
1071 eCSSKeyword_left, NS_STYLE_FLOAT_LEFT, |
|
1072 eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT, |
|
1073 eCSSKeyword_UNKNOWN,-1 |
|
1074 }; |
|
1075 |
|
1076 const KTableValue nsCSSProps::kFloatEdgeKTable[] = { |
|
1077 eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT, |
|
1078 eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN, |
|
1079 eCSSKeyword_UNKNOWN,-1 |
|
1080 }; |
|
1081 |
|
1082 const KTableValue nsCSSProps::kFontKTable[] = { |
|
1083 // CSS2. |
|
1084 eCSSKeyword_caption, NS_STYLE_FONT_CAPTION, |
|
1085 eCSSKeyword_icon, NS_STYLE_FONT_ICON, |
|
1086 eCSSKeyword_menu, NS_STYLE_FONT_MENU, |
|
1087 eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX, |
|
1088 eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION, |
|
1089 eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR, |
|
1090 |
|
1091 // Proposed for CSS3. |
|
1092 eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW, |
|
1093 eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT, |
|
1094 eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE, |
|
1095 eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP, |
|
1096 eCSSKeyword__moz_info, NS_STYLE_FONT_INFO, |
|
1097 eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG, |
|
1098 eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON, |
|
1099 eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU, |
|
1100 eCSSKeyword__moz_list, NS_STYLE_FONT_LIST, |
|
1101 eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD, |
|
1102 eCSSKeyword_UNKNOWN,-1 |
|
1103 }; |
|
1104 |
|
1105 const KTableValue nsCSSProps::kFontKerningKTable[] = { |
|
1106 eCSSKeyword_auto, NS_FONT_KERNING_AUTO, |
|
1107 eCSSKeyword_none, NS_FONT_KERNING_NONE, |
|
1108 eCSSKeyword_normal, NS_FONT_KERNING_NORMAL, |
|
1109 eCSSKeyword_UNKNOWN,-1 |
|
1110 }; |
|
1111 |
|
1112 const KTableValue nsCSSProps::kFontSizeKTable[] = { |
|
1113 eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL, |
|
1114 eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL, |
|
1115 eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL, |
|
1116 eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM, |
|
1117 eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE, |
|
1118 eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE, |
|
1119 eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE, |
|
1120 eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER, |
|
1121 eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER, |
|
1122 eCSSKeyword_UNKNOWN,-1 |
|
1123 }; |
|
1124 |
|
1125 const KTableValue nsCSSProps::kFontSmoothingKTable[] = { |
|
1126 eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO, |
|
1127 eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE, |
|
1128 eCSSKeyword_UNKNOWN,-1 |
|
1129 }; |
|
1130 |
|
1131 const KTableValue nsCSSProps::kFontStretchKTable[] = { |
|
1132 eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED, |
|
1133 eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED, |
|
1134 eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED, |
|
1135 eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED, |
|
1136 eCSSKeyword_normal, NS_STYLE_FONT_STRETCH_NORMAL, |
|
1137 eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED, |
|
1138 eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED, |
|
1139 eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED, |
|
1140 eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED, |
|
1141 eCSSKeyword_UNKNOWN,-1 |
|
1142 }; |
|
1143 |
|
1144 const KTableValue nsCSSProps::kFontStyleKTable[] = { |
|
1145 eCSSKeyword_normal, NS_STYLE_FONT_STYLE_NORMAL, |
|
1146 eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC, |
|
1147 eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE, |
|
1148 eCSSKeyword_UNKNOWN,-1 |
|
1149 }; |
|
1150 |
|
1151 const KTableValue nsCSSProps::kFontSynthesisKTable[] = { |
|
1152 eCSSKeyword_weight, NS_FONT_SYNTHESIS_WEIGHT, |
|
1153 eCSSKeyword_style, NS_FONT_SYNTHESIS_STYLE, |
|
1154 eCSSKeyword_UNKNOWN,-1 |
|
1155 }; |
|
1156 |
|
1157 |
|
1158 const KTableValue nsCSSProps::kFontVariantKTable[] = { |
|
1159 eCSSKeyword_normal, NS_STYLE_FONT_VARIANT_NORMAL, |
|
1160 eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS, |
|
1161 eCSSKeyword_UNKNOWN,-1 |
|
1162 }; |
|
1163 |
|
1164 const KTableValue nsCSSProps::kFontVariantAlternatesKTable[] = { |
|
1165 eCSSKeyword_historical_forms, NS_FONT_VARIANT_ALTERNATES_HISTORICAL, |
|
1166 eCSSKeyword_UNKNOWN,-1 |
|
1167 }; |
|
1168 |
|
1169 const KTableValue nsCSSProps::kFontVariantAlternatesFuncsKTable[] = { |
|
1170 eCSSKeyword_stylistic, NS_FONT_VARIANT_ALTERNATES_STYLISTIC, |
|
1171 eCSSKeyword_styleset, NS_FONT_VARIANT_ALTERNATES_STYLESET, |
|
1172 eCSSKeyword_character_variant, NS_FONT_VARIANT_ALTERNATES_CHARACTER_VARIANT, |
|
1173 eCSSKeyword_swash, NS_FONT_VARIANT_ALTERNATES_SWASH, |
|
1174 eCSSKeyword_ornaments, NS_FONT_VARIANT_ALTERNATES_ORNAMENTS, |
|
1175 eCSSKeyword_annotation, NS_FONT_VARIANT_ALTERNATES_ANNOTATION, |
|
1176 eCSSKeyword_UNKNOWN,-1 |
|
1177 }; |
|
1178 |
|
1179 const KTableValue nsCSSProps::kFontVariantCapsKTable[] = { |
|
1180 eCSSKeyword_small_caps, NS_FONT_VARIANT_CAPS_SMALLCAPS, |
|
1181 eCSSKeyword_all_small_caps, NS_FONT_VARIANT_CAPS_ALLSMALL, |
|
1182 eCSSKeyword_petite_caps, NS_FONT_VARIANT_CAPS_PETITECAPS, |
|
1183 eCSSKeyword_all_petite_caps, NS_FONT_VARIANT_CAPS_ALLPETITE, |
|
1184 eCSSKeyword_titling_caps, NS_FONT_VARIANT_CAPS_TITLING, |
|
1185 eCSSKeyword_unicase, NS_FONT_VARIANT_CAPS_UNICASE, |
|
1186 eCSSKeyword_UNKNOWN,-1 |
|
1187 }; |
|
1188 |
|
1189 const KTableValue nsCSSProps::kFontVariantEastAsianKTable[] = { |
|
1190 eCSSKeyword_jis78, NS_FONT_VARIANT_EAST_ASIAN_JIS78, |
|
1191 eCSSKeyword_jis83, NS_FONT_VARIANT_EAST_ASIAN_JIS83, |
|
1192 eCSSKeyword_jis90, NS_FONT_VARIANT_EAST_ASIAN_JIS90, |
|
1193 eCSSKeyword_jis04, NS_FONT_VARIANT_EAST_ASIAN_JIS04, |
|
1194 eCSSKeyword_simplified, NS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED, |
|
1195 eCSSKeyword_traditional, NS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL, |
|
1196 eCSSKeyword_full_width, NS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH, |
|
1197 eCSSKeyword_proportional_width, NS_FONT_VARIANT_EAST_ASIAN_PROP_WIDTH, |
|
1198 eCSSKeyword_ruby, NS_FONT_VARIANT_EAST_ASIAN_RUBY, |
|
1199 eCSSKeyword_UNKNOWN,-1 |
|
1200 }; |
|
1201 |
|
1202 const KTableValue nsCSSProps::kFontVariantLigaturesKTable[] = { |
|
1203 eCSSKeyword_none, NS_FONT_VARIANT_LIGATURES_NONE, |
|
1204 eCSSKeyword_common_ligatures, NS_FONT_VARIANT_LIGATURES_COMMON, |
|
1205 eCSSKeyword_no_common_ligatures, NS_FONT_VARIANT_LIGATURES_NO_COMMON, |
|
1206 eCSSKeyword_discretionary_ligatures, NS_FONT_VARIANT_LIGATURES_DISCRETIONARY, |
|
1207 eCSSKeyword_no_discretionary_ligatures, NS_FONT_VARIANT_LIGATURES_NO_DISCRETIONARY, |
|
1208 eCSSKeyword_historical_ligatures, NS_FONT_VARIANT_LIGATURES_HISTORICAL, |
|
1209 eCSSKeyword_no_historical_ligatures, NS_FONT_VARIANT_LIGATURES_NO_HISTORICAL, |
|
1210 eCSSKeyword_contextual, NS_FONT_VARIANT_LIGATURES_CONTEXTUAL, |
|
1211 eCSSKeyword_no_contextual, NS_FONT_VARIANT_LIGATURES_NO_CONTEXTUAL, |
|
1212 eCSSKeyword_UNKNOWN,-1 |
|
1213 }; |
|
1214 |
|
1215 const KTableValue nsCSSProps::kFontVariantNumericKTable[] = { |
|
1216 eCSSKeyword_lining_nums, NS_FONT_VARIANT_NUMERIC_LINING, |
|
1217 eCSSKeyword_oldstyle_nums, NS_FONT_VARIANT_NUMERIC_OLDSTYLE, |
|
1218 eCSSKeyword_proportional_nums, NS_FONT_VARIANT_NUMERIC_PROPORTIONAL, |
|
1219 eCSSKeyword_tabular_nums, NS_FONT_VARIANT_NUMERIC_TABULAR, |
|
1220 eCSSKeyword_diagonal_fractions, NS_FONT_VARIANT_NUMERIC_DIAGONAL_FRACTIONS, |
|
1221 eCSSKeyword_stacked_fractions, NS_FONT_VARIANT_NUMERIC_STACKED_FRACTIONS, |
|
1222 eCSSKeyword_slashed_zero, NS_FONT_VARIANT_NUMERIC_SLASHZERO, |
|
1223 eCSSKeyword_ordinal, NS_FONT_VARIANT_NUMERIC_ORDINAL, |
|
1224 eCSSKeyword_UNKNOWN,-1 |
|
1225 }; |
|
1226 |
|
1227 const KTableValue nsCSSProps::kFontVariantPositionKTable[] = { |
|
1228 eCSSKeyword_super, NS_FONT_VARIANT_POSITION_SUPER, |
|
1229 eCSSKeyword_sub, NS_FONT_VARIANT_POSITION_SUB, |
|
1230 eCSSKeyword_UNKNOWN,-1 |
|
1231 }; |
|
1232 |
|
1233 const KTableValue nsCSSProps::kFontWeightKTable[] = { |
|
1234 eCSSKeyword_normal, NS_STYLE_FONT_WEIGHT_NORMAL, |
|
1235 eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD, |
|
1236 eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER, |
|
1237 eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER, |
|
1238 eCSSKeyword_UNKNOWN,-1 |
|
1239 }; |
|
1240 |
|
1241 const KTableValue nsCSSProps::kGridAutoFlowKTable[] = { |
|
1242 eCSSKeyword_none, NS_STYLE_GRID_AUTO_FLOW_NONE, |
|
1243 eCSSKeyword_column, NS_STYLE_GRID_AUTO_FLOW_COLUMN, |
|
1244 eCSSKeyword_row, NS_STYLE_GRID_AUTO_FLOW_ROW, |
|
1245 eCSSKeyword_dense, NS_STYLE_GRID_AUTO_FLOW_DENSE, |
|
1246 eCSSKeyword_UNKNOWN,-1 |
|
1247 }; |
|
1248 |
|
1249 const KTableValue nsCSSProps::kGridTrackBreadthKTable[] = { |
|
1250 eCSSKeyword_min_content, NS_STYLE_GRID_TRACK_BREADTH_MIN_CONTENT, |
|
1251 eCSSKeyword_max_content, NS_STYLE_GRID_TRACK_BREADTH_MAX_CONTENT, |
|
1252 eCSSKeyword_UNKNOWN,-1 |
|
1253 }; |
|
1254 |
|
1255 const KTableValue nsCSSProps::kImageOrientationKTable[] = { |
|
1256 eCSSKeyword_flip, NS_STYLE_IMAGE_ORIENTATION_FLIP, |
|
1257 eCSSKeyword_from_image, NS_STYLE_IMAGE_ORIENTATION_FROM_IMAGE, |
|
1258 eCSSKeyword_UNKNOWN,-1 |
|
1259 }; |
|
1260 |
|
1261 const KTableValue nsCSSProps::kImageOrientationFlipKTable[] = { |
|
1262 eCSSKeyword_flip, NS_STYLE_IMAGE_ORIENTATION_FLIP, |
|
1263 eCSSKeyword_UNKNOWN,-1 |
|
1264 }; |
|
1265 |
|
1266 const KTableValue nsCSSProps::kIMEModeKTable[] = { |
|
1267 eCSSKeyword_normal, NS_STYLE_IME_MODE_NORMAL, |
|
1268 eCSSKeyword_auto, NS_STYLE_IME_MODE_AUTO, |
|
1269 eCSSKeyword_active, NS_STYLE_IME_MODE_ACTIVE, |
|
1270 eCSSKeyword_disabled, NS_STYLE_IME_MODE_DISABLED, |
|
1271 eCSSKeyword_inactive, NS_STYLE_IME_MODE_INACTIVE, |
|
1272 eCSSKeyword_UNKNOWN,-1 |
|
1273 }; |
|
1274 |
|
1275 const KTableValue nsCSSProps::kLineHeightKTable[] = { |
|
1276 // -moz- prefixed, intended for internal use for single-line controls |
|
1277 eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT, |
|
1278 eCSSKeyword_UNKNOWN,-1 |
|
1279 }; |
|
1280 |
|
1281 const KTableValue nsCSSProps::kListStylePositionKTable[] = { |
|
1282 eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE, |
|
1283 eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE, |
|
1284 eCSSKeyword_UNKNOWN,-1 |
|
1285 }; |
|
1286 |
|
1287 const KTableValue nsCSSProps::kListStyleKTable[] = { |
|
1288 eCSSKeyword_none, NS_STYLE_LIST_STYLE_NONE, |
|
1289 eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC, |
|
1290 eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE, |
|
1291 eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE, |
|
1292 eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL, |
|
1293 eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO, |
|
1294 eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN, |
|
1295 eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN, |
|
1296 eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK, |
|
1297 eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA, |
|
1298 eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN, |
|
1299 eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA, |
|
1300 eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN, |
|
1301 eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW, |
|
1302 eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN, |
|
1303 eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN, |
|
1304 eCSSKeyword_cjk_decimal, NS_STYLE_LIST_STYLE_CJK_DECIMAL, |
|
1305 eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC, |
|
1306 eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA, |
|
1307 eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA, |
|
1308 eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA, |
|
1309 eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA, |
|
1310 eCSSKeyword_japanese_informal, NS_STYLE_LIST_STYLE_JAPANESE_INFORMAL, |
|
1311 eCSSKeyword_japanese_formal, NS_STYLE_LIST_STYLE_JAPANESE_FORMAL, |
|
1312 eCSSKeyword_korean_hangul_formal, NS_STYLE_LIST_STYLE_KOREAN_HANGUL_FORMAL, |
|
1313 eCSSKeyword_korean_hanja_informal, NS_STYLE_LIST_STYLE_KOREAN_HANJA_INFORMAL, |
|
1314 eCSSKeyword_korean_hanja_formal, NS_STYLE_LIST_STYLE_KOREAN_HANJA_FORMAL, |
|
1315 eCSSKeyword_simp_chinese_informal, NS_STYLE_LIST_STYLE_SIMP_CHINESE_INFORMAL, |
|
1316 eCSSKeyword_simp_chinese_formal, NS_STYLE_LIST_STYLE_SIMP_CHINESE_FORMAL, |
|
1317 eCSSKeyword_trad_chinese_informal, NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL, |
|
1318 eCSSKeyword_trad_chinese_formal, NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL, |
|
1319 eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM, |
|
1320 eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH, |
|
1321 eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL, |
|
1322 eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL, |
|
1323 eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL, |
|
1324 eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL, |
|
1325 eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL, |
|
1326 eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL, |
|
1327 eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC, |
|
1328 eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN, |
|
1329 eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU, |
|
1330 eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI, |
|
1331 eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI, |
|
1332 eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI, |
|
1333 eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA, |
|
1334 eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA, |
|
1335 eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM, |
|
1336 eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI, |
|
1337 eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL, |
|
1338 eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU, |
|
1339 eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI, |
|
1340 eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO, |
|
1341 eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR, |
|
1342 eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER, |
|
1343 eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL, |
|
1344 eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT, |
|
1345 eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME, |
|
1346 eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC, |
|
1347 eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM, |
|
1348 eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER, |
|
1349 eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET, |
|
1350 eCSSKeyword_UNKNOWN,-1 |
|
1351 }; |
|
1352 |
|
1353 const KTableValue nsCSSProps::kMathVariantKTable[] = { |
|
1354 eCSSKeyword_none, NS_MATHML_MATHVARIANT_NONE, |
|
1355 eCSSKeyword_normal, NS_MATHML_MATHVARIANT_NORMAL, |
|
1356 eCSSKeyword_bold, NS_MATHML_MATHVARIANT_BOLD, |
|
1357 eCSSKeyword_italic, NS_MATHML_MATHVARIANT_ITALIC, |
|
1358 eCSSKeyword_bold_italic, NS_MATHML_MATHVARIANT_BOLD_ITALIC, |
|
1359 eCSSKeyword_script, NS_MATHML_MATHVARIANT_SCRIPT, |
|
1360 eCSSKeyword_bold_script, NS_MATHML_MATHVARIANT_BOLD_SCRIPT, |
|
1361 eCSSKeyword_fraktur, NS_MATHML_MATHVARIANT_FRAKTUR, |
|
1362 eCSSKeyword_double_struck, NS_MATHML_MATHVARIANT_DOUBLE_STRUCK, |
|
1363 eCSSKeyword_bold_fraktur, NS_MATHML_MATHVARIANT_BOLD_FRAKTUR, |
|
1364 eCSSKeyword_sans_serif, NS_MATHML_MATHVARIANT_SANS_SERIF, |
|
1365 eCSSKeyword_bold_sans_serif, NS_MATHML_MATHVARIANT_BOLD_SANS_SERIF, |
|
1366 eCSSKeyword_sans_serif_italic, NS_MATHML_MATHVARIANT_SANS_SERIF_ITALIC, |
|
1367 eCSSKeyword_sans_serif_bold_italic, NS_MATHML_MATHVARIANT_SANS_SERIF_BOLD_ITALIC, |
|
1368 eCSSKeyword_monospace, NS_MATHML_MATHVARIANT_MONOSPACE, |
|
1369 eCSSKeyword_initial, NS_MATHML_MATHVARIANT_INITIAL, |
|
1370 eCSSKeyword_tailed, NS_MATHML_MATHVARIANT_TAILED, |
|
1371 eCSSKeyword_looped, NS_MATHML_MATHVARIANT_LOOPED, |
|
1372 eCSSKeyword_stretched, NS_MATHML_MATHVARIANT_STRETCHED, |
|
1373 eCSSKeyword_UNKNOWN,-1 |
|
1374 }; |
|
1375 |
|
1376 const KTableValue nsCSSProps::kMathDisplayKTable[] = { |
|
1377 eCSSKeyword_inline, NS_MATHML_DISPLAYSTYLE_INLINE, |
|
1378 eCSSKeyword_block, NS_MATHML_DISPLAYSTYLE_BLOCK, |
|
1379 eCSSKeyword_UNKNOWN,-1 |
|
1380 }; |
|
1381 |
|
1382 const KTableValue nsCSSProps::kContextOpacityKTable[] = { |
|
1383 eCSSKeyword_context_fill_opacity, NS_STYLE_CONTEXT_FILL_OPACITY, |
|
1384 eCSSKeyword_context_stroke_opacity, NS_STYLE_CONTEXT_STROKE_OPACITY, |
|
1385 eCSSKeyword_UNKNOWN,-1 |
|
1386 }; |
|
1387 |
|
1388 const KTableValue nsCSSProps::kContextPatternKTable[] = { |
|
1389 eCSSKeyword_context_fill, NS_COLOR_CONTEXT_FILL, |
|
1390 eCSSKeyword_context_stroke, NS_COLOR_CONTEXT_STROKE, |
|
1391 eCSSKeyword_UNKNOWN,-1 |
|
1392 }; |
|
1393 |
|
1394 const KTableValue nsCSSProps::kOrientKTable[] = { |
|
1395 eCSSKeyword_horizontal, NS_STYLE_ORIENT_HORIZONTAL, |
|
1396 eCSSKeyword_vertical, NS_STYLE_ORIENT_VERTICAL, |
|
1397 eCSSKeyword_auto, NS_STYLE_ORIENT_AUTO, |
|
1398 eCSSKeyword_UNKNOWN, -1 |
|
1399 }; |
|
1400 |
|
1401 // Same as kBorderStyleKTable except 'hidden'. |
|
1402 const KTableValue nsCSSProps::kOutlineStyleKTable[] = { |
|
1403 eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE, |
|
1404 eCSSKeyword_auto, NS_STYLE_BORDER_STYLE_AUTO, |
|
1405 eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED, |
|
1406 eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED, |
|
1407 eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID, |
|
1408 eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE, |
|
1409 eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE, |
|
1410 eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE, |
|
1411 eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET, |
|
1412 eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET, |
|
1413 eCSSKeyword_UNKNOWN,-1 |
|
1414 }; |
|
1415 |
|
1416 const KTableValue nsCSSProps::kOutlineColorKTable[] = { |
|
1417 eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, |
|
1418 eCSSKeyword_UNKNOWN,-1 |
|
1419 }; |
|
1420 |
|
1421 const KTableValue nsCSSProps::kOverflowKTable[] = { |
|
1422 eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO, |
|
1423 eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE, |
|
1424 eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN, |
|
1425 eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL, |
|
1426 // Deprecated: |
|
1427 eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN, |
|
1428 eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL, |
|
1429 eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL, |
|
1430 eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP, |
|
1431 eCSSKeyword_UNKNOWN,-1 |
|
1432 }; |
|
1433 |
|
1434 const KTableValue nsCSSProps::kOverflowClipBoxKTable[] = { |
|
1435 eCSSKeyword_padding_box, NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX, |
|
1436 eCSSKeyword_content_box, NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX, |
|
1437 eCSSKeyword_UNKNOWN,-1 |
|
1438 }; |
|
1439 |
|
1440 const KTableValue nsCSSProps::kOverflowSubKTable[] = { |
|
1441 eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO, |
|
1442 eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE, |
|
1443 eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN, |
|
1444 eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL, |
|
1445 // Deprecated: |
|
1446 eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP, |
|
1447 eCSSKeyword_UNKNOWN,-1 |
|
1448 }; |
|
1449 |
|
1450 const KTableValue nsCSSProps::kPageBreakKTable[] = { |
|
1451 eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO, |
|
1452 eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS, |
|
1453 eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID, |
|
1454 eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT, |
|
1455 eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT, |
|
1456 eCSSKeyword_UNKNOWN,-1 |
|
1457 }; |
|
1458 |
|
1459 const KTableValue nsCSSProps::kPageBreakInsideKTable[] = { |
|
1460 eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO, |
|
1461 eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID, |
|
1462 eCSSKeyword_UNKNOWN,-1 |
|
1463 }; |
|
1464 |
|
1465 const KTableValue nsCSSProps::kPageMarksKTable[] = { |
|
1466 eCSSKeyword_none, NS_STYLE_PAGE_MARKS_NONE, |
|
1467 eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP, |
|
1468 eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER, |
|
1469 eCSSKeyword_UNKNOWN,-1 |
|
1470 }; |
|
1471 |
|
1472 const KTableValue nsCSSProps::kPageSizeKTable[] = { |
|
1473 eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE, |
|
1474 eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT, |
|
1475 eCSSKeyword_UNKNOWN,-1 |
|
1476 }; |
|
1477 |
|
1478 const KTableValue nsCSSProps::kPointerEventsKTable[] = { |
|
1479 eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE, |
|
1480 eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED, |
|
1481 eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL, |
|
1482 eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE, |
|
1483 eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE, |
|
1484 eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED, |
|
1485 eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL, |
|
1486 eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE, |
|
1487 eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL, |
|
1488 eCSSKeyword_auto, NS_STYLE_POINTER_EVENTS_AUTO, |
|
1489 eCSSKeyword_UNKNOWN, -1 |
|
1490 }; |
|
1491 |
|
1492 KTableValue nsCSSProps::kPositionKTable[] = { |
|
1493 eCSSKeyword_static, NS_STYLE_POSITION_STATIC, |
|
1494 eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE, |
|
1495 eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE, |
|
1496 eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED, |
|
1497 // The next entry is controlled by the layout.css.sticky.enabled pref. |
|
1498 eCSSKeyword_sticky, NS_STYLE_POSITION_STICKY, |
|
1499 eCSSKeyword_UNKNOWN,-1 |
|
1500 }; |
|
1501 |
|
1502 const KTableValue nsCSSProps::kRadialGradientShapeKTable[] = { |
|
1503 eCSSKeyword_circle, NS_STYLE_GRADIENT_SHAPE_CIRCULAR, |
|
1504 eCSSKeyword_ellipse, NS_STYLE_GRADIENT_SHAPE_ELLIPTICAL, |
|
1505 eCSSKeyword_UNKNOWN,-1 |
|
1506 }; |
|
1507 |
|
1508 const KTableValue nsCSSProps::kRadialGradientSizeKTable[] = { |
|
1509 eCSSKeyword_closest_side, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, |
|
1510 eCSSKeyword_closest_corner, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER, |
|
1511 eCSSKeyword_farthest_side, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE, |
|
1512 eCSSKeyword_farthest_corner, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, |
|
1513 eCSSKeyword_UNKNOWN,-1 |
|
1514 }; |
|
1515 |
|
1516 const KTableValue nsCSSProps::kRadialGradientLegacySizeKTable[] = { |
|
1517 eCSSKeyword_closest_side, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, |
|
1518 eCSSKeyword_closest_corner, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER, |
|
1519 eCSSKeyword_farthest_side, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE, |
|
1520 eCSSKeyword_farthest_corner, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, |
|
1521 // synonyms |
|
1522 eCSSKeyword_contain, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, |
|
1523 eCSSKeyword_cover, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, |
|
1524 eCSSKeyword_UNKNOWN,-1 |
|
1525 }; |
|
1526 |
|
1527 const KTableValue nsCSSProps::kResizeKTable[] = { |
|
1528 eCSSKeyword_none, NS_STYLE_RESIZE_NONE, |
|
1529 eCSSKeyword_both, NS_STYLE_RESIZE_BOTH, |
|
1530 eCSSKeyword_horizontal, NS_STYLE_RESIZE_HORIZONTAL, |
|
1531 eCSSKeyword_vertical, NS_STYLE_RESIZE_VERTICAL, |
|
1532 eCSSKeyword_UNKNOWN,-1 |
|
1533 }; |
|
1534 |
|
1535 const KTableValue nsCSSProps::kStackSizingKTable[] = { |
|
1536 eCSSKeyword_ignore, NS_STYLE_STACK_SIZING_IGNORE, |
|
1537 eCSSKeyword_stretch_to_fit, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT, |
|
1538 eCSSKeyword_UNKNOWN,-1 |
|
1539 }; |
|
1540 |
|
1541 const KTableValue nsCSSProps::kTableLayoutKTable[] = { |
|
1542 eCSSKeyword_auto, NS_STYLE_TABLE_LAYOUT_AUTO, |
|
1543 eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED, |
|
1544 eCSSKeyword_UNKNOWN,-1 |
|
1545 }; |
|
1546 |
|
1547 KTableValue nsCSSProps::kTextAlignKTable[] = { |
|
1548 eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT, |
|
1549 eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT, |
|
1550 eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER, |
|
1551 eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY, |
|
1552 eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER, |
|
1553 eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT, |
|
1554 eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT, |
|
1555 eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT, |
|
1556 eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END, |
|
1557 eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE, |
|
1558 eCSSKeyword_UNKNOWN,-1 |
|
1559 }; |
|
1560 |
|
1561 KTableValue nsCSSProps::kTextAlignLastKTable[] = { |
|
1562 eCSSKeyword_auto, NS_STYLE_TEXT_ALIGN_AUTO, |
|
1563 eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT, |
|
1564 eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT, |
|
1565 eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER, |
|
1566 eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY, |
|
1567 eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT, |
|
1568 eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END, |
|
1569 eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE, |
|
1570 eCSSKeyword_UNKNOWN,-1 |
|
1571 }; |
|
1572 |
|
1573 const KTableValue nsCSSProps::kTextCombineUprightKTable[] = { |
|
1574 eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE, |
|
1575 eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL, |
|
1576 eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2, // w/o number ==> 2 |
|
1577 eCSSKeyword_UNKNOWN,-1 |
|
1578 }; |
|
1579 |
|
1580 const KTableValue nsCSSProps::kTextDecorationLineKTable[] = { |
|
1581 eCSSKeyword_none, NS_STYLE_TEXT_DECORATION_LINE_NONE, |
|
1582 eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE, |
|
1583 eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_LINE_OVERLINE, |
|
1584 eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH, |
|
1585 eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_LINE_BLINK, |
|
1586 eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_LINE_PREF_ANCHORS, |
|
1587 eCSSKeyword_UNKNOWN,-1 |
|
1588 }; |
|
1589 |
|
1590 const KTableValue nsCSSProps::kTextDecorationStyleKTable[] = { |
|
1591 eCSSKeyword__moz_none, NS_STYLE_TEXT_DECORATION_STYLE_NONE, |
|
1592 eCSSKeyword_solid, NS_STYLE_TEXT_DECORATION_STYLE_SOLID, |
|
1593 eCSSKeyword_double, NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE, |
|
1594 eCSSKeyword_dotted, NS_STYLE_TEXT_DECORATION_STYLE_DOTTED, |
|
1595 eCSSKeyword_dashed, NS_STYLE_TEXT_DECORATION_STYLE_DASHED, |
|
1596 eCSSKeyword_wavy, NS_STYLE_TEXT_DECORATION_STYLE_WAVY, |
|
1597 eCSSKeyword_UNKNOWN,-1 |
|
1598 }; |
|
1599 |
|
1600 const KTableValue nsCSSProps::kTextOrientationKTable[] = { |
|
1601 eCSSKeyword_auto, NS_STYLE_TEXT_ORIENTATION_AUTO, |
|
1602 eCSSKeyword_upright, NS_STYLE_TEXT_ORIENTATION_UPRIGHT, |
|
1603 eCSSKeyword_sideways, NS_STYLE_TEXT_ORIENTATION_SIDEWAYS, |
|
1604 eCSSKeyword_UNKNOWN, -1 |
|
1605 }; |
|
1606 |
|
1607 const KTableValue nsCSSProps::kTextOverflowKTable[] = { |
|
1608 eCSSKeyword_clip, NS_STYLE_TEXT_OVERFLOW_CLIP, |
|
1609 eCSSKeyword_ellipsis, NS_STYLE_TEXT_OVERFLOW_ELLIPSIS, |
|
1610 eCSSKeyword_UNKNOWN, -1 |
|
1611 }; |
|
1612 |
|
1613 const KTableValue nsCSSProps::kTextTransformKTable[] = { |
|
1614 eCSSKeyword_none, NS_STYLE_TEXT_TRANSFORM_NONE, |
|
1615 eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE, |
|
1616 eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE, |
|
1617 eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE, |
|
1618 eCSSKeyword_full_width, NS_STYLE_TEXT_TRANSFORM_FULLWIDTH, |
|
1619 eCSSKeyword_UNKNOWN,-1 |
|
1620 }; |
|
1621 |
|
1622 const KTableValue nsCSSProps::kTouchActionKTable[] = { |
|
1623 eCSSKeyword_none, NS_STYLE_TOUCH_ACTION_NONE, |
|
1624 eCSSKeyword_auto, NS_STYLE_TOUCH_ACTION_AUTO, |
|
1625 eCSSKeyword_pan_x, NS_STYLE_TOUCH_ACTION_PAN_X, |
|
1626 eCSSKeyword_pan_y, NS_STYLE_TOUCH_ACTION_PAN_Y, |
|
1627 eCSSKeyword_manipulation, NS_STYLE_TOUCH_ACTION_MANIPULATION, |
|
1628 eCSSKeyword_UNKNOWN, -1 |
|
1629 }; |
|
1630 |
|
1631 const KTableValue nsCSSProps::kTransitionTimingFunctionKTable[] = { |
|
1632 eCSSKeyword_ease, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE, |
|
1633 eCSSKeyword_linear, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR, |
|
1634 eCSSKeyword_ease_in, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN, |
|
1635 eCSSKeyword_ease_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_OUT, |
|
1636 eCSSKeyword_ease_in_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT, |
|
1637 eCSSKeyword_step_start, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START, |
|
1638 eCSSKeyword_step_end, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END, |
|
1639 eCSSKeyword_UNKNOWN,-1 |
|
1640 }; |
|
1641 |
|
1642 const KTableValue nsCSSProps::kUnicodeBidiKTable[] = { |
|
1643 eCSSKeyword_normal, NS_STYLE_UNICODE_BIDI_NORMAL, |
|
1644 eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED, |
|
1645 eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE, |
|
1646 eCSSKeyword__moz_isolate, NS_STYLE_UNICODE_BIDI_ISOLATE, |
|
1647 eCSSKeyword__moz_isolate_override, NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE, |
|
1648 eCSSKeyword__moz_plaintext, NS_STYLE_UNICODE_BIDI_PLAINTEXT, |
|
1649 eCSSKeyword_UNKNOWN,-1 |
|
1650 }; |
|
1651 |
|
1652 const KTableValue nsCSSProps::kUserFocusKTable[] = { |
|
1653 eCSSKeyword_none, NS_STYLE_USER_FOCUS_NONE, |
|
1654 eCSSKeyword_normal, NS_STYLE_USER_FOCUS_NORMAL, |
|
1655 eCSSKeyword_ignore, NS_STYLE_USER_FOCUS_IGNORE, |
|
1656 eCSSKeyword_select_all, NS_STYLE_USER_FOCUS_SELECT_ALL, |
|
1657 eCSSKeyword_select_before, NS_STYLE_USER_FOCUS_SELECT_BEFORE, |
|
1658 eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER, |
|
1659 eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME, |
|
1660 eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU, |
|
1661 eCSSKeyword_UNKNOWN,-1 |
|
1662 }; |
|
1663 |
|
1664 const KTableValue nsCSSProps::kUserInputKTable[] = { |
|
1665 eCSSKeyword_none, NS_STYLE_USER_INPUT_NONE, |
|
1666 eCSSKeyword_auto, NS_STYLE_USER_INPUT_AUTO, |
|
1667 eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED, |
|
1668 eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED, |
|
1669 eCSSKeyword_UNKNOWN,-1 |
|
1670 }; |
|
1671 |
|
1672 const KTableValue nsCSSProps::kUserModifyKTable[] = { |
|
1673 eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY, |
|
1674 eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE, |
|
1675 eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY, |
|
1676 eCSSKeyword_UNKNOWN,-1 |
|
1677 }; |
|
1678 |
|
1679 const KTableValue nsCSSProps::kUserSelectKTable[] = { |
|
1680 eCSSKeyword_none, NS_STYLE_USER_SELECT_NONE, |
|
1681 eCSSKeyword_auto, NS_STYLE_USER_SELECT_AUTO, |
|
1682 eCSSKeyword_text, NS_STYLE_USER_SELECT_TEXT, |
|
1683 eCSSKeyword_element, NS_STYLE_USER_SELECT_ELEMENT, |
|
1684 eCSSKeyword_elements, NS_STYLE_USER_SELECT_ELEMENTS, |
|
1685 eCSSKeyword_all, NS_STYLE_USER_SELECT_ALL, |
|
1686 eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE, |
|
1687 eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE, |
|
1688 eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL, |
|
1689 eCSSKeyword__moz_none, NS_STYLE_USER_SELECT_NONE, |
|
1690 eCSSKeyword_UNKNOWN,-1 |
|
1691 }; |
|
1692 |
|
1693 const KTableValue nsCSSProps::kVerticalAlignKTable[] = { |
|
1694 eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE, |
|
1695 eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB, |
|
1696 eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER, |
|
1697 eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP, |
|
1698 eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP, |
|
1699 eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE, |
|
1700 eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE, |
|
1701 eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM, |
|
1702 eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM, |
|
1703 eCSSKeyword_UNKNOWN,-1 |
|
1704 }; |
|
1705 |
|
1706 const KTableValue nsCSSProps::kVisibilityKTable[] = { |
|
1707 eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE, |
|
1708 eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN, |
|
1709 eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE, |
|
1710 eCSSKeyword_UNKNOWN,-1 |
|
1711 }; |
|
1712 |
|
1713 const KTableValue nsCSSProps::kWhitespaceKTable[] = { |
|
1714 eCSSKeyword_normal, NS_STYLE_WHITESPACE_NORMAL, |
|
1715 eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE, |
|
1716 eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP, |
|
1717 eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP, |
|
1718 eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE, |
|
1719 eCSSKeyword__moz_pre_discard_newlines, NS_STYLE_WHITESPACE_PRE_DISCARD_NEWLINES, |
|
1720 eCSSKeyword_UNKNOWN,-1 |
|
1721 }; |
|
1722 |
|
1723 const KTableValue nsCSSProps::kWidthKTable[] = { |
|
1724 eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT, |
|
1725 eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT, |
|
1726 eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT, |
|
1727 eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE, |
|
1728 eCSSKeyword_UNKNOWN,-1 |
|
1729 }; |
|
1730 |
|
1731 const KTableValue nsCSSProps::kWindowShadowKTable[] = { |
|
1732 eCSSKeyword_none, NS_STYLE_WINDOW_SHADOW_NONE, |
|
1733 eCSSKeyword_default, NS_STYLE_WINDOW_SHADOW_DEFAULT, |
|
1734 eCSSKeyword_menu, NS_STYLE_WINDOW_SHADOW_MENU, |
|
1735 eCSSKeyword_tooltip, NS_STYLE_WINDOW_SHADOW_TOOLTIP, |
|
1736 eCSSKeyword_sheet, NS_STYLE_WINDOW_SHADOW_SHEET, |
|
1737 eCSSKeyword_UNKNOWN,-1 |
|
1738 }; |
|
1739 |
|
1740 const KTableValue nsCSSProps::kWordBreakKTable[] = { |
|
1741 eCSSKeyword_normal, NS_STYLE_WORDBREAK_NORMAL, |
|
1742 eCSSKeyword_break_all, NS_STYLE_WORDBREAK_BREAK_ALL, |
|
1743 eCSSKeyword_keep_all, NS_STYLE_WORDBREAK_KEEP_ALL, |
|
1744 eCSSKeyword_UNKNOWN,-1 |
|
1745 }; |
|
1746 |
|
1747 const KTableValue nsCSSProps::kWordWrapKTable[] = { |
|
1748 eCSSKeyword_normal, NS_STYLE_WORDWRAP_NORMAL, |
|
1749 eCSSKeyword_break_word, NS_STYLE_WORDWRAP_BREAK_WORD, |
|
1750 eCSSKeyword_UNKNOWN,-1 |
|
1751 }; |
|
1752 |
|
1753 const KTableValue nsCSSProps::kWritingModeKTable[] = { |
|
1754 eCSSKeyword_horizontal_tb, NS_STYLE_WRITING_MODE_HORIZONTAL_TB, |
|
1755 eCSSKeyword_vertical_lr, NS_STYLE_WRITING_MODE_VERTICAL_LR, |
|
1756 eCSSKeyword_vertical_rl, NS_STYLE_WRITING_MODE_VERTICAL_RL, |
|
1757 eCSSKeyword_UNKNOWN, -1 |
|
1758 }; |
|
1759 |
|
1760 const KTableValue nsCSSProps::kHyphensKTable[] = { |
|
1761 eCSSKeyword_none, NS_STYLE_HYPHENS_NONE, |
|
1762 eCSSKeyword_manual, NS_STYLE_HYPHENS_MANUAL, |
|
1763 eCSSKeyword_auto, NS_STYLE_HYPHENS_AUTO, |
|
1764 eCSSKeyword_UNKNOWN,-1 |
|
1765 }; |
|
1766 |
|
1767 // Specific keyword tables for XUL.properties |
|
1768 const KTableValue nsCSSProps::kBoxAlignKTable[] = { |
|
1769 eCSSKeyword_stretch, NS_STYLE_BOX_ALIGN_STRETCH, |
|
1770 eCSSKeyword_start, NS_STYLE_BOX_ALIGN_START, |
|
1771 eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER, |
|
1772 eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE, |
|
1773 eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END, |
|
1774 eCSSKeyword_UNKNOWN,-1 |
|
1775 }; |
|
1776 |
|
1777 const KTableValue nsCSSProps::kBoxDirectionKTable[] = { |
|
1778 eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL, |
|
1779 eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE, |
|
1780 eCSSKeyword_UNKNOWN,-1 |
|
1781 }; |
|
1782 |
|
1783 const KTableValue nsCSSProps::kBoxOrientKTable[] = { |
|
1784 eCSSKeyword_horizontal, NS_STYLE_BOX_ORIENT_HORIZONTAL, |
|
1785 eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL, |
|
1786 eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL, |
|
1787 eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL, |
|
1788 eCSSKeyword_UNKNOWN,-1 |
|
1789 }; |
|
1790 |
|
1791 const KTableValue nsCSSProps::kBoxPackKTable[] = { |
|
1792 eCSSKeyword_start, NS_STYLE_BOX_PACK_START, |
|
1793 eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER, |
|
1794 eCSSKeyword_end, NS_STYLE_BOX_PACK_END, |
|
1795 eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY, |
|
1796 eCSSKeyword_UNKNOWN,-1 |
|
1797 }; |
|
1798 |
|
1799 // keyword tables for SVG properties |
|
1800 |
|
1801 const KTableValue nsCSSProps::kDominantBaselineKTable[] = { |
|
1802 eCSSKeyword_auto, NS_STYLE_DOMINANT_BASELINE_AUTO, |
|
1803 eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT, |
|
1804 eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE, |
|
1805 eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE, |
|
1806 eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC, |
|
1807 eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING, |
|
1808 eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC, |
|
1809 eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL, |
|
1810 eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL, |
|
1811 eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE, |
|
1812 eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE, |
|
1813 eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE, |
|
1814 eCSSKeyword_UNKNOWN, -1 |
|
1815 }; |
|
1816 |
|
1817 const KTableValue nsCSSProps::kFillRuleKTable[] = { |
|
1818 eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO, |
|
1819 eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD, |
|
1820 eCSSKeyword_UNKNOWN, -1 |
|
1821 }; |
|
1822 |
|
1823 const KTableValue nsCSSProps::kFilterFunctionKTable[] = { |
|
1824 eCSSKeyword_blur, NS_STYLE_FILTER_BLUR, |
|
1825 eCSSKeyword_brightness, NS_STYLE_FILTER_BRIGHTNESS, |
|
1826 eCSSKeyword_contrast, NS_STYLE_FILTER_CONTRAST, |
|
1827 eCSSKeyword_grayscale, NS_STYLE_FILTER_GRAYSCALE, |
|
1828 eCSSKeyword_invert, NS_STYLE_FILTER_INVERT, |
|
1829 eCSSKeyword_opacity, NS_STYLE_FILTER_OPACITY, |
|
1830 eCSSKeyword_saturate, NS_STYLE_FILTER_SATURATE, |
|
1831 eCSSKeyword_sepia, NS_STYLE_FILTER_SEPIA, |
|
1832 eCSSKeyword_hue_rotate, NS_STYLE_FILTER_HUE_ROTATE, |
|
1833 eCSSKeyword_drop_shadow, NS_STYLE_FILTER_DROP_SHADOW, |
|
1834 eCSSKeyword_UNKNOWN, -1 |
|
1835 }; |
|
1836 |
|
1837 const KTableValue nsCSSProps::kImageRenderingKTable[] = { |
|
1838 eCSSKeyword_auto, NS_STYLE_IMAGE_RENDERING_AUTO, |
|
1839 eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED, |
|
1840 eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY, |
|
1841 eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES, |
|
1842 eCSSKeyword_UNKNOWN, -1 |
|
1843 }; |
|
1844 |
|
1845 const KTableValue nsCSSProps::kMaskTypeKTable[] = { |
|
1846 eCSSKeyword_luminance, NS_STYLE_MASK_TYPE_LUMINANCE, |
|
1847 eCSSKeyword_alpha, NS_STYLE_MASK_TYPE_ALPHA, |
|
1848 eCSSKeyword_UNKNOWN, -1 |
|
1849 }; |
|
1850 |
|
1851 const KTableValue nsCSSProps::kShapeRenderingKTable[] = { |
|
1852 eCSSKeyword_auto, NS_STYLE_SHAPE_RENDERING_AUTO, |
|
1853 eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED, |
|
1854 eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES, |
|
1855 eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION, |
|
1856 eCSSKeyword_UNKNOWN, -1 |
|
1857 }; |
|
1858 |
|
1859 const KTableValue nsCSSProps::kStrokeLinecapKTable[] = { |
|
1860 eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT, |
|
1861 eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND, |
|
1862 eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE, |
|
1863 eCSSKeyword_UNKNOWN, -1 |
|
1864 }; |
|
1865 |
|
1866 const KTableValue nsCSSProps::kStrokeLinejoinKTable[] = { |
|
1867 eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER, |
|
1868 eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND, |
|
1869 eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL, |
|
1870 eCSSKeyword_UNKNOWN, -1 |
|
1871 }; |
|
1872 |
|
1873 // Lookup table to store the sole objectValue keyword to let SVG glyphs inherit |
|
1874 // certain stroke-* properties from the outer text object |
|
1875 const KTableValue nsCSSProps::kStrokeContextValueKTable[] = { |
|
1876 eCSSKeyword_context_value, NS_STYLE_STROKE_PROP_CONTEXT_VALUE, |
|
1877 eCSSKeyword_UNKNOWN, -1 |
|
1878 }; |
|
1879 |
|
1880 const KTableValue nsCSSProps::kTextAnchorKTable[] = { |
|
1881 eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START, |
|
1882 eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE, |
|
1883 eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END, |
|
1884 eCSSKeyword_UNKNOWN, -1 |
|
1885 }; |
|
1886 |
|
1887 const KTableValue nsCSSProps::kTextRenderingKTable[] = { |
|
1888 eCSSKeyword_auto, NS_STYLE_TEXT_RENDERING_AUTO, |
|
1889 eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED, |
|
1890 eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY, |
|
1891 eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION, |
|
1892 eCSSKeyword_UNKNOWN, -1 |
|
1893 }; |
|
1894 |
|
1895 const KTableValue nsCSSProps::kVectorEffectKTable[] = { |
|
1896 eCSSKeyword_none, NS_STYLE_VECTOR_EFFECT_NONE, |
|
1897 eCSSKeyword_non_scaling_stroke, NS_STYLE_VECTOR_EFFECT_NON_SCALING_STROKE, |
|
1898 eCSSKeyword_UNKNOWN, -1 |
|
1899 }; |
|
1900 |
|
1901 const KTableValue nsCSSProps::kColorInterpolationKTable[] = { |
|
1902 eCSSKeyword_auto, NS_STYLE_COLOR_INTERPOLATION_AUTO, |
|
1903 eCSSKeyword_srgb, NS_STYLE_COLOR_INTERPOLATION_SRGB, |
|
1904 eCSSKeyword_linearrgb, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB, |
|
1905 eCSSKeyword_UNKNOWN, -1 |
|
1906 }; |
|
1907 |
|
1908 const KTableValue nsCSSProps::kColumnFillKTable[] = { |
|
1909 eCSSKeyword_auto, NS_STYLE_COLUMN_FILL_AUTO, |
|
1910 eCSSKeyword_balance, NS_STYLE_COLUMN_FILL_BALANCE, |
|
1911 eCSSKeyword_UNKNOWN, -1 |
|
1912 }; |
|
1913 |
|
1914 static bool IsKeyValSentinel(nsCSSKeyword aKey, KTableValue aValue) |
|
1915 { |
|
1916 return aKey == eCSSKeyword_UNKNOWN && aValue == -1; |
|
1917 } |
|
1918 |
|
1919 int32_t |
|
1920 nsCSSProps::FindIndexOfKeyword(nsCSSKeyword aKeyword, |
|
1921 const KTableValue aTable[]) |
|
1922 { |
|
1923 if (eCSSKeyword_UNKNOWN == aKeyword) { |
|
1924 // NOTE: we can have keyword tables where eCSSKeyword_UNKNOWN is used |
|
1925 // not only for the sentinel, but also in the middle of the table to |
|
1926 // knock out values that have been disabled by prefs, e.g. kDisplayKTable. |
|
1927 // So we deal with eCSSKeyword_UNKNOWN up front to avoid returning a valid |
|
1928 // index in the loop below. |
|
1929 return -1; |
|
1930 } |
|
1931 int32_t i = 0; |
|
1932 for (;;) { |
|
1933 nsCSSKeyword key = nsCSSKeyword(aTable[i]); |
|
1934 int32_t val = aTable[i + 1]; |
|
1935 if (::IsKeyValSentinel(key, val)) { |
|
1936 break; |
|
1937 } |
|
1938 if (aKeyword == key) { |
|
1939 return i; |
|
1940 } |
|
1941 i += 2; |
|
1942 } |
|
1943 return -1; |
|
1944 } |
|
1945 |
|
1946 bool |
|
1947 nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const KTableValue aTable[], |
|
1948 int32_t& aResult) |
|
1949 { |
|
1950 int32_t index = FindIndexOfKeyword(aKeyword, aTable); |
|
1951 if (index >= 0) { |
|
1952 aResult = aTable[index + 1]; |
|
1953 return true; |
|
1954 } |
|
1955 return false; |
|
1956 } |
|
1957 |
|
1958 nsCSSKeyword |
|
1959 nsCSSProps::ValueToKeywordEnum(int32_t aValue, const KTableValue aTable[]) |
|
1960 { |
|
1961 NS_ASSERTION(KTableValue(aValue) == aValue, "Value out of range"); |
|
1962 int32_t i = 1; |
|
1963 for (;;) { |
|
1964 int32_t val = aTable[i]; |
|
1965 nsCSSKeyword key = nsCSSKeyword(aTable[i - 1]); |
|
1966 if (::IsKeyValSentinel(key, val)) { |
|
1967 break; |
|
1968 } |
|
1969 if (aValue == val) { |
|
1970 return key; |
|
1971 } |
|
1972 i += 2; |
|
1973 } |
|
1974 return eCSSKeyword_UNKNOWN; |
|
1975 } |
|
1976 |
|
1977 const nsAFlatCString& |
|
1978 nsCSSProps::ValueToKeyword(int32_t aValue, const KTableValue aTable[]) |
|
1979 { |
|
1980 NS_ASSERTION(KTableValue(aValue) == aValue, "Value out of range"); |
|
1981 nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable); |
|
1982 if (keyword == eCSSKeyword_UNKNOWN) { |
|
1983 static nsDependentCString sNullStr(""); |
|
1984 return sNullStr; |
|
1985 } else { |
|
1986 return nsCSSKeywords::GetStringValue(keyword); |
|
1987 } |
|
1988 } |
|
1989 |
|
1990 /* static */ const KTableValue* const |
|
1991 nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = { |
|
1992 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ |
|
1993 kwtable_, stylestruct_, stylestructoffset_, animtype_) \ |
|
1994 kwtable_, |
|
1995 #include "nsCSSPropList.h" |
|
1996 #undef CSS_PROP |
|
1997 }; |
|
1998 |
|
1999 const nsAFlatCString& |
|
2000 nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, int32_t aValue) |
|
2001 { |
|
2002 NS_ABORT_IF_FALSE(aProp >= 0 && aProp < eCSSProperty_COUNT, |
|
2003 "property out of range"); |
|
2004 NS_ASSERTION(KTableValue(aValue) == aValue, "Value out of range"); |
|
2005 |
|
2006 const KTableValue* kwtable = nullptr; |
|
2007 if (aProp < eCSSProperty_COUNT_no_shorthands) |
|
2008 kwtable = kKeywordTableTable[aProp]; |
|
2009 |
|
2010 if (kwtable) |
|
2011 return ValueToKeyword(aValue, kwtable); |
|
2012 |
|
2013 static nsDependentCString sNullStr(""); |
|
2014 return sNullStr; |
|
2015 } |
|
2016 |
|
2017 bool nsCSSProps::GetColorName(int32_t aPropValue, nsCString &aStr) |
|
2018 { |
|
2019 bool rv = false; |
|
2020 |
|
2021 // first get the keyword corresponding to the property Value from the color table |
|
2022 nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable); |
|
2023 |
|
2024 // next get the name as a string from the keywords table |
|
2025 if (keyword != eCSSKeyword_UNKNOWN) { |
|
2026 nsCSSKeywords::AddRefTable(); |
|
2027 aStr = nsCSSKeywords::GetStringValue(keyword); |
|
2028 nsCSSKeywords::ReleaseTable(); |
|
2029 rv = true; |
|
2030 } |
|
2031 return rv; |
|
2032 } |
|
2033 |
|
2034 const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = { |
|
2035 // Note that this uses the special BackendOnly style struct ID |
|
2036 // (which does need to be valid for storing in the |
|
2037 // nsCSSCompressedDataBlock::mStyleBits bitfield). |
|
2038 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ |
|
2039 kwtable_, stylestruct_, stylestructoffset_, animtype_) \ |
|
2040 eStyleStruct_##stylestruct_, |
|
2041 |
|
2042 #include "nsCSSPropList.h" |
|
2043 |
|
2044 #undef CSS_PROP |
|
2045 }; |
|
2046 |
|
2047 const nsStyleAnimType |
|
2048 nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = { |
|
2049 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ |
|
2050 stylestruct_, stylestructoffset_, animtype_) \ |
|
2051 animtype_, |
|
2052 #include "nsCSSPropList.h" |
|
2053 #undef CSS_PROP |
|
2054 }; |
|
2055 |
|
2056 const ptrdiff_t |
|
2057 nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = { |
|
2058 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ |
|
2059 stylestruct_, stylestructoffset_, animtype_) \ |
|
2060 stylestructoffset_, |
|
2061 #include "nsCSSPropList.h" |
|
2062 #undef CSS_PROP |
|
2063 }; |
|
2064 |
|
2065 const uint32_t nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = { |
|
2066 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ |
|
2067 stylestruct_, stylestructoffset_, animtype_) \ |
|
2068 flags_, |
|
2069 #include "nsCSSPropList.h" |
|
2070 #undef CSS_PROP |
|
2071 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) flags_, |
|
2072 #include "nsCSSPropList.h" |
|
2073 #undef CSS_PROP_SHORTHAND |
|
2074 }; |
|
2075 |
|
2076 static const nsCSSProperty gAllSubpropTable[] = { |
|
2077 #define CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND |
|
2078 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ |
|
2079 stylestruct_, stylestructoffset_, animtype_) \ |
|
2080 eCSSProperty_##id_, |
|
2081 #include "nsCSSPropList.h" |
|
2082 #undef CSS_PROP |
|
2083 #undef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND |
|
2084 eCSSProperty_UNKNOWN |
|
2085 }; |
|
2086 |
|
2087 static const nsCSSProperty gAnimationSubpropTable[] = { |
|
2088 eCSSProperty_animation_duration, |
|
2089 eCSSProperty_animation_timing_function, |
|
2090 eCSSProperty_animation_delay, |
|
2091 eCSSProperty_animation_direction, |
|
2092 eCSSProperty_animation_fill_mode, |
|
2093 eCSSProperty_animation_iteration_count, |
|
2094 // List animation-name last so we serialize it last, in case it has |
|
2095 // a value that conflicts with one of the other properties. (See |
|
2096 // how Declaration::GetValue serializes 'animation'. |
|
2097 eCSSProperty_animation_name, |
|
2098 eCSSProperty_UNKNOWN |
|
2099 }; |
|
2100 |
|
2101 static const nsCSSProperty gBorderRadiusSubpropTable[] = { |
|
2102 // Code relies on these being in topleft-topright-bottomright-bottomleft |
|
2103 // order. |
|
2104 eCSSProperty_border_top_left_radius, |
|
2105 eCSSProperty_border_top_right_radius, |
|
2106 eCSSProperty_border_bottom_right_radius, |
|
2107 eCSSProperty_border_bottom_left_radius, |
|
2108 eCSSProperty_UNKNOWN |
|
2109 }; |
|
2110 |
|
2111 static const nsCSSProperty gOutlineRadiusSubpropTable[] = { |
|
2112 // Code relies on these being in topleft-topright-bottomright-bottomleft |
|
2113 // order. |
|
2114 eCSSProperty__moz_outline_radius_topLeft, |
|
2115 eCSSProperty__moz_outline_radius_topRight, |
|
2116 eCSSProperty__moz_outline_radius_bottomRight, |
|
2117 eCSSProperty__moz_outline_radius_bottomLeft, |
|
2118 eCSSProperty_UNKNOWN |
|
2119 }; |
|
2120 |
|
2121 static const nsCSSProperty gBackgroundSubpropTable[] = { |
|
2122 eCSSProperty_background_color, |
|
2123 eCSSProperty_background_image, |
|
2124 eCSSProperty_background_repeat, |
|
2125 eCSSProperty_background_attachment, |
|
2126 eCSSProperty_background_position, |
|
2127 eCSSProperty_background_clip, |
|
2128 eCSSProperty_background_origin, |
|
2129 eCSSProperty_background_size, |
|
2130 eCSSProperty_UNKNOWN |
|
2131 }; |
|
2132 |
|
2133 static const nsCSSProperty gBorderSubpropTable[] = { |
|
2134 eCSSProperty_border_top_width, |
|
2135 eCSSProperty_border_right_width_value, |
|
2136 eCSSProperty_border_right_width_ltr_source, |
|
2137 eCSSProperty_border_right_width_rtl_source, |
|
2138 eCSSProperty_border_bottom_width, |
|
2139 eCSSProperty_border_left_width_value, |
|
2140 eCSSProperty_border_left_width_ltr_source, |
|
2141 eCSSProperty_border_left_width_rtl_source, |
|
2142 eCSSProperty_border_top_style, |
|
2143 eCSSProperty_border_right_style_value, |
|
2144 eCSSProperty_border_right_style_ltr_source, |
|
2145 eCSSProperty_border_right_style_rtl_source, |
|
2146 eCSSProperty_border_bottom_style, |
|
2147 eCSSProperty_border_left_style_value, |
|
2148 eCSSProperty_border_left_style_ltr_source, |
|
2149 eCSSProperty_border_left_style_rtl_source, |
|
2150 eCSSProperty_border_top_color, |
|
2151 eCSSProperty_border_right_color_value, |
|
2152 eCSSProperty_border_right_color_ltr_source, |
|
2153 eCSSProperty_border_right_color_rtl_source, |
|
2154 eCSSProperty_border_bottom_color, |
|
2155 eCSSProperty_border_left_color_value, |
|
2156 eCSSProperty_border_left_color_ltr_source, |
|
2157 eCSSProperty_border_left_color_rtl_source, |
|
2158 eCSSProperty_border_top_colors, |
|
2159 eCSSProperty_border_right_colors, |
|
2160 eCSSProperty_border_bottom_colors, |
|
2161 eCSSProperty_border_left_colors, |
|
2162 eCSSProperty_border_image_source, |
|
2163 eCSSProperty_border_image_slice, |
|
2164 eCSSProperty_border_image_width, |
|
2165 eCSSProperty_border_image_outset, |
|
2166 eCSSProperty_border_image_repeat, |
|
2167 eCSSProperty_UNKNOWN |
|
2168 }; |
|
2169 |
|
2170 static const nsCSSProperty gBorderBottomSubpropTable[] = { |
|
2171 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2172 // It also depends on the color being third. |
|
2173 eCSSProperty_border_bottom_width, |
|
2174 eCSSProperty_border_bottom_style, |
|
2175 eCSSProperty_border_bottom_color, |
|
2176 eCSSProperty_UNKNOWN |
|
2177 }; |
|
2178 |
|
2179 static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 && |
|
2180 NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3, |
|
2181 "box side constants not top/right/bottom/left == 0/1/2/3"); |
|
2182 static const nsCSSProperty gBorderColorSubpropTable[] = { |
|
2183 // Code relies on these being in top-right-bottom-left order. |
|
2184 // Code relies on these matching the NS_SIDE_* constants. |
|
2185 eCSSProperty_border_top_color, |
|
2186 eCSSProperty_border_right_color_value, |
|
2187 eCSSProperty_border_bottom_color, |
|
2188 eCSSProperty_border_left_color_value, |
|
2189 // extras: |
|
2190 eCSSProperty_border_left_color_ltr_source, |
|
2191 eCSSProperty_border_left_color_rtl_source, |
|
2192 eCSSProperty_border_right_color_ltr_source, |
|
2193 eCSSProperty_border_right_color_rtl_source, |
|
2194 eCSSProperty_UNKNOWN |
|
2195 }; |
|
2196 |
|
2197 static const nsCSSProperty gBorderEndColorSubpropTable[] = { |
|
2198 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2199 eCSSProperty_border_end_color_value, |
|
2200 eCSSProperty_border_right_color_ltr_source, |
|
2201 eCSSProperty_border_left_color_rtl_source, |
|
2202 eCSSProperty_UNKNOWN |
|
2203 }; |
|
2204 |
|
2205 static const nsCSSProperty gBorderLeftColorSubpropTable[] = { |
|
2206 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2207 eCSSProperty_border_left_color_value, |
|
2208 eCSSProperty_border_left_color_ltr_source, |
|
2209 eCSSProperty_border_left_color_rtl_source, |
|
2210 eCSSProperty_UNKNOWN |
|
2211 }; |
|
2212 |
|
2213 static const nsCSSProperty gBorderRightColorSubpropTable[] = { |
|
2214 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2215 eCSSProperty_border_right_color_value, |
|
2216 eCSSProperty_border_right_color_ltr_source, |
|
2217 eCSSProperty_border_right_color_rtl_source, |
|
2218 eCSSProperty_UNKNOWN |
|
2219 }; |
|
2220 |
|
2221 static const nsCSSProperty gBorderStartColorSubpropTable[] = { |
|
2222 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2223 eCSSProperty_border_start_color_value, |
|
2224 eCSSProperty_border_left_color_ltr_source, |
|
2225 eCSSProperty_border_right_color_rtl_source, |
|
2226 eCSSProperty_UNKNOWN |
|
2227 }; |
|
2228 |
|
2229 static const nsCSSProperty gBorderEndSubpropTable[] = { |
|
2230 // nsCSSDeclaration.cpp output the subproperties in this order. |
|
2231 // It also depends on the color being third. |
|
2232 eCSSProperty_border_end_width_value, |
|
2233 eCSSProperty_border_end_style_value, |
|
2234 eCSSProperty_border_end_color_value, |
|
2235 // extras: |
|
2236 eCSSProperty_border_right_width_ltr_source, |
|
2237 eCSSProperty_border_left_width_rtl_source, |
|
2238 eCSSProperty_border_right_style_ltr_source, |
|
2239 eCSSProperty_border_left_style_rtl_source, |
|
2240 eCSSProperty_border_right_color_ltr_source, |
|
2241 eCSSProperty_border_left_color_rtl_source, |
|
2242 eCSSProperty_UNKNOWN |
|
2243 }; |
|
2244 |
|
2245 static const nsCSSProperty gBorderLeftSubpropTable[] = { |
|
2246 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2247 // It also depends on the color being third. |
|
2248 eCSSProperty_border_left_width_value, |
|
2249 eCSSProperty_border_left_style_value, |
|
2250 eCSSProperty_border_left_color_value, |
|
2251 // extras: |
|
2252 eCSSProperty_border_left_width_ltr_source, |
|
2253 eCSSProperty_border_left_width_rtl_source, |
|
2254 eCSSProperty_border_left_style_ltr_source, |
|
2255 eCSSProperty_border_left_style_rtl_source, |
|
2256 eCSSProperty_border_left_color_ltr_source, |
|
2257 eCSSProperty_border_left_color_rtl_source, |
|
2258 eCSSProperty_UNKNOWN |
|
2259 }; |
|
2260 |
|
2261 static const nsCSSProperty gBorderRightSubpropTable[] = { |
|
2262 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2263 // It also depends on the color being third. |
|
2264 eCSSProperty_border_right_width_value, |
|
2265 eCSSProperty_border_right_style_value, |
|
2266 eCSSProperty_border_right_color_value, |
|
2267 // extras: |
|
2268 eCSSProperty_border_right_width_ltr_source, |
|
2269 eCSSProperty_border_right_width_rtl_source, |
|
2270 eCSSProperty_border_right_style_ltr_source, |
|
2271 eCSSProperty_border_right_style_rtl_source, |
|
2272 eCSSProperty_border_right_color_ltr_source, |
|
2273 eCSSProperty_border_right_color_rtl_source, |
|
2274 eCSSProperty_UNKNOWN |
|
2275 }; |
|
2276 |
|
2277 static const nsCSSProperty gBorderStartSubpropTable[] = { |
|
2278 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2279 // It also depends on the color being third. |
|
2280 eCSSProperty_border_start_width_value, |
|
2281 eCSSProperty_border_start_style_value, |
|
2282 eCSSProperty_border_start_color_value, |
|
2283 // extras: |
|
2284 eCSSProperty_border_left_width_ltr_source, |
|
2285 eCSSProperty_border_right_width_rtl_source, |
|
2286 eCSSProperty_border_left_style_ltr_source, |
|
2287 eCSSProperty_border_right_style_rtl_source, |
|
2288 eCSSProperty_border_left_color_ltr_source, |
|
2289 eCSSProperty_border_right_color_rtl_source, |
|
2290 eCSSProperty_UNKNOWN |
|
2291 }; |
|
2292 |
|
2293 static const nsCSSProperty gBorderStyleSubpropTable[] = { |
|
2294 // Code relies on these being in top-right-bottom-left order. |
|
2295 eCSSProperty_border_top_style, |
|
2296 eCSSProperty_border_right_style_value, |
|
2297 eCSSProperty_border_bottom_style, |
|
2298 eCSSProperty_border_left_style_value, |
|
2299 // extras: |
|
2300 eCSSProperty_border_left_style_ltr_source, |
|
2301 eCSSProperty_border_left_style_rtl_source, |
|
2302 eCSSProperty_border_right_style_ltr_source, |
|
2303 eCSSProperty_border_right_style_rtl_source, |
|
2304 eCSSProperty_UNKNOWN |
|
2305 }; |
|
2306 |
|
2307 static const nsCSSProperty gBorderLeftStyleSubpropTable[] = { |
|
2308 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2309 eCSSProperty_border_left_style_value, |
|
2310 eCSSProperty_border_left_style_ltr_source, |
|
2311 eCSSProperty_border_left_style_rtl_source, |
|
2312 eCSSProperty_UNKNOWN |
|
2313 }; |
|
2314 |
|
2315 static const nsCSSProperty gBorderRightStyleSubpropTable[] = { |
|
2316 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2317 eCSSProperty_border_right_style_value, |
|
2318 eCSSProperty_border_right_style_ltr_source, |
|
2319 eCSSProperty_border_right_style_rtl_source, |
|
2320 eCSSProperty_UNKNOWN |
|
2321 }; |
|
2322 |
|
2323 static const nsCSSProperty gBorderStartStyleSubpropTable[] = { |
|
2324 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2325 eCSSProperty_border_start_style_value, |
|
2326 eCSSProperty_border_left_style_ltr_source, |
|
2327 eCSSProperty_border_right_style_rtl_source, |
|
2328 eCSSProperty_UNKNOWN |
|
2329 }; |
|
2330 |
|
2331 static const nsCSSProperty gBorderEndStyleSubpropTable[] = { |
|
2332 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2333 eCSSProperty_border_end_style_value, |
|
2334 eCSSProperty_border_right_style_ltr_source, |
|
2335 eCSSProperty_border_left_style_rtl_source, |
|
2336 eCSSProperty_UNKNOWN |
|
2337 }; |
|
2338 |
|
2339 static const nsCSSProperty gBorderTopSubpropTable[] = { |
|
2340 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2341 // It also depends on the color being third. |
|
2342 eCSSProperty_border_top_width, |
|
2343 eCSSProperty_border_top_style, |
|
2344 eCSSProperty_border_top_color, |
|
2345 eCSSProperty_UNKNOWN |
|
2346 }; |
|
2347 |
|
2348 static const nsCSSProperty gBorderWidthSubpropTable[] = { |
|
2349 // Code relies on these being in top-right-bottom-left order. |
|
2350 eCSSProperty_border_top_width, |
|
2351 eCSSProperty_border_right_width_value, |
|
2352 eCSSProperty_border_bottom_width, |
|
2353 eCSSProperty_border_left_width_value, |
|
2354 // extras: |
|
2355 eCSSProperty_border_left_width_ltr_source, |
|
2356 eCSSProperty_border_left_width_rtl_source, |
|
2357 eCSSProperty_border_right_width_ltr_source, |
|
2358 eCSSProperty_border_right_width_rtl_source, |
|
2359 eCSSProperty_UNKNOWN |
|
2360 }; |
|
2361 |
|
2362 static const nsCSSProperty gBorderLeftWidthSubpropTable[] = { |
|
2363 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2364 eCSSProperty_border_left_width_value, |
|
2365 eCSSProperty_border_left_width_ltr_source, |
|
2366 eCSSProperty_border_left_width_rtl_source, |
|
2367 eCSSProperty_UNKNOWN |
|
2368 }; |
|
2369 |
|
2370 static const nsCSSProperty gBorderRightWidthSubpropTable[] = { |
|
2371 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2372 eCSSProperty_border_right_width_value, |
|
2373 eCSSProperty_border_right_width_ltr_source, |
|
2374 eCSSProperty_border_right_width_rtl_source, |
|
2375 eCSSProperty_UNKNOWN |
|
2376 }; |
|
2377 |
|
2378 static const nsCSSProperty gBorderStartWidthSubpropTable[] = { |
|
2379 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2380 eCSSProperty_border_start_width_value, |
|
2381 eCSSProperty_border_left_width_ltr_source, |
|
2382 eCSSProperty_border_right_width_rtl_source, |
|
2383 eCSSProperty_UNKNOWN |
|
2384 }; |
|
2385 |
|
2386 static const nsCSSProperty gBorderEndWidthSubpropTable[] = { |
|
2387 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2388 eCSSProperty_border_end_width_value, |
|
2389 eCSSProperty_border_right_width_ltr_source, |
|
2390 eCSSProperty_border_left_width_rtl_source, |
|
2391 eCSSProperty_UNKNOWN |
|
2392 }; |
|
2393 |
|
2394 static const nsCSSProperty gFontSubpropTable[] = { |
|
2395 eCSSProperty_font_family, |
|
2396 eCSSProperty_font_style, |
|
2397 eCSSProperty_font_variant, |
|
2398 eCSSProperty_font_weight, |
|
2399 eCSSProperty_font_size, |
|
2400 eCSSProperty_line_height, |
|
2401 eCSSProperty_font_size_adjust, |
|
2402 eCSSProperty_font_stretch, |
|
2403 eCSSProperty__x_system_font, |
|
2404 eCSSProperty_font_feature_settings, |
|
2405 eCSSProperty_font_language_override, |
|
2406 eCSSProperty_font_kerning, |
|
2407 eCSSProperty_font_synthesis, |
|
2408 eCSSProperty_font_variant_alternates, |
|
2409 eCSSProperty_font_variant_caps, |
|
2410 eCSSProperty_font_variant_east_asian, |
|
2411 eCSSProperty_font_variant_ligatures, |
|
2412 eCSSProperty_font_variant_numeric, |
|
2413 eCSSProperty_font_variant_position, |
|
2414 eCSSProperty_UNKNOWN |
|
2415 }; |
|
2416 |
|
2417 static const nsCSSProperty gListStyleSubpropTable[] = { |
|
2418 eCSSProperty_list_style_type, |
|
2419 eCSSProperty_list_style_image, |
|
2420 eCSSProperty_list_style_position, |
|
2421 eCSSProperty_UNKNOWN |
|
2422 }; |
|
2423 |
|
2424 static const nsCSSProperty gMarginSubpropTable[] = { |
|
2425 // Code relies on these being in top-right-bottom-left order. |
|
2426 eCSSProperty_margin_top, |
|
2427 eCSSProperty_margin_right_value, |
|
2428 eCSSProperty_margin_bottom, |
|
2429 eCSSProperty_margin_left_value, |
|
2430 // extras: |
|
2431 eCSSProperty_margin_left_ltr_source, |
|
2432 eCSSProperty_margin_left_rtl_source, |
|
2433 eCSSProperty_margin_right_ltr_source, |
|
2434 eCSSProperty_margin_right_rtl_source, |
|
2435 eCSSProperty_UNKNOWN |
|
2436 }; |
|
2437 |
|
2438 static const nsCSSProperty gMarginLeftSubpropTable[] = { |
|
2439 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2440 eCSSProperty_margin_left_value, |
|
2441 eCSSProperty_margin_left_ltr_source, |
|
2442 eCSSProperty_margin_left_rtl_source, |
|
2443 eCSSProperty_UNKNOWN |
|
2444 }; |
|
2445 |
|
2446 static const nsCSSProperty gMarginRightSubpropTable[] = { |
|
2447 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2448 eCSSProperty_margin_right_value, |
|
2449 eCSSProperty_margin_right_ltr_source, |
|
2450 eCSSProperty_margin_right_rtl_source, |
|
2451 eCSSProperty_UNKNOWN |
|
2452 }; |
|
2453 |
|
2454 static const nsCSSProperty gMarginStartSubpropTable[] = { |
|
2455 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2456 eCSSProperty_margin_start_value, |
|
2457 eCSSProperty_margin_left_ltr_source, |
|
2458 eCSSProperty_margin_right_rtl_source, |
|
2459 eCSSProperty_UNKNOWN |
|
2460 }; |
|
2461 |
|
2462 static const nsCSSProperty gMarginEndSubpropTable[] = { |
|
2463 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2464 eCSSProperty_margin_end_value, |
|
2465 eCSSProperty_margin_right_ltr_source, |
|
2466 eCSSProperty_margin_left_rtl_source, |
|
2467 eCSSProperty_UNKNOWN |
|
2468 }; |
|
2469 |
|
2470 |
|
2471 static const nsCSSProperty gOutlineSubpropTable[] = { |
|
2472 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2473 // It also depends on the color being third. |
|
2474 eCSSProperty_outline_width, |
|
2475 eCSSProperty_outline_style, |
|
2476 eCSSProperty_outline_color, |
|
2477 eCSSProperty_UNKNOWN |
|
2478 }; |
|
2479 |
|
2480 static const nsCSSProperty gColumnsSubpropTable[] = { |
|
2481 eCSSProperty__moz_column_count, |
|
2482 eCSSProperty__moz_column_width, |
|
2483 eCSSProperty_UNKNOWN |
|
2484 }; |
|
2485 |
|
2486 static const nsCSSProperty gColumnRuleSubpropTable[] = { |
|
2487 // nsCSSDeclaration.cpp outputs the subproperties in this order. |
|
2488 // It also depends on the color being third. |
|
2489 eCSSProperty__moz_column_rule_width, |
|
2490 eCSSProperty__moz_column_rule_style, |
|
2491 eCSSProperty__moz_column_rule_color, |
|
2492 eCSSProperty_UNKNOWN |
|
2493 }; |
|
2494 |
|
2495 static const nsCSSProperty gFlexSubpropTable[] = { |
|
2496 eCSSProperty_flex_grow, |
|
2497 eCSSProperty_flex_shrink, |
|
2498 eCSSProperty_flex_basis, |
|
2499 eCSSProperty_UNKNOWN |
|
2500 }; |
|
2501 |
|
2502 static const nsCSSProperty gFlexFlowSubpropTable[] = { |
|
2503 eCSSProperty_flex_direction, |
|
2504 eCSSProperty_flex_wrap, |
|
2505 eCSSProperty_UNKNOWN |
|
2506 }; |
|
2507 |
|
2508 static const nsCSSProperty gGridTemplateSubpropTable[] = { |
|
2509 eCSSProperty_grid_template_areas, |
|
2510 eCSSProperty_grid_template_columns, |
|
2511 eCSSProperty_grid_template_rows, |
|
2512 eCSSProperty_UNKNOWN |
|
2513 }; |
|
2514 |
|
2515 static const nsCSSProperty gGridSubpropTable[] = { |
|
2516 eCSSProperty_grid_template_areas, |
|
2517 eCSSProperty_grid_template_columns, |
|
2518 eCSSProperty_grid_template_rows, |
|
2519 eCSSProperty_grid_auto_flow, |
|
2520 eCSSProperty_grid_auto_columns, |
|
2521 eCSSProperty_grid_auto_rows, |
|
2522 eCSSProperty_UNKNOWN |
|
2523 }; |
|
2524 |
|
2525 static const nsCSSProperty gGridColumnSubpropTable[] = { |
|
2526 eCSSProperty_grid_column_start, |
|
2527 eCSSProperty_grid_column_end, |
|
2528 eCSSProperty_UNKNOWN |
|
2529 }; |
|
2530 |
|
2531 static const nsCSSProperty gGridRowSubpropTable[] = { |
|
2532 eCSSProperty_grid_row_start, |
|
2533 eCSSProperty_grid_row_end, |
|
2534 eCSSProperty_UNKNOWN |
|
2535 }; |
|
2536 |
|
2537 static const nsCSSProperty gGridAreaSubpropTable[] = { |
|
2538 eCSSProperty_grid_row_start, |
|
2539 eCSSProperty_grid_column_start, |
|
2540 eCSSProperty_grid_row_end, |
|
2541 eCSSProperty_grid_column_end, |
|
2542 eCSSProperty_UNKNOWN |
|
2543 }; |
|
2544 |
|
2545 static const nsCSSProperty gOverflowSubpropTable[] = { |
|
2546 eCSSProperty_overflow_x, |
|
2547 eCSSProperty_overflow_y, |
|
2548 eCSSProperty_UNKNOWN |
|
2549 }; |
|
2550 |
|
2551 static const nsCSSProperty gPaddingSubpropTable[] = { |
|
2552 // Code relies on these being in top-right-bottom-left order. |
|
2553 eCSSProperty_padding_top, |
|
2554 eCSSProperty_padding_right_value, |
|
2555 eCSSProperty_padding_bottom, |
|
2556 eCSSProperty_padding_left_value, |
|
2557 // extras: |
|
2558 eCSSProperty_padding_left_ltr_source, |
|
2559 eCSSProperty_padding_left_rtl_source, |
|
2560 eCSSProperty_padding_right_ltr_source, |
|
2561 eCSSProperty_padding_right_rtl_source, |
|
2562 eCSSProperty_UNKNOWN |
|
2563 }; |
|
2564 |
|
2565 static const nsCSSProperty gPaddingLeftSubpropTable[] = { |
|
2566 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2567 eCSSProperty_padding_left_value, |
|
2568 eCSSProperty_padding_left_ltr_source, |
|
2569 eCSSProperty_padding_left_rtl_source, |
|
2570 eCSSProperty_UNKNOWN |
|
2571 }; |
|
2572 |
|
2573 static const nsCSSProperty gPaddingRightSubpropTable[] = { |
|
2574 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2575 eCSSProperty_padding_right_value, |
|
2576 eCSSProperty_padding_right_ltr_source, |
|
2577 eCSSProperty_padding_right_rtl_source, |
|
2578 eCSSProperty_UNKNOWN |
|
2579 }; |
|
2580 |
|
2581 static const nsCSSProperty gPaddingStartSubpropTable[] = { |
|
2582 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2583 eCSSProperty_padding_start_value, |
|
2584 eCSSProperty_padding_left_ltr_source, |
|
2585 eCSSProperty_padding_right_rtl_source, |
|
2586 eCSSProperty_UNKNOWN |
|
2587 }; |
|
2588 |
|
2589 static const nsCSSProperty gPaddingEndSubpropTable[] = { |
|
2590 // nsCSSParser::ParseDirectionalBoxProperty depends on this order |
|
2591 eCSSProperty_padding_end_value, |
|
2592 eCSSProperty_padding_right_ltr_source, |
|
2593 eCSSProperty_padding_left_rtl_source, |
|
2594 eCSSProperty_UNKNOWN |
|
2595 }; |
|
2596 |
|
2597 static const nsCSSProperty gTextDecorationSubpropTable[] = { |
|
2598 eCSSProperty_text_decoration_color, |
|
2599 eCSSProperty_text_decoration_line, |
|
2600 eCSSProperty_text_decoration_style, |
|
2601 eCSSProperty_UNKNOWN |
|
2602 }; |
|
2603 |
|
2604 static const nsCSSProperty gTransitionSubpropTable[] = { |
|
2605 eCSSProperty_transition_property, |
|
2606 eCSSProperty_transition_duration, |
|
2607 eCSSProperty_transition_timing_function, |
|
2608 eCSSProperty_transition_delay, |
|
2609 eCSSProperty_UNKNOWN |
|
2610 }; |
|
2611 |
|
2612 static const nsCSSProperty gBorderImageSubpropTable[] = { |
|
2613 eCSSProperty_border_image_source, |
|
2614 eCSSProperty_border_image_slice, |
|
2615 eCSSProperty_border_image_width, |
|
2616 eCSSProperty_border_image_outset, |
|
2617 eCSSProperty_border_image_repeat, |
|
2618 eCSSProperty_UNKNOWN |
|
2619 }; |
|
2620 |
|
2621 static const nsCSSProperty gMarkerSubpropTable[] = { |
|
2622 eCSSProperty_marker_start, |
|
2623 eCSSProperty_marker_mid, |
|
2624 eCSSProperty_marker_end, |
|
2625 eCSSProperty_UNKNOWN |
|
2626 }; |
|
2627 |
|
2628 // Subproperty tables for shorthands that are just aliases with |
|
2629 // different parsing rules. |
|
2630 static const nsCSSProperty gMozTransformSubpropTable[] = { |
|
2631 eCSSProperty_transform, |
|
2632 eCSSProperty_UNKNOWN |
|
2633 }; |
|
2634 |
|
2635 const nsCSSProperty *const |
|
2636 nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = { |
|
2637 #define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_ |
|
2638 // Need an extra level of macro nesting to force expansion of method_ |
|
2639 // params before they get pasted. |
|
2640 #define NSCSSPROPS_INNER_MACRO(method_) g##method_##SubpropTable, |
|
2641 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ |
|
2642 NSCSSPROPS_INNER_MACRO(method_) |
|
2643 #include "nsCSSPropList.h" |
|
2644 #undef CSS_PROP_SHORTHAND |
|
2645 #undef NSCSSPROPS_INNER_MACRO |
|
2646 #undef CSS_PROP_PUBLIC_OR_PRIVATE |
|
2647 }; |
|
2648 |
|
2649 |
|
2650 #define ENUM_DATA_FOR_PROPERTY(name_, id_, method_, flags_, pref_, \ |
|
2651 parsevariant_, kwtable_, stylestructoffset_, \ |
|
2652 animtype_) \ |
|
2653 ePropertyIndex_for_##id_, |
|
2654 |
|
2655 // The order of these enums must match the g*Flags arrays in nsRuleNode.cpp. |
|
2656 |
|
2657 enum FontCheckCounter { |
|
2658 #define CSS_PROP_FONT ENUM_DATA_FOR_PROPERTY |
|
2659 #include "nsCSSPropList.h" |
|
2660 #undef CSS_PROP_FONT |
|
2661 ePropertyCount_for_Font |
|
2662 }; |
|
2663 |
|
2664 enum DisplayCheckCounter { |
|
2665 #define CSS_PROP_DISPLAY ENUM_DATA_FOR_PROPERTY |
|
2666 #include "nsCSSPropList.h" |
|
2667 #undef CSS_PROP_DISPLAY |
|
2668 ePropertyCount_for_Display |
|
2669 }; |
|
2670 |
|
2671 enum VisibilityCheckCounter { |
|
2672 #define CSS_PROP_VISIBILITY ENUM_DATA_FOR_PROPERTY |
|
2673 #include "nsCSSPropList.h" |
|
2674 #undef CSS_PROP_VISIBILITY |
|
2675 ePropertyCount_for_Visibility |
|
2676 }; |
|
2677 |
|
2678 enum MarginCheckCounter { |
|
2679 #define CSS_PROP_MARGIN ENUM_DATA_FOR_PROPERTY |
|
2680 #include "nsCSSPropList.h" |
|
2681 #undef CSS_PROP_MARGIN |
|
2682 ePropertyCount_for_Margin |
|
2683 }; |
|
2684 |
|
2685 enum BorderCheckCounter { |
|
2686 #define CSS_PROP_BORDER ENUM_DATA_FOR_PROPERTY |
|
2687 #include "nsCSSPropList.h" |
|
2688 #undef CSS_PROP_BORDER |
|
2689 ePropertyCount_for_Border |
|
2690 }; |
|
2691 |
|
2692 enum PaddingCheckCounter { |
|
2693 #define CSS_PROP_PADDING ENUM_DATA_FOR_PROPERTY |
|
2694 #include "nsCSSPropList.h" |
|
2695 #undef CSS_PROP_PADDING |
|
2696 ePropertyCount_for_Padding |
|
2697 }; |
|
2698 |
|
2699 enum OutlineCheckCounter { |
|
2700 #define CSS_PROP_OUTLINE ENUM_DATA_FOR_PROPERTY |
|
2701 #include "nsCSSPropList.h" |
|
2702 #undef CSS_PROP_OUTLINE |
|
2703 ePropertyCount_for_Outline |
|
2704 }; |
|
2705 |
|
2706 enum ListCheckCounter { |
|
2707 #define CSS_PROP_LIST ENUM_DATA_FOR_PROPERTY |
|
2708 #include "nsCSSPropList.h" |
|
2709 #undef CSS_PROP_LIST |
|
2710 ePropertyCount_for_List |
|
2711 }; |
|
2712 |
|
2713 enum ColorCheckCounter { |
|
2714 #define CSS_PROP_COLOR ENUM_DATA_FOR_PROPERTY |
|
2715 #include "nsCSSPropList.h" |
|
2716 #undef CSS_PROP_COLOR |
|
2717 ePropertyCount_for_Color |
|
2718 }; |
|
2719 |
|
2720 enum BackgroundCheckCounter { |
|
2721 #define CSS_PROP_BACKGROUND ENUM_DATA_FOR_PROPERTY |
|
2722 #include "nsCSSPropList.h" |
|
2723 #undef CSS_PROP_BACKGROUND |
|
2724 ePropertyCount_for_Background |
|
2725 }; |
|
2726 |
|
2727 enum PositionCheckCounter { |
|
2728 #define CSS_PROP_POSITION ENUM_DATA_FOR_PROPERTY |
|
2729 #include "nsCSSPropList.h" |
|
2730 #undef CSS_PROP_POSITION |
|
2731 ePropertyCount_for_Position |
|
2732 }; |
|
2733 |
|
2734 enum TableCheckCounter { |
|
2735 #define CSS_PROP_TABLE ENUM_DATA_FOR_PROPERTY |
|
2736 #include "nsCSSPropList.h" |
|
2737 #undef CSS_PROP_TABLE |
|
2738 ePropertyCount_for_Table |
|
2739 }; |
|
2740 |
|
2741 enum TableBorderCheckCounter { |
|
2742 #define CSS_PROP_TABLEBORDER ENUM_DATA_FOR_PROPERTY |
|
2743 #include "nsCSSPropList.h" |
|
2744 #undef CSS_PROP_TABLEBORDER |
|
2745 ePropertyCount_for_TableBorder |
|
2746 }; |
|
2747 |
|
2748 enum ContentCheckCounter { |
|
2749 #define CSS_PROP_CONTENT ENUM_DATA_FOR_PROPERTY |
|
2750 #include "nsCSSPropList.h" |
|
2751 #undef CSS_PROP_CONTENT |
|
2752 ePropertyCount_for_Content |
|
2753 }; |
|
2754 |
|
2755 enum QuotesCheckCounter { |
|
2756 #define CSS_PROP_QUOTES ENUM_DATA_FOR_PROPERTY |
|
2757 #include "nsCSSPropList.h" |
|
2758 #undef CSS_PROP_QUOTES |
|
2759 ePropertyCount_for_Quotes |
|
2760 }; |
|
2761 |
|
2762 enum TextCheckCounter { |
|
2763 #define CSS_PROP_TEXT ENUM_DATA_FOR_PROPERTY |
|
2764 #include "nsCSSPropList.h" |
|
2765 #undef CSS_PROP_TEXT |
|
2766 ePropertyCount_for_Text |
|
2767 }; |
|
2768 |
|
2769 enum TextResetCheckCounter { |
|
2770 #define CSS_PROP_TEXTRESET ENUM_DATA_FOR_PROPERTY |
|
2771 #include "nsCSSPropList.h" |
|
2772 #undef CSS_PROP_TEXTRESET |
|
2773 ePropertyCount_for_TextReset |
|
2774 }; |
|
2775 |
|
2776 enum UserInterfaceCheckCounter { |
|
2777 #define CSS_PROP_USERINTERFACE ENUM_DATA_FOR_PROPERTY |
|
2778 #include "nsCSSPropList.h" |
|
2779 #undef CSS_PROP_USERINTERFACE |
|
2780 ePropertyCount_for_UserInterface |
|
2781 }; |
|
2782 |
|
2783 enum UIResetCheckCounter { |
|
2784 #define CSS_PROP_UIRESET ENUM_DATA_FOR_PROPERTY |
|
2785 #include "nsCSSPropList.h" |
|
2786 #undef CSS_PROP_UIRESET |
|
2787 ePropertyCount_for_UIReset |
|
2788 }; |
|
2789 |
|
2790 enum XULCheckCounter { |
|
2791 #define CSS_PROP_XUL ENUM_DATA_FOR_PROPERTY |
|
2792 #include "nsCSSPropList.h" |
|
2793 #undef CSS_PROP_XUL |
|
2794 ePropertyCount_for_XUL |
|
2795 }; |
|
2796 |
|
2797 enum SVGCheckCounter { |
|
2798 #define CSS_PROP_SVG ENUM_DATA_FOR_PROPERTY |
|
2799 #include "nsCSSPropList.h" |
|
2800 #undef CSS_PROP_SVG |
|
2801 ePropertyCount_for_SVG |
|
2802 }; |
|
2803 |
|
2804 enum SVGResetCheckCounter { |
|
2805 #define CSS_PROP_SVGRESET ENUM_DATA_FOR_PROPERTY |
|
2806 #include "nsCSSPropList.h" |
|
2807 #undef CSS_PROP_SVGRESET |
|
2808 ePropertyCount_for_SVGReset |
|
2809 }; |
|
2810 |
|
2811 enum ColumnCheckCounter { |
|
2812 #define CSS_PROP_COLUMN ENUM_DATA_FOR_PROPERTY |
|
2813 #include "nsCSSPropList.h" |
|
2814 #undef CSS_PROP_COLUMN |
|
2815 ePropertyCount_for_Column |
|
2816 }; |
|
2817 |
|
2818 enum VariablesCheckCounter { |
|
2819 #define CSS_PROP_VARIABLES ENUM_DATA_FOR_PROPERTY |
|
2820 #include "nsCSSPropList.h" |
|
2821 #undef CSS_PROP_VARIABLES |
|
2822 ePropertyCount_for_Variables |
|
2823 }; |
|
2824 |
|
2825 #undef ENUM_DATA_FOR_PROPERTY |
|
2826 |
|
2827 /* static */ const size_t |
|
2828 nsCSSProps::gPropertyCountInStruct[nsStyleStructID_Length] = { |
|
2829 #define STYLE_STRUCT(name, checkdata_cb) \ |
|
2830 ePropertyCount_for_##name, |
|
2831 #include "nsStyleStructList.h" |
|
2832 #undef STYLE_STRUCT |
|
2833 }; |
|
2834 |
|
2835 /* static */ const size_t |
|
2836 nsCSSProps::gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands] = { |
|
2837 |
|
2838 #define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, \ |
|
2839 parsevariant_, kwtable_) \ |
|
2840 size_t(-1), |
|
2841 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ |
|
2842 kwtable_, stylestruct_, stylestructoffset_, animtype_) \ |
|
2843 ePropertyIndex_for_##id_, |
|
2844 #include "nsCSSPropList.h" |
|
2845 #undef CSS_PROP |
|
2846 #undef CSS_PROP_BACKENDONLY |
|
2847 |
|
2848 }; |
|
2849 |
|
2850 /* static */ bool |
|
2851 nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = { |
|
2852 #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ |
|
2853 kwtable_, stylestruct_, stylestructoffset_, animtype_) \ |
|
2854 true, |
|
2855 #include "nsCSSPropList.h" |
|
2856 #undef CSS_PROP |
|
2857 |
|
2858 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ |
|
2859 true, |
|
2860 #include "nsCSSPropList.h" |
|
2861 #undef CSS_PROP_SHORTHAND |
|
2862 |
|
2863 #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \ |
|
2864 true, |
|
2865 #include "nsCSSPropAliasList.h" |
|
2866 #undef CSS_PROP_ALIAS |
|
2867 }; |