1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/nsCSSProps.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,2867 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* 1.10 + * methods for dealing with CSS properties and tables of the keyword 1.11 + * values they accept 1.12 + */ 1.13 + 1.14 +#include "mozilla/ArrayUtils.h" 1.15 + 1.16 +#include "nsCSSProps.h" 1.17 +#include "nsCSSKeywords.h" 1.18 +#include "nsLayoutUtils.h" 1.19 +#include "nsStyleConsts.h" 1.20 +#include "nsIWidget.h" 1.21 +#include "nsThemeConstants.h" // For system widget appearance types 1.22 + 1.23 +#include "mozilla/LookAndFeel.h" // for system colors 1.24 + 1.25 +#include "nsString.h" 1.26 +#include "nsStaticNameTable.h" 1.27 + 1.28 +#include "mozilla/Preferences.h" 1.29 + 1.30 +using namespace mozilla; 1.31 + 1.32 +typedef nsCSSProps::KTableValue KTableValue; 1.33 + 1.34 +// required to make the symbol external, so that TestCSSPropertyLookup.cpp can link with it 1.35 +extern const char* const kCSSRawProperties[]; 1.36 + 1.37 +// define an array of all CSS properties 1.38 +const char* const kCSSRawProperties[eCSSProperty_COUNT_with_aliases] = { 1.39 +#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ 1.40 + stylestruct_, stylestructoffset_, animtype_) \ 1.41 + #name_, 1.42 +#include "nsCSSPropList.h" 1.43 +#undef CSS_PROP 1.44 +#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) #name_, 1.45 +#include "nsCSSPropList.h" 1.46 +#undef CSS_PROP_SHORTHAND 1.47 +#define CSS_PROP_ALIAS(aliasname_, id_, method_, pref_) #aliasname_, 1.48 +#include "nsCSSPropAliasList.h" 1.49 +#undef CSS_PROP_ALIAS 1.50 +}; 1.51 + 1.52 +using namespace mozilla; 1.53 + 1.54 +static int32_t gPropertyTableRefCount; 1.55 +static nsStaticCaseInsensitiveNameTable* gPropertyTable; 1.56 +static nsStaticCaseInsensitiveNameTable* gFontDescTable; 1.57 + 1.58 +/* static */ nsCSSProperty * 1.59 + nsCSSProps::gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands]; 1.60 +/* static */ nsCSSProperty* nsCSSProps::gShorthandsContainingPool = nullptr; 1.61 + 1.62 +static const char* const kCSSRawFontDescs[] = { 1.63 +#define CSS_FONT_DESC(name_, method_) #name_, 1.64 +#include "nsCSSFontDescList.h" 1.65 +#undef CSS_FONT_DESC 1.66 +}; 1.67 + 1.68 +struct PropertyAndCount { 1.69 + nsCSSProperty property; 1.70 + uint32_t count; 1.71 +}; 1.72 + 1.73 +static int 1.74 +SortPropertyAndCount(const void* s1, const void* s2, void *closure) 1.75 +{ 1.76 + const PropertyAndCount *pc1 = static_cast<const PropertyAndCount*>(s1); 1.77 + const PropertyAndCount *pc2 = static_cast<const PropertyAndCount*>(s2); 1.78 + // Primary sort by count (lowest to highest) 1.79 + if (pc1->count != pc2->count) 1.80 + return pc1->count - pc2->count; 1.81 + // Secondary sort by property index (highest to lowest) 1.82 + return pc2->property - pc1->property; 1.83 +} 1.84 + 1.85 +// We need eCSSAliasCount so we can make gAliases nonzero size when there 1.86 +// are no aliases. 1.87 +enum { 1.88 + eCSSAliasCount = eCSSProperty_COUNT_with_aliases - eCSSProperty_COUNT 1.89 +}; 1.90 + 1.91 +// The names are in kCSSRawProperties. 1.92 +static nsCSSProperty gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = { 1.93 +#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \ 1.94 + eCSSProperty_##propid_ , 1.95 +#include "nsCSSPropAliasList.h" 1.96 +#undef CSS_PROP_ALIAS 1.97 +}; 1.98 + 1.99 +nsStaticCaseInsensitiveNameTable* 1.100 +CreateStaticTable(const char* const aRawTable[], int32_t aSize) 1.101 +{ 1.102 + auto table = new nsStaticCaseInsensitiveNameTable(); 1.103 + if (table) { 1.104 +#ifdef DEBUG 1.105 + // let's verify the table... 1.106 + for (int32_t index = 0; index < aSize; ++index) { 1.107 + nsAutoCString temp1(aRawTable[index]); 1.108 + nsAutoCString temp2(aRawTable[index]); 1.109 + ToLowerCase(temp1); 1.110 + NS_ABORT_IF_FALSE(temp1.Equals(temp2), 1.111 + "upper case char in case insensitive name table"); 1.112 + NS_ABORT_IF_FALSE(-1 == temp1.FindChar('_'), 1.113 + "underscore char in case insensitive name table"); 1.114 + } 1.115 +#endif 1.116 + table->Init(aRawTable, aSize); 1.117 + } 1.118 + return table; 1.119 +} 1.120 + 1.121 +void 1.122 +nsCSSProps::AddRefTable(void) 1.123 +{ 1.124 + if (0 == gPropertyTableRefCount++) { 1.125 + NS_ABORT_IF_FALSE(!gPropertyTable, "pre existing array!"); 1.126 + NS_ABORT_IF_FALSE(!gFontDescTable, "pre existing array!"); 1.127 + 1.128 + gPropertyTable = CreateStaticTable( 1.129 + kCSSRawProperties, eCSSProperty_COUNT_with_aliases); 1.130 + gFontDescTable = CreateStaticTable(kCSSRawFontDescs, eCSSFontDesc_COUNT); 1.131 + 1.132 + BuildShorthandsContainingTable(); 1.133 + 1.134 + static bool prefObserversInited = false; 1.135 + if (!prefObserversInited) { 1.136 + prefObserversInited = true; 1.137 + 1.138 + #define OBSERVE_PROP(pref_, id_) \ 1.139 + if (pref_[0]) { \ 1.140 + Preferences::AddBoolVarCache(&gPropertyEnabled[id_], \ 1.141 + pref_); \ 1.142 + } 1.143 + 1.144 + #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ 1.145 + kwtable_, stylestruct_, stylestructoffset_, animtype_) \ 1.146 + OBSERVE_PROP(pref_, eCSSProperty_##id_) 1.147 + #include "nsCSSPropList.h" 1.148 + #undef CSS_PROP 1.149 + 1.150 + #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ 1.151 + OBSERVE_PROP(pref_, eCSSProperty_##id_) 1.152 + #include "nsCSSPropList.h" 1.153 + #undef CSS_PROP_SHORTHAND 1.154 + 1.155 + #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \ 1.156 + OBSERVE_PROP(pref_, eCSSPropertyAlias_##aliasmethod_) 1.157 + #include "nsCSSPropAliasList.h" 1.158 + #undef CSS_PROP_ALIAS 1.159 + 1.160 + #undef OBSERVE_PROP 1.161 + } 1.162 + } 1.163 +} 1.164 + 1.165 +#undef DEBUG_SHORTHANDS_CONTAINING 1.166 + 1.167 +bool 1.168 +nsCSSProps::BuildShorthandsContainingTable() 1.169 +{ 1.170 + uint32_t occurrenceCounts[eCSSProperty_COUNT_no_shorthands]; 1.171 + memset(occurrenceCounts, 0, sizeof(occurrenceCounts)); 1.172 + PropertyAndCount subpropCounts[eCSSProperty_COUNT - 1.173 + eCSSProperty_COUNT_no_shorthands]; 1.174 + for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands; 1.175 + shorthand < eCSSProperty_COUNT; 1.176 + shorthand = nsCSSProperty(shorthand + 1)) { 1.177 +#ifdef DEBUG_SHORTHANDS_CONTAINING 1.178 + printf("Considering shorthand property '%s'.\n", 1.179 + nsCSSProps::GetStringValue(shorthand).get()); 1.180 +#endif 1.181 + PropertyAndCount &subpropCountsEntry = 1.182 + subpropCounts[shorthand - eCSSProperty_COUNT_no_shorthands]; 1.183 + subpropCountsEntry.property = shorthand; 1.184 + subpropCountsEntry.count = 0; 1.185 + if (nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS)) { 1.186 + // Don't put shorthands that are acting as aliases in the 1.187 + // shorthands-containing lists. 1.188 + continue; 1.189 + } 1.190 + for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand); 1.191 + *subprops != eCSSProperty_UNKNOWN; 1.192 + ++subprops) { 1.193 + NS_ABORT_IF_FALSE(0 <= *subprops && 1.194 + *subprops < eCSSProperty_COUNT_no_shorthands, 1.195 + "subproperty must be a longhand"); 1.196 + ++occurrenceCounts[*subprops]; 1.197 + ++subpropCountsEntry.count; 1.198 + } 1.199 + } 1.200 + 1.201 + uint32_t poolEntries = 0; 1.202 + for (nsCSSProperty longhand = nsCSSProperty(0); 1.203 + longhand < eCSSProperty_COUNT_no_shorthands; 1.204 + longhand = nsCSSProperty(longhand + 1)) { 1.205 + uint32_t count = occurrenceCounts[longhand]; 1.206 + if (count > 0) 1.207 + // leave room for terminator 1.208 + poolEntries += count + 1; 1.209 + } 1.210 + 1.211 + gShorthandsContainingPool = new nsCSSProperty[poolEntries]; 1.212 + if (!gShorthandsContainingPool) 1.213 + return false; 1.214 + 1.215 + // Initialize all entries to point to their null-terminator. 1.216 + { 1.217 + nsCSSProperty *poolCursor = gShorthandsContainingPool - 1; 1.218 + nsCSSProperty *lastTerminator = 1.219 + gShorthandsContainingPool + poolEntries - 1; 1.220 + for (nsCSSProperty longhand = nsCSSProperty(0); 1.221 + longhand < eCSSProperty_COUNT_no_shorthands; 1.222 + longhand = nsCSSProperty(longhand + 1)) { 1.223 + uint32_t count = occurrenceCounts[longhand]; 1.224 + if (count > 0) { 1.225 + poolCursor += count + 1; 1.226 + gShorthandsContainingTable[longhand] = poolCursor; 1.227 + *poolCursor = eCSSProperty_UNKNOWN; 1.228 + } else { 1.229 + gShorthandsContainingTable[longhand] = lastTerminator; 1.230 + } 1.231 + } 1.232 + NS_ABORT_IF_FALSE(poolCursor == lastTerminator, "miscalculation"); 1.233 + } 1.234 + 1.235 + // Sort with lowest count at the start and highest at the end, and 1.236 + // within counts sort in reverse property index order. 1.237 + NS_QuickSort(&subpropCounts, ArrayLength(subpropCounts), 1.238 + sizeof(subpropCounts[0]), SortPropertyAndCount, nullptr); 1.239 + 1.240 + // Fill in all the entries in gShorthandsContainingTable 1.241 + for (const PropertyAndCount *shorthandAndCount = subpropCounts, 1.242 + *shorthandAndCountEnd = ArrayEnd(subpropCounts); 1.243 + shorthandAndCount < shorthandAndCountEnd; 1.244 + ++shorthandAndCount) { 1.245 +#ifdef DEBUG_SHORTHANDS_CONTAINING 1.246 + printf("Entering %u subprops for '%s'.\n", 1.247 + shorthandAndCount->count, 1.248 + nsCSSProps::GetStringValue(shorthandAndCount->property).get()); 1.249 +#endif 1.250 + if (nsCSSProps::PropHasFlags(shorthandAndCount->property, 1.251 + CSS_PROPERTY_IS_ALIAS)) { 1.252 + // Don't put shorthands that are acting as aliases in the 1.253 + // shorthands-containing lists. 1.254 + continue; 1.255 + } 1.256 + for (const nsCSSProperty* subprops = 1.257 + SubpropertyEntryFor(shorthandAndCount->property); 1.258 + *subprops != eCSSProperty_UNKNOWN; 1.259 + ++subprops) { 1.260 + *(--gShorthandsContainingTable[*subprops]) = shorthandAndCount->property; 1.261 + } 1.262 + } 1.263 + 1.264 +#ifdef DEBUG_SHORTHANDS_CONTAINING 1.265 + for (nsCSSProperty longhand = nsCSSProperty(0); 1.266 + longhand < eCSSProperty_COUNT_no_shorthands; 1.267 + longhand = nsCSSProperty(longhand + 1)) { 1.268 + printf("Property %s is in %d shorthands.\n", 1.269 + nsCSSProps::GetStringValue(longhand).get(), 1.270 + occurrenceCounts[longhand]); 1.271 + for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand); 1.272 + *shorthands != eCSSProperty_UNKNOWN; 1.273 + ++shorthands) { 1.274 + printf(" %s\n", nsCSSProps::GetStringValue(*shorthands).get()); 1.275 + } 1.276 + } 1.277 +#endif 1.278 + 1.279 +#ifdef DEBUG 1.280 + // Verify that all values that should be are present. 1.281 + for (nsCSSProperty shorthand = eCSSProperty_COUNT_no_shorthands; 1.282 + shorthand < eCSSProperty_COUNT; 1.283 + shorthand = nsCSSProperty(shorthand + 1)) { 1.284 + if (nsCSSProps::PropHasFlags(shorthand, CSS_PROPERTY_IS_ALIAS)) { 1.285 + // Don't put shorthands that are acting as aliases in the 1.286 + // shorthands-containing lists. 1.287 + continue; 1.288 + } 1.289 + for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand); 1.290 + *subprops != eCSSProperty_UNKNOWN; 1.291 + ++subprops) { 1.292 + uint32_t count = 0; 1.293 + for (const nsCSSProperty *shcont = ShorthandsContaining(*subprops); 1.294 + *shcont != eCSSProperty_UNKNOWN; 1.295 + ++shcont) { 1.296 + if (*shcont == shorthand) 1.297 + ++count; 1.298 + } 1.299 + NS_ABORT_IF_FALSE(count == 1, 1.300 + "subproperty of shorthand should have shorthand" 1.301 + " in its ShorthandsContaining() table"); 1.302 + } 1.303 + } 1.304 + 1.305 + // Verify that there are no extra values 1.306 + for (nsCSSProperty longhand = nsCSSProperty(0); 1.307 + longhand < eCSSProperty_COUNT_no_shorthands; 1.308 + longhand = nsCSSProperty(longhand + 1)) { 1.309 + for (const nsCSSProperty *shorthands = ShorthandsContaining(longhand); 1.310 + *shorthands != eCSSProperty_UNKNOWN; 1.311 + ++shorthands) { 1.312 + uint32_t count = 0; 1.313 + for (const nsCSSProperty* subprops = SubpropertyEntryFor(*shorthands); 1.314 + *subprops != eCSSProperty_UNKNOWN; 1.315 + ++subprops) { 1.316 + if (*subprops == longhand) 1.317 + ++count; 1.318 + } 1.319 + NS_ABORT_IF_FALSE(count == 1, 1.320 + "longhand should be in subproperty table of " 1.321 + "property in its ShorthandsContaining() table"); 1.322 + } 1.323 + } 1.324 +#endif 1.325 + 1.326 + return true; 1.327 +} 1.328 + 1.329 +void 1.330 +nsCSSProps::ReleaseTable(void) 1.331 +{ 1.332 + if (0 == --gPropertyTableRefCount) { 1.333 + delete gPropertyTable; 1.334 + gPropertyTable = nullptr; 1.335 + 1.336 + delete gFontDescTable; 1.337 + gFontDescTable = nullptr; 1.338 + 1.339 + delete [] gShorthandsContainingPool; 1.340 + gShorthandsContainingPool = nullptr; 1.341 + } 1.342 +} 1.343 + 1.344 +/* static */ bool 1.345 +nsCSSProps::IsInherited(nsCSSProperty aProperty) 1.346 +{ 1.347 + MOZ_ASSERT(!IsShorthand(aProperty)); 1.348 + 1.349 + nsStyleStructID sid = kSIDTable[aProperty]; 1.350 + return nsCachedStyleData::IsInherited(sid); 1.351 +} 1.352 + 1.353 +/* static */ bool 1.354 +nsCSSProps::IsCustomPropertyName(const nsACString& aProperty) 1.355 +{ 1.356 + // Custom properties don't need to have a character after the "--" prefix. 1.357 + return aProperty.Length() >= CSS_CUSTOM_NAME_PREFIX_LENGTH && 1.358 + StringBeginsWith(aProperty, NS_LITERAL_CSTRING("--")); 1.359 +} 1.360 + 1.361 +/* static */ bool 1.362 +nsCSSProps::IsCustomPropertyName(const nsAString& aProperty) 1.363 +{ 1.364 + return aProperty.Length() >= CSS_CUSTOM_NAME_PREFIX_LENGTH && 1.365 + StringBeginsWith(aProperty, NS_LITERAL_STRING("--")); 1.366 +} 1.367 + 1.368 +nsCSSProperty 1.369 +nsCSSProps::LookupProperty(const nsACString& aProperty, 1.370 + EnabledState aEnabled) 1.371 +{ 1.372 + NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref"); 1.373 + 1.374 + if (nsLayoutUtils::CSSVariablesEnabled() && 1.375 + IsCustomPropertyName(aProperty)) { 1.376 + return eCSSPropertyExtra_variable; 1.377 + } 1.378 + 1.379 + nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty)); 1.380 + if (MOZ_LIKELY(res < eCSSProperty_COUNT)) { 1.381 + if (res != eCSSProperty_UNKNOWN && !IsEnabled(res, aEnabled)) { 1.382 + res = eCSSProperty_UNKNOWN; 1.383 + } 1.384 + return res; 1.385 + } 1.386 + MOZ_ASSERT(eCSSAliasCount != 0, 1.387 + "'res' must be an alias at this point so we better have some!"); 1.388 + // We intentionally don't support eEnabledInUASheets or eEnabledInChromeOrCertifiedApp 1.389 + // for aliases yet because it's unlikely there will be a need for it. 1.390 + if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { 1.391 + res = gAliases[res - eCSSProperty_COUNT]; 1.392 + NS_ABORT_IF_FALSE(0 <= res && res < eCSSProperty_COUNT, 1.393 + "aliases must not point to other aliases"); 1.394 + if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { 1.395 + return res; 1.396 + } 1.397 + } 1.398 + return eCSSProperty_UNKNOWN; 1.399 +} 1.400 + 1.401 +nsCSSProperty 1.402 +nsCSSProps::LookupProperty(const nsAString& aProperty, EnabledState aEnabled) 1.403 +{ 1.404 + if (nsLayoutUtils::CSSVariablesEnabled() && 1.405 + IsCustomPropertyName(aProperty)) { 1.406 + return eCSSPropertyExtra_variable; 1.407 + } 1.408 + 1.409 + // This is faster than converting and calling 1.410 + // LookupProperty(nsACString&). The table will do its own 1.411 + // converting and avoid a PromiseFlatCString() call. 1.412 + NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref"); 1.413 + nsCSSProperty res = nsCSSProperty(gPropertyTable->Lookup(aProperty)); 1.414 + if (MOZ_LIKELY(res < eCSSProperty_COUNT)) { 1.415 + if (res != eCSSProperty_UNKNOWN && !IsEnabled(res, aEnabled)) { 1.416 + res = eCSSProperty_UNKNOWN; 1.417 + } 1.418 + return res; 1.419 + } 1.420 + MOZ_ASSERT(eCSSAliasCount != 0, 1.421 + "'res' must be an alias at this point so we better have some!"); 1.422 + // We intentionally don't support eEnabledInUASheets for aliases yet 1.423 + // because it's unlikely there will be a need for it. 1.424 + if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { 1.425 + res = gAliases[res - eCSSProperty_COUNT]; 1.426 + NS_ABORT_IF_FALSE(0 <= res && res < eCSSProperty_COUNT, 1.427 + "aliases must not point to other aliases"); 1.428 + if (IsEnabled(res) || aEnabled == eIgnoreEnabledState) { 1.429 + return res; 1.430 + } 1.431 + } 1.432 + return eCSSProperty_UNKNOWN; 1.433 +} 1.434 + 1.435 +nsCSSFontDesc 1.436 +nsCSSProps::LookupFontDesc(const nsACString& aFontDesc) 1.437 +{ 1.438 + NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref"); 1.439 + return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); 1.440 +} 1.441 + 1.442 +nsCSSFontDesc 1.443 +nsCSSProps::LookupFontDesc(const nsAString& aFontDesc) 1.444 +{ 1.445 + NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref"); 1.446 + nsCSSFontDesc which = nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); 1.447 + 1.448 + // font-variant-alternates enabled ==> layout.css.font-features.enabled is true 1.449 + bool fontFeaturesEnabled = 1.450 + nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates); 1.451 + 1.452 + // check for unprefixed font-feature-settings/font-language-override 1.453 + if (which == eCSSFontDesc_UNKNOWN && fontFeaturesEnabled) { 1.454 + nsAutoString prefixedProp; 1.455 + prefixedProp.AppendLiteral("-moz-"); 1.456 + prefixedProp.Append(aFontDesc); 1.457 + which = nsCSSFontDesc(gFontDescTable->Lookup(prefixedProp)); 1.458 + } 1.459 + return which; 1.460 +} 1.461 + 1.462 +const nsAFlatCString& 1.463 +nsCSSProps::GetStringValue(nsCSSProperty aProperty) 1.464 +{ 1.465 + NS_ABORT_IF_FALSE(gPropertyTable, "no lookup table, needs addref"); 1.466 + if (gPropertyTable) { 1.467 + return gPropertyTable->GetStringValue(int32_t(aProperty)); 1.468 + } else { 1.469 + static nsDependentCString sNullStr(""); 1.470 + return sNullStr; 1.471 + } 1.472 +} 1.473 + 1.474 +const nsAFlatCString& 1.475 +nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID) 1.476 +{ 1.477 + NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref"); 1.478 + if (gFontDescTable) { 1.479 + return gFontDescTable->GetStringValue(int32_t(aFontDescID)); 1.480 + } else { 1.481 + static nsDependentCString sNullStr(""); 1.482 + return sNullStr; 1.483 + } 1.484 +} 1.485 + 1.486 +nsCSSProperty 1.487 +nsCSSProps::OtherNameFor(nsCSSProperty aProperty) 1.488 +{ 1.489 + switch (aProperty) { 1.490 + case eCSSProperty_border_left_color_value: 1.491 + return eCSSProperty_border_left_color; 1.492 + case eCSSProperty_border_left_style_value: 1.493 + return eCSSProperty_border_left_style; 1.494 + case eCSSProperty_border_left_width_value: 1.495 + return eCSSProperty_border_left_width; 1.496 + case eCSSProperty_border_right_color_value: 1.497 + return eCSSProperty_border_right_color; 1.498 + case eCSSProperty_border_right_style_value: 1.499 + return eCSSProperty_border_right_style; 1.500 + case eCSSProperty_border_right_width_value: 1.501 + return eCSSProperty_border_right_width; 1.502 + case eCSSProperty_margin_left_value: 1.503 + return eCSSProperty_margin_left; 1.504 + case eCSSProperty_margin_right_value: 1.505 + return eCSSProperty_margin_right; 1.506 + case eCSSProperty_padding_left_value: 1.507 + return eCSSProperty_padding_left; 1.508 + case eCSSProperty_padding_right_value: 1.509 + return eCSSProperty_padding_right; 1.510 + default: 1.511 + NS_ABORT_IF_FALSE(false, "bad caller"); 1.512 + } 1.513 + return eCSSProperty_UNKNOWN; 1.514 +} 1.515 + 1.516 +/***************************************************************************/ 1.517 + 1.518 +const KTableValue nsCSSProps::kAnimationDirectionKTable[] = { 1.519 + eCSSKeyword_normal, NS_STYLE_ANIMATION_DIRECTION_NORMAL, 1.520 + eCSSKeyword_reverse, NS_STYLE_ANIMATION_DIRECTION_REVERSE, 1.521 + eCSSKeyword_alternate, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE, 1.522 + eCSSKeyword_alternate_reverse, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE_REVERSE, 1.523 + eCSSKeyword_UNKNOWN,-1 1.524 +}; 1.525 + 1.526 +const KTableValue nsCSSProps::kAnimationFillModeKTable[] = { 1.527 + eCSSKeyword_none, NS_STYLE_ANIMATION_FILL_MODE_NONE, 1.528 + eCSSKeyword_forwards, NS_STYLE_ANIMATION_FILL_MODE_FORWARDS, 1.529 + eCSSKeyword_backwards, NS_STYLE_ANIMATION_FILL_MODE_BACKWARDS, 1.530 + eCSSKeyword_both, NS_STYLE_ANIMATION_FILL_MODE_BOTH, 1.531 + eCSSKeyword_UNKNOWN,-1 1.532 +}; 1.533 + 1.534 +const KTableValue nsCSSProps::kAnimationIterationCountKTable[] = { 1.535 + eCSSKeyword_infinite, NS_STYLE_ANIMATION_ITERATION_COUNT_INFINITE, 1.536 + eCSSKeyword_UNKNOWN,-1 1.537 +}; 1.538 + 1.539 +const KTableValue nsCSSProps::kAnimationPlayStateKTable[] = { 1.540 + eCSSKeyword_running, NS_STYLE_ANIMATION_PLAY_STATE_RUNNING, 1.541 + eCSSKeyword_paused, NS_STYLE_ANIMATION_PLAY_STATE_PAUSED, 1.542 + eCSSKeyword_UNKNOWN,-1 1.543 +}; 1.544 + 1.545 +const KTableValue nsCSSProps::kAppearanceKTable[] = { 1.546 + eCSSKeyword_none, NS_THEME_NONE, 1.547 + eCSSKeyword_button, NS_THEME_BUTTON, 1.548 + eCSSKeyword_radio, NS_THEME_RADIO, 1.549 + eCSSKeyword_checkbox, NS_THEME_CHECKBOX, 1.550 + eCSSKeyword_button_bevel, NS_THEME_BUTTON_BEVEL, 1.551 + eCSSKeyword_toolbox, NS_THEME_TOOLBOX, 1.552 + eCSSKeyword_toolbar, NS_THEME_TOOLBAR, 1.553 + eCSSKeyword_toolbarbutton, NS_THEME_TOOLBAR_BUTTON, 1.554 + eCSSKeyword_toolbargripper, NS_THEME_TOOLBAR_GRIPPER, 1.555 + eCSSKeyword_dualbutton, NS_THEME_TOOLBAR_DUAL_BUTTON, 1.556 + eCSSKeyword_toolbarbutton_dropdown, NS_THEME_TOOLBAR_BUTTON_DROPDOWN, 1.557 + eCSSKeyword_button_arrow_up, NS_THEME_BUTTON_ARROW_UP, 1.558 + eCSSKeyword_button_arrow_down, NS_THEME_BUTTON_ARROW_DOWN, 1.559 + eCSSKeyword_button_arrow_next, NS_THEME_BUTTON_ARROW_NEXT, 1.560 + eCSSKeyword_button_arrow_previous, NS_THEME_BUTTON_ARROW_PREVIOUS, 1.561 + eCSSKeyword_meterbar, NS_THEME_METERBAR, 1.562 + eCSSKeyword_meterchunk, NS_THEME_METERBAR_CHUNK, 1.563 + eCSSKeyword_number_input, NS_THEME_NUMBER_INPUT, 1.564 + eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR, 1.565 + eCSSKeyword_splitter, NS_THEME_SPLITTER, 1.566 + eCSSKeyword_statusbar, NS_THEME_STATUSBAR, 1.567 + eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL, 1.568 + eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL, 1.569 + eCSSKeyword_resizer, NS_THEME_RESIZER, 1.570 + eCSSKeyword_listbox, NS_THEME_LISTBOX, 1.571 + eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM, 1.572 + eCSSKeyword_treeview, NS_THEME_TREEVIEW, 1.573 + eCSSKeyword_treeitem, NS_THEME_TREEVIEW_TREEITEM, 1.574 + eCSSKeyword_treetwisty, NS_THEME_TREEVIEW_TWISTY, 1.575 + eCSSKeyword_treetwistyopen, NS_THEME_TREEVIEW_TWISTY_OPEN, 1.576 + eCSSKeyword_treeline, NS_THEME_TREEVIEW_LINE, 1.577 + eCSSKeyword_treeheader, NS_THEME_TREEVIEW_HEADER, 1.578 + eCSSKeyword_treeheadercell, NS_THEME_TREEVIEW_HEADER_CELL, 1.579 + eCSSKeyword_treeheadersortarrow, NS_THEME_TREEVIEW_HEADER_SORTARROW, 1.580 + eCSSKeyword_progressbar, NS_THEME_PROGRESSBAR, 1.581 + eCSSKeyword_progresschunk, NS_THEME_PROGRESSBAR_CHUNK, 1.582 + eCSSKeyword_progressbar_vertical, NS_THEME_PROGRESSBAR_VERTICAL, 1.583 + eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL, 1.584 + eCSSKeyword_tab, NS_THEME_TAB, 1.585 + eCSSKeyword_tabpanels, NS_THEME_TAB_PANELS, 1.586 + eCSSKeyword_tabpanel, NS_THEME_TAB_PANEL, 1.587 + eCSSKeyword_tab_scroll_arrow_back, NS_THEME_TAB_SCROLLARROW_BACK, 1.588 + eCSSKeyword_tab_scroll_arrow_forward, NS_THEME_TAB_SCROLLARROW_FORWARD, 1.589 + eCSSKeyword_tooltip, NS_THEME_TOOLTIP, 1.590 + eCSSKeyword_spinner, NS_THEME_SPINNER, 1.591 + eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON, 1.592 + eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON, 1.593 + eCSSKeyword_spinner_textfield, NS_THEME_SPINNER_TEXTFIELD, 1.594 + eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR, 1.595 + eCSSKeyword_scrollbar_small, NS_THEME_SCROLLBAR_SMALL, 1.596 + eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP, 1.597 + eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN, 1.598 + eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT, 1.599 + eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT, 1.600 + eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL, 1.601 + eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL, 1.602 + eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL, 1.603 + eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL, 1.604 + eCSSKeyword_textfield, NS_THEME_TEXTFIELD, 1.605 + eCSSKeyword_textfield_multiline, NS_THEME_TEXTFIELD_MULTILINE, 1.606 + eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET, 1.607 + eCSSKeyword_searchfield, NS_THEME_SEARCHFIELD, 1.608 + eCSSKeyword_menulist, NS_THEME_DROPDOWN, 1.609 + eCSSKeyword_menulist_button, NS_THEME_DROPDOWN_BUTTON, 1.610 + eCSSKeyword_menulist_text, NS_THEME_DROPDOWN_TEXT, 1.611 + eCSSKeyword_menulist_textfield, NS_THEME_DROPDOWN_TEXTFIELD, 1.612 + eCSSKeyword_range, NS_THEME_RANGE, 1.613 + eCSSKeyword_range_thumb, NS_THEME_RANGE_THUMB, 1.614 + eCSSKeyword_scale_horizontal, NS_THEME_SCALE_HORIZONTAL, 1.615 + eCSSKeyword_scale_vertical, NS_THEME_SCALE_VERTICAL, 1.616 + eCSSKeyword_scalethumb_horizontal, NS_THEME_SCALE_THUMB_HORIZONTAL, 1.617 + eCSSKeyword_scalethumb_vertical, NS_THEME_SCALE_THUMB_VERTICAL, 1.618 + eCSSKeyword_scalethumbstart, NS_THEME_SCALE_THUMB_START, 1.619 + eCSSKeyword_scalethumbend, NS_THEME_SCALE_THUMB_END, 1.620 + eCSSKeyword_scalethumbtick, NS_THEME_SCALE_TICK, 1.621 + eCSSKeyword_groupbox, NS_THEME_GROUPBOX, 1.622 + eCSSKeyword_checkbox_container, NS_THEME_CHECKBOX_CONTAINER, 1.623 + eCSSKeyword_radio_container, NS_THEME_RADIO_CONTAINER, 1.624 + eCSSKeyword_checkbox_label, NS_THEME_CHECKBOX_LABEL, 1.625 + eCSSKeyword_radio_label, NS_THEME_RADIO_LABEL, 1.626 + eCSSKeyword_button_focus, NS_THEME_BUTTON_FOCUS, 1.627 + eCSSKeyword_window, NS_THEME_WINDOW, 1.628 + eCSSKeyword_dialog, NS_THEME_DIALOG, 1.629 + eCSSKeyword_menubar, NS_THEME_MENUBAR, 1.630 + eCSSKeyword_menupopup, NS_THEME_MENUPOPUP, 1.631 + eCSSKeyword_menuitem, NS_THEME_MENUITEM, 1.632 + eCSSKeyword_checkmenuitem, NS_THEME_CHECKMENUITEM, 1.633 + eCSSKeyword_radiomenuitem, NS_THEME_RADIOMENUITEM, 1.634 + eCSSKeyword_menucheckbox, NS_THEME_MENUCHECKBOX, 1.635 + eCSSKeyword_menuradio, NS_THEME_MENURADIO, 1.636 + eCSSKeyword_menuseparator, NS_THEME_MENUSEPARATOR, 1.637 + eCSSKeyword_menuarrow, NS_THEME_MENUARROW, 1.638 + eCSSKeyword_menuimage, NS_THEME_MENUIMAGE, 1.639 + eCSSKeyword_menuitemtext, NS_THEME_MENUITEMTEXT, 1.640 + eCSSKeyword__moz_win_media_toolbox, NS_THEME_WIN_MEDIA_TOOLBOX, 1.641 + eCSSKeyword__moz_win_communications_toolbox, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX, 1.642 + eCSSKeyword__moz_win_browsertabbar_toolbox, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX, 1.643 + eCSSKeyword__moz_win_glass, NS_THEME_WIN_GLASS, 1.644 + eCSSKeyword__moz_win_borderless_glass, NS_THEME_WIN_BORDERLESS_GLASS, 1.645 + eCSSKeyword__moz_mac_unified_toolbar, NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR, 1.646 + eCSSKeyword__moz_mac_fullscreen_button, NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON, 1.647 + eCSSKeyword__moz_mac_help_button, NS_THEME_MOZ_MAC_HELP_BUTTON, 1.648 + eCSSKeyword__moz_window_titlebar, NS_THEME_WINDOW_TITLEBAR, 1.649 + eCSSKeyword__moz_window_titlebar_maximized, NS_THEME_WINDOW_TITLEBAR_MAXIMIZED, 1.650 + eCSSKeyword__moz_window_frame_left, NS_THEME_WINDOW_FRAME_LEFT, 1.651 + eCSSKeyword__moz_window_frame_right, NS_THEME_WINDOW_FRAME_RIGHT, 1.652 + eCSSKeyword__moz_window_frame_bottom, NS_THEME_WINDOW_FRAME_BOTTOM, 1.653 + eCSSKeyword__moz_window_button_close, NS_THEME_WINDOW_BUTTON_CLOSE, 1.654 + eCSSKeyword__moz_window_button_minimize, NS_THEME_WINDOW_BUTTON_MINIMIZE, 1.655 + eCSSKeyword__moz_window_button_maximize, NS_THEME_WINDOW_BUTTON_MAXIMIZE, 1.656 + eCSSKeyword__moz_window_button_restore, NS_THEME_WINDOW_BUTTON_RESTORE, 1.657 + eCSSKeyword__moz_window_button_box, NS_THEME_WINDOW_BUTTON_BOX, 1.658 + eCSSKeyword__moz_window_button_box_maximized, NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED, 1.659 + eCSSKeyword__moz_win_exclude_glass, NS_THEME_WIN_EXCLUDE_GLASS, 1.660 + eCSSKeyword_UNKNOWN,-1 1.661 +}; 1.662 + 1.663 +const KTableValue nsCSSProps::kBackfaceVisibilityKTable[] = { 1.664 + eCSSKeyword_visible, NS_STYLE_BACKFACE_VISIBILITY_VISIBLE, 1.665 + eCSSKeyword_hidden, NS_STYLE_BACKFACE_VISIBILITY_HIDDEN, 1.666 + eCSSKeyword_UNKNOWN,-1 1.667 +}; 1.668 + 1.669 +const KTableValue nsCSSProps::kTransformStyleKTable[] = { 1.670 + eCSSKeyword_flat, NS_STYLE_TRANSFORM_STYLE_FLAT, 1.671 + eCSSKeyword_preserve_3d, NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D, 1.672 + eCSSKeyword_UNKNOWN,-1 1.673 +}; 1.674 + 1.675 +const KTableValue nsCSSProps::kBackgroundAttachmentKTable[] = { 1.676 + eCSSKeyword_fixed, NS_STYLE_BG_ATTACHMENT_FIXED, 1.677 + eCSSKeyword_scroll, NS_STYLE_BG_ATTACHMENT_SCROLL, 1.678 + eCSSKeyword_local, NS_STYLE_BG_ATTACHMENT_LOCAL, 1.679 + eCSSKeyword_UNKNOWN,-1 1.680 +}; 1.681 + 1.682 +const KTableValue nsCSSProps::kBackgroundInlinePolicyKTable[] = { 1.683 + eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX, 1.684 + eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS, 1.685 + eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX, 1.686 + eCSSKeyword_UNKNOWN,-1 1.687 +}; 1.688 + 1.689 +static_assert(NS_STYLE_BG_CLIP_BORDER == NS_STYLE_BG_ORIGIN_BORDER && 1.690 + NS_STYLE_BG_CLIP_PADDING == NS_STYLE_BG_ORIGIN_PADDING && 1.691 + NS_STYLE_BG_CLIP_CONTENT == NS_STYLE_BG_ORIGIN_CONTENT, 1.692 + "bg-clip and bg-origin style constants must agree"); 1.693 +const KTableValue nsCSSProps::kBackgroundOriginKTable[] = { 1.694 + eCSSKeyword_border_box, NS_STYLE_BG_ORIGIN_BORDER, 1.695 + eCSSKeyword_padding_box, NS_STYLE_BG_ORIGIN_PADDING, 1.696 + eCSSKeyword_content_box, NS_STYLE_BG_ORIGIN_CONTENT, 1.697 + eCSSKeyword_UNKNOWN,-1 1.698 +}; 1.699 + 1.700 +// Note: Don't change this table unless you update 1.701 +// parseBackgroundPosition! 1.702 + 1.703 +const KTableValue nsCSSProps::kBackgroundPositionKTable[] = { 1.704 + eCSSKeyword_center, NS_STYLE_BG_POSITION_CENTER, 1.705 + eCSSKeyword_top, NS_STYLE_BG_POSITION_TOP, 1.706 + eCSSKeyword_bottom, NS_STYLE_BG_POSITION_BOTTOM, 1.707 + eCSSKeyword_left, NS_STYLE_BG_POSITION_LEFT, 1.708 + eCSSKeyword_right, NS_STYLE_BG_POSITION_RIGHT, 1.709 + eCSSKeyword_UNKNOWN,-1 1.710 +}; 1.711 + 1.712 +const KTableValue nsCSSProps::kBackgroundRepeatKTable[] = { 1.713 + eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_NO_REPEAT, 1.714 + eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_REPEAT, 1.715 + eCSSKeyword_repeat_x, NS_STYLE_BG_REPEAT_REPEAT_X, 1.716 + eCSSKeyword_repeat_y, NS_STYLE_BG_REPEAT_REPEAT_Y, 1.717 + eCSSKeyword_UNKNOWN,-1 1.718 +}; 1.719 + 1.720 +const KTableValue nsCSSProps::kBackgroundRepeatPartKTable[] = { 1.721 + eCSSKeyword_no_repeat, NS_STYLE_BG_REPEAT_NO_REPEAT, 1.722 + eCSSKeyword_repeat, NS_STYLE_BG_REPEAT_REPEAT, 1.723 + eCSSKeyword_UNKNOWN,-1 1.724 +}; 1.725 + 1.726 +const KTableValue nsCSSProps::kBackgroundSizeKTable[] = { 1.727 + eCSSKeyword_contain, NS_STYLE_BG_SIZE_CONTAIN, 1.728 + eCSSKeyword_cover, NS_STYLE_BG_SIZE_COVER, 1.729 + eCSSKeyword_UNKNOWN,-1 1.730 +}; 1.731 + 1.732 +const KTableValue nsCSSProps::kBlendModeKTable[] = { 1.733 + eCSSKeyword_normal, NS_STYLE_BLEND_NORMAL, 1.734 + eCSSKeyword_multiply, NS_STYLE_BLEND_MULTIPLY, 1.735 + eCSSKeyword_screen, NS_STYLE_BLEND_SCREEN, 1.736 + eCSSKeyword_overlay, NS_STYLE_BLEND_OVERLAY, 1.737 + eCSSKeyword_darken, NS_STYLE_BLEND_DARKEN, 1.738 + eCSSKeyword_lighten, NS_STYLE_BLEND_LIGHTEN, 1.739 + eCSSKeyword_color_dodge, NS_STYLE_BLEND_COLOR_DODGE, 1.740 + eCSSKeyword_color_burn, NS_STYLE_BLEND_COLOR_BURN, 1.741 + eCSSKeyword_hard_light, NS_STYLE_BLEND_HARD_LIGHT, 1.742 + eCSSKeyword_soft_light, NS_STYLE_BLEND_SOFT_LIGHT, 1.743 + eCSSKeyword_difference, NS_STYLE_BLEND_DIFFERENCE, 1.744 + eCSSKeyword_exclusion, NS_STYLE_BLEND_EXCLUSION, 1.745 + eCSSKeyword_hue, NS_STYLE_BLEND_HUE, 1.746 + eCSSKeyword_saturation, NS_STYLE_BLEND_SATURATION, 1.747 + eCSSKeyword_color, NS_STYLE_BLEND_COLOR, 1.748 + eCSSKeyword_luminosity, NS_STYLE_BLEND_LUMINOSITY, 1.749 + eCSSKeyword_UNKNOWN,-1 1.750 +}; 1.751 + 1.752 +const KTableValue nsCSSProps::kBorderCollapseKTable[] = { 1.753 + eCSSKeyword_collapse, NS_STYLE_BORDER_COLLAPSE, 1.754 + eCSSKeyword_separate, NS_STYLE_BORDER_SEPARATE, 1.755 + eCSSKeyword_UNKNOWN,-1 1.756 +}; 1.757 + 1.758 +const KTableValue nsCSSProps::kBorderColorKTable[] = { 1.759 + eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, 1.760 + eCSSKeyword_UNKNOWN,-1 1.761 +}; 1.762 + 1.763 +const KTableValue nsCSSProps::kBorderImageRepeatKTable[] = { 1.764 + eCSSKeyword_stretch, NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH, 1.765 + eCSSKeyword_repeat, NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT, 1.766 + eCSSKeyword_round, NS_STYLE_BORDER_IMAGE_REPEAT_ROUND, 1.767 + eCSSKeyword_UNKNOWN,-1 1.768 +}; 1.769 + 1.770 +const KTableValue nsCSSProps::kBorderImageSliceKTable[] = { 1.771 + eCSSKeyword_fill, NS_STYLE_BORDER_IMAGE_SLICE_FILL, 1.772 + eCSSKeyword_UNKNOWN,-1 1.773 +}; 1.774 + 1.775 +const KTableValue nsCSSProps::kBorderStyleKTable[] = { 1.776 + eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE, 1.777 + eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN, 1.778 + eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED, 1.779 + eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED, 1.780 + eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID, 1.781 + eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE, 1.782 + eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE, 1.783 + eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE, 1.784 + eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET, 1.785 + eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET, 1.786 + eCSSKeyword_UNKNOWN,-1 1.787 +}; 1.788 + 1.789 +const KTableValue nsCSSProps::kBorderWidthKTable[] = { 1.790 + eCSSKeyword_thin, NS_STYLE_BORDER_WIDTH_THIN, 1.791 + eCSSKeyword_medium, NS_STYLE_BORDER_WIDTH_MEDIUM, 1.792 + eCSSKeyword_thick, NS_STYLE_BORDER_WIDTH_THICK, 1.793 + eCSSKeyword_UNKNOWN,-1 1.794 +}; 1.795 + 1.796 +const KTableValue nsCSSProps::kBoxPropSourceKTable[] = { 1.797 + eCSSKeyword_physical, NS_BOXPROP_SOURCE_PHYSICAL, 1.798 + eCSSKeyword_logical, NS_BOXPROP_SOURCE_LOGICAL, 1.799 + eCSSKeyword_UNKNOWN,-1 1.800 +}; 1.801 + 1.802 +const KTableValue nsCSSProps::kBoxShadowTypeKTable[] = { 1.803 + eCSSKeyword_inset, NS_STYLE_BOX_SHADOW_INSET, 1.804 + eCSSKeyword_UNKNOWN,-1 1.805 +}; 1.806 + 1.807 +const KTableValue nsCSSProps::kBoxSizingKTable[] = { 1.808 + eCSSKeyword_content_box, NS_STYLE_BOX_SIZING_CONTENT, 1.809 + eCSSKeyword_border_box, NS_STYLE_BOX_SIZING_BORDER, 1.810 + eCSSKeyword_padding_box, NS_STYLE_BOX_SIZING_PADDING, 1.811 + eCSSKeyword_UNKNOWN,-1 1.812 +}; 1.813 + 1.814 +const KTableValue nsCSSProps::kCaptionSideKTable[] = { 1.815 + eCSSKeyword_top, NS_STYLE_CAPTION_SIDE_TOP, 1.816 + eCSSKeyword_right, NS_STYLE_CAPTION_SIDE_RIGHT, 1.817 + eCSSKeyword_bottom, NS_STYLE_CAPTION_SIDE_BOTTOM, 1.818 + eCSSKeyword_left, NS_STYLE_CAPTION_SIDE_LEFT, 1.819 + eCSSKeyword_top_outside, NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE, 1.820 + eCSSKeyword_bottom_outside, NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE, 1.821 + eCSSKeyword_UNKNOWN, -1 1.822 +}; 1.823 + 1.824 +const KTableValue nsCSSProps::kClearKTable[] = { 1.825 + eCSSKeyword_none, NS_STYLE_CLEAR_NONE, 1.826 + eCSSKeyword_left, NS_STYLE_CLEAR_LEFT, 1.827 + eCSSKeyword_right, NS_STYLE_CLEAR_RIGHT, 1.828 + eCSSKeyword_both, NS_STYLE_CLEAR_BOTH, 1.829 + eCSSKeyword_UNKNOWN,-1 1.830 +}; 1.831 + 1.832 +// See also kContextPatternKTable for SVG paint-specific values 1.833 +const KTableValue nsCSSProps::kColorKTable[] = { 1.834 + eCSSKeyword_activeborder, LookAndFeel::eColorID_activeborder, 1.835 + eCSSKeyword_activecaption, LookAndFeel::eColorID_activecaption, 1.836 + eCSSKeyword_appworkspace, LookAndFeel::eColorID_appworkspace, 1.837 + eCSSKeyword_background, LookAndFeel::eColorID_background, 1.838 + eCSSKeyword_buttonface, LookAndFeel::eColorID_buttonface, 1.839 + eCSSKeyword_buttonhighlight, LookAndFeel::eColorID_buttonhighlight, 1.840 + eCSSKeyword_buttonshadow, LookAndFeel::eColorID_buttonshadow, 1.841 + eCSSKeyword_buttontext, LookAndFeel::eColorID_buttontext, 1.842 + eCSSKeyword_captiontext, LookAndFeel::eColorID_captiontext, 1.843 + eCSSKeyword_graytext, LookAndFeel::eColorID_graytext, 1.844 + eCSSKeyword_highlight, LookAndFeel::eColorID_highlight, 1.845 + eCSSKeyword_highlighttext, LookAndFeel::eColorID_highlighttext, 1.846 + eCSSKeyword_inactiveborder, LookAndFeel::eColorID_inactiveborder, 1.847 + eCSSKeyword_inactivecaption, LookAndFeel::eColorID_inactivecaption, 1.848 + eCSSKeyword_inactivecaptiontext, LookAndFeel::eColorID_inactivecaptiontext, 1.849 + eCSSKeyword_infobackground, LookAndFeel::eColorID_infobackground, 1.850 + eCSSKeyword_infotext, LookAndFeel::eColorID_infotext, 1.851 + eCSSKeyword_menu, LookAndFeel::eColorID_menu, 1.852 + eCSSKeyword_menutext, LookAndFeel::eColorID_menutext, 1.853 + eCSSKeyword_scrollbar, LookAndFeel::eColorID_scrollbar, 1.854 + eCSSKeyword_threeddarkshadow, LookAndFeel::eColorID_threeddarkshadow, 1.855 + eCSSKeyword_threedface, LookAndFeel::eColorID_threedface, 1.856 + eCSSKeyword_threedhighlight, LookAndFeel::eColorID_threedhighlight, 1.857 + eCSSKeyword_threedlightshadow, LookAndFeel::eColorID_threedlightshadow, 1.858 + eCSSKeyword_threedshadow, LookAndFeel::eColorID_threedshadow, 1.859 + eCSSKeyword_window, LookAndFeel::eColorID_window, 1.860 + eCSSKeyword_windowframe, LookAndFeel::eColorID_windowframe, 1.861 + eCSSKeyword_windowtext, LookAndFeel::eColorID_windowtext, 1.862 + eCSSKeyword__moz_activehyperlinktext, NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT, 1.863 + eCSSKeyword__moz_buttondefault, LookAndFeel::eColorID__moz_buttondefault, 1.864 + eCSSKeyword__moz_buttonhoverface, LookAndFeel::eColorID__moz_buttonhoverface, 1.865 + eCSSKeyword__moz_buttonhovertext, LookAndFeel::eColorID__moz_buttonhovertext, 1.866 + eCSSKeyword__moz_cellhighlight, LookAndFeel::eColorID__moz_cellhighlight, 1.867 + eCSSKeyword__moz_cellhighlighttext, LookAndFeel::eColorID__moz_cellhighlighttext, 1.868 + eCSSKeyword__moz_eventreerow, LookAndFeel::eColorID__moz_eventreerow, 1.869 + eCSSKeyword__moz_field, LookAndFeel::eColorID__moz_field, 1.870 + eCSSKeyword__moz_fieldtext, LookAndFeel::eColorID__moz_fieldtext, 1.871 + eCSSKeyword__moz_default_background_color, NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR, 1.872 + eCSSKeyword__moz_default_color, NS_COLOR_MOZ_DEFAULT_COLOR, 1.873 + eCSSKeyword__moz_dialog, LookAndFeel::eColorID__moz_dialog, 1.874 + eCSSKeyword__moz_dialogtext, LookAndFeel::eColorID__moz_dialogtext, 1.875 + eCSSKeyword__moz_dragtargetzone, LookAndFeel::eColorID__moz_dragtargetzone, 1.876 + eCSSKeyword__moz_hyperlinktext, NS_COLOR_MOZ_HYPERLINKTEXT, 1.877 + eCSSKeyword__moz_html_cellhighlight, LookAndFeel::eColorID__moz_html_cellhighlight, 1.878 + eCSSKeyword__moz_html_cellhighlighttext, LookAndFeel::eColorID__moz_html_cellhighlighttext, 1.879 + eCSSKeyword__moz_mac_chrome_active, LookAndFeel::eColorID__moz_mac_chrome_active, 1.880 + eCSSKeyword__moz_mac_chrome_inactive, LookAndFeel::eColorID__moz_mac_chrome_inactive, 1.881 + eCSSKeyword__moz_mac_focusring, LookAndFeel::eColorID__moz_mac_focusring, 1.882 + eCSSKeyword__moz_mac_menuselect, LookAndFeel::eColorID__moz_mac_menuselect, 1.883 + eCSSKeyword__moz_mac_menushadow, LookAndFeel::eColorID__moz_mac_menushadow, 1.884 + eCSSKeyword__moz_mac_menutextdisable, LookAndFeel::eColorID__moz_mac_menutextdisable, 1.885 + eCSSKeyword__moz_mac_menutextselect, LookAndFeel::eColorID__moz_mac_menutextselect, 1.886 + eCSSKeyword__moz_mac_disabledtoolbartext, LookAndFeel::eColorID__moz_mac_disabledtoolbartext, 1.887 + eCSSKeyword__moz_mac_secondaryhighlight, LookAndFeel::eColorID__moz_mac_secondaryhighlight, 1.888 + eCSSKeyword__moz_menuhover, LookAndFeel::eColorID__moz_menuhover, 1.889 + eCSSKeyword__moz_menuhovertext, LookAndFeel::eColorID__moz_menuhovertext, 1.890 + eCSSKeyword__moz_menubartext, LookAndFeel::eColorID__moz_menubartext, 1.891 + eCSSKeyword__moz_menubarhovertext, LookAndFeel::eColorID__moz_menubarhovertext, 1.892 + eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow, 1.893 + eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT, 1.894 + eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR, 1.895 + eCSSKeyword__moz_win_mediatext, LookAndFeel::eColorID__moz_win_mediatext, 1.896 + eCSSKeyword__moz_win_communicationstext, LookAndFeel::eColorID__moz_win_communicationstext, 1.897 + eCSSKeyword__moz_nativehyperlinktext, LookAndFeel::eColorID__moz_nativehyperlinktext, 1.898 + eCSSKeyword__moz_comboboxtext, LookAndFeel::eColorID__moz_comboboxtext, 1.899 + eCSSKeyword__moz_combobox, LookAndFeel::eColorID__moz_combobox, 1.900 + eCSSKeyword_UNKNOWN,-1 1.901 +}; 1.902 + 1.903 +const KTableValue nsCSSProps::kContentKTable[] = { 1.904 + eCSSKeyword_open_quote, NS_STYLE_CONTENT_OPEN_QUOTE, 1.905 + eCSSKeyword_close_quote, NS_STYLE_CONTENT_CLOSE_QUOTE, 1.906 + eCSSKeyword_no_open_quote, NS_STYLE_CONTENT_NO_OPEN_QUOTE, 1.907 + eCSSKeyword_no_close_quote, NS_STYLE_CONTENT_NO_CLOSE_QUOTE, 1.908 + eCSSKeyword__moz_alt_content, NS_STYLE_CONTENT_ALT_CONTENT, 1.909 + eCSSKeyword_UNKNOWN,-1 1.910 +}; 1.911 + 1.912 +const KTableValue nsCSSProps::kControlCharacterVisibilityKTable[] = { 1.913 + eCSSKeyword_hidden, NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN, 1.914 + eCSSKeyword_visible, NS_STYLE_CONTROL_CHARACTER_VISIBILITY_VISIBLE, 1.915 + eCSSKeyword_UNKNOWN,-1 1.916 +}; 1.917 + 1.918 +const KTableValue nsCSSProps::kCursorKTable[] = { 1.919 + // CSS 2.0 1.920 + eCSSKeyword_auto, NS_STYLE_CURSOR_AUTO, 1.921 + eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR, 1.922 + eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT, 1.923 + eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER, 1.924 + eCSSKeyword_move, NS_STYLE_CURSOR_MOVE, 1.925 + eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE, 1.926 + eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE, 1.927 + eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE, 1.928 + eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE, 1.929 + eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE, 1.930 + eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE, 1.931 + eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE, 1.932 + eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE, 1.933 + eCSSKeyword_text, NS_STYLE_CURSOR_TEXT, 1.934 + eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT, 1.935 + eCSSKeyword_help, NS_STYLE_CURSOR_HELP, 1.936 + // CSS 2.1 1.937 + eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING, 1.938 + // CSS3 basic user interface module 1.939 + eCSSKeyword_copy, NS_STYLE_CURSOR_COPY, 1.940 + eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS, 1.941 + eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU, 1.942 + eCSSKeyword_cell, NS_STYLE_CURSOR_CELL, 1.943 + eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED, 1.944 + eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE, 1.945 + eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE, 1.946 + eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP, 1.947 + eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT, 1.948 + eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL, 1.949 + eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE, 1.950 + eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE, 1.951 + eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE, 1.952 + eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE, 1.953 + eCSSKeyword_none, NS_STYLE_CURSOR_NONE, 1.954 + eCSSKeyword_grab, NS_STYLE_CURSOR_GRAB, 1.955 + eCSSKeyword_grabbing, NS_STYLE_CURSOR_GRABBING, 1.956 + eCSSKeyword_zoom_in, NS_STYLE_CURSOR_ZOOM_IN, 1.957 + eCSSKeyword_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT, 1.958 + // -moz- prefixed vendor specific 1.959 + eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB, 1.960 + eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING, 1.961 + eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_ZOOM_IN, 1.962 + eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT, 1.963 + eCSSKeyword_UNKNOWN,-1 1.964 +}; 1.965 + 1.966 +const KTableValue nsCSSProps::kDirectionKTable[] = { 1.967 + eCSSKeyword_ltr, NS_STYLE_DIRECTION_LTR, 1.968 + eCSSKeyword_rtl, NS_STYLE_DIRECTION_RTL, 1.969 + eCSSKeyword_UNKNOWN,-1 1.970 +}; 1.971 + 1.972 +KTableValue nsCSSProps::kDisplayKTable[] = { 1.973 + eCSSKeyword_none, NS_STYLE_DISPLAY_NONE, 1.974 + eCSSKeyword_inline, NS_STYLE_DISPLAY_INLINE, 1.975 + eCSSKeyword_block, NS_STYLE_DISPLAY_BLOCK, 1.976 + eCSSKeyword_inline_block, NS_STYLE_DISPLAY_INLINE_BLOCK, 1.977 + eCSSKeyword_list_item, NS_STYLE_DISPLAY_LIST_ITEM, 1.978 + eCSSKeyword_table, NS_STYLE_DISPLAY_TABLE, 1.979 + eCSSKeyword_inline_table, NS_STYLE_DISPLAY_INLINE_TABLE, 1.980 + eCSSKeyword_table_row_group, NS_STYLE_DISPLAY_TABLE_ROW_GROUP, 1.981 + eCSSKeyword_table_header_group, NS_STYLE_DISPLAY_TABLE_HEADER_GROUP, 1.982 + eCSSKeyword_table_footer_group, NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP, 1.983 + eCSSKeyword_table_row, NS_STYLE_DISPLAY_TABLE_ROW, 1.984 + eCSSKeyword_table_column_group, NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP, 1.985 + eCSSKeyword_table_column, NS_STYLE_DISPLAY_TABLE_COLUMN, 1.986 + eCSSKeyword_table_cell, NS_STYLE_DISPLAY_TABLE_CELL, 1.987 + eCSSKeyword_table_caption, NS_STYLE_DISPLAY_TABLE_CAPTION, 1.988 + // Make sure this is kept in sync with the code in 1.989 + // nsCSSFrameConstructor::ConstructXULFrame 1.990 + eCSSKeyword__moz_box, NS_STYLE_DISPLAY_BOX, 1.991 + eCSSKeyword__moz_inline_box, NS_STYLE_DISPLAY_INLINE_BOX, 1.992 +#ifdef MOZ_XUL 1.993 + eCSSKeyword__moz_grid, NS_STYLE_DISPLAY_XUL_GRID, 1.994 + eCSSKeyword__moz_inline_grid, NS_STYLE_DISPLAY_INLINE_XUL_GRID, 1.995 + eCSSKeyword__moz_grid_group, NS_STYLE_DISPLAY_XUL_GRID_GROUP, 1.996 + eCSSKeyword__moz_grid_line, NS_STYLE_DISPLAY_XUL_GRID_LINE, 1.997 + eCSSKeyword__moz_stack, NS_STYLE_DISPLAY_STACK, 1.998 + eCSSKeyword__moz_inline_stack, NS_STYLE_DISPLAY_INLINE_STACK, 1.999 + eCSSKeyword__moz_deck, NS_STYLE_DISPLAY_DECK, 1.1000 + eCSSKeyword__moz_popup, NS_STYLE_DISPLAY_POPUP, 1.1001 + eCSSKeyword__moz_groupbox, NS_STYLE_DISPLAY_GROUPBOX, 1.1002 +#endif 1.1003 + eCSSKeyword_flex, NS_STYLE_DISPLAY_FLEX, 1.1004 + eCSSKeyword_inline_flex, NS_STYLE_DISPLAY_INLINE_FLEX, 1.1005 + // The next two entries are controlled by the layout.css.grid.enabled pref. 1.1006 + eCSSKeyword_grid, NS_STYLE_DISPLAY_GRID, 1.1007 + eCSSKeyword_inline_grid, NS_STYLE_DISPLAY_INLINE_GRID, 1.1008 + eCSSKeyword_UNKNOWN,-1 1.1009 +}; 1.1010 + 1.1011 +const KTableValue nsCSSProps::kEmptyCellsKTable[] = { 1.1012 + eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW, 1.1013 + eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE, 1.1014 + eCSSKeyword__moz_show_background, NS_STYLE_TABLE_EMPTY_CELLS_SHOW_BACKGROUND, 1.1015 + eCSSKeyword_UNKNOWN,-1 1.1016 +}; 1.1017 + 1.1018 +const KTableValue nsCSSProps::kAlignContentKTable[] = { 1.1019 + eCSSKeyword_flex_start, NS_STYLE_ALIGN_CONTENT_FLEX_START, 1.1020 + eCSSKeyword_flex_end, NS_STYLE_ALIGN_CONTENT_FLEX_END, 1.1021 + eCSSKeyword_center, NS_STYLE_ALIGN_CONTENT_CENTER, 1.1022 + eCSSKeyword_space_between, NS_STYLE_ALIGN_CONTENT_SPACE_BETWEEN, 1.1023 + eCSSKeyword_space_around, NS_STYLE_ALIGN_CONTENT_SPACE_AROUND, 1.1024 + eCSSKeyword_stretch, NS_STYLE_ALIGN_CONTENT_STRETCH, 1.1025 + eCSSKeyword_UNKNOWN,-1 1.1026 +}; 1.1027 + 1.1028 +const KTableValue nsCSSProps::kAlignItemsKTable[] = { 1.1029 + eCSSKeyword_flex_start, NS_STYLE_ALIGN_ITEMS_FLEX_START, 1.1030 + eCSSKeyword_flex_end, NS_STYLE_ALIGN_ITEMS_FLEX_END, 1.1031 + eCSSKeyword_center, NS_STYLE_ALIGN_ITEMS_CENTER, 1.1032 + eCSSKeyword_baseline, NS_STYLE_ALIGN_ITEMS_BASELINE, 1.1033 + eCSSKeyword_stretch, NS_STYLE_ALIGN_ITEMS_STRETCH, 1.1034 + eCSSKeyword_UNKNOWN,-1 1.1035 +}; 1.1036 + 1.1037 +// Note: 'align-self' takes the same keywords as 'align-items', plus 'auto'. 1.1038 +const KTableValue nsCSSProps::kAlignSelfKTable[] = { 1.1039 + eCSSKeyword_flex_start, NS_STYLE_ALIGN_ITEMS_FLEX_START, 1.1040 + eCSSKeyword_flex_end, NS_STYLE_ALIGN_ITEMS_FLEX_END, 1.1041 + eCSSKeyword_center, NS_STYLE_ALIGN_ITEMS_CENTER, 1.1042 + eCSSKeyword_baseline, NS_STYLE_ALIGN_ITEMS_BASELINE, 1.1043 + eCSSKeyword_stretch, NS_STYLE_ALIGN_ITEMS_STRETCH, 1.1044 + eCSSKeyword_auto, NS_STYLE_ALIGN_SELF_AUTO, 1.1045 + eCSSKeyword_UNKNOWN,-1 1.1046 +}; 1.1047 + 1.1048 +const KTableValue nsCSSProps::kFlexDirectionKTable[] = { 1.1049 + eCSSKeyword_row, NS_STYLE_FLEX_DIRECTION_ROW, 1.1050 + eCSSKeyword_row_reverse, NS_STYLE_FLEX_DIRECTION_ROW_REVERSE, 1.1051 + eCSSKeyword_column, NS_STYLE_FLEX_DIRECTION_COLUMN, 1.1052 + eCSSKeyword_column_reverse, NS_STYLE_FLEX_DIRECTION_COLUMN_REVERSE, 1.1053 + eCSSKeyword_UNKNOWN,-1 1.1054 +}; 1.1055 + 1.1056 +const KTableValue nsCSSProps::kFlexWrapKTable[] = { 1.1057 + eCSSKeyword_nowrap, NS_STYLE_FLEX_WRAP_NOWRAP, 1.1058 + eCSSKeyword_wrap, NS_STYLE_FLEX_WRAP_WRAP, 1.1059 + eCSSKeyword_wrap_reverse, NS_STYLE_FLEX_WRAP_WRAP_REVERSE, 1.1060 + eCSSKeyword_UNKNOWN,-1 1.1061 +}; 1.1062 + 1.1063 +const KTableValue nsCSSProps::kJustifyContentKTable[] = { 1.1064 + eCSSKeyword_flex_start, NS_STYLE_JUSTIFY_CONTENT_FLEX_START, 1.1065 + eCSSKeyword_flex_end, NS_STYLE_JUSTIFY_CONTENT_FLEX_END, 1.1066 + eCSSKeyword_center, NS_STYLE_JUSTIFY_CONTENT_CENTER, 1.1067 + eCSSKeyword_space_between, NS_STYLE_JUSTIFY_CONTENT_SPACE_BETWEEN, 1.1068 + eCSSKeyword_space_around, NS_STYLE_JUSTIFY_CONTENT_SPACE_AROUND, 1.1069 + eCSSKeyword_UNKNOWN,-1 1.1070 +}; 1.1071 + 1.1072 +const KTableValue nsCSSProps::kFloatKTable[] = { 1.1073 + eCSSKeyword_none, NS_STYLE_FLOAT_NONE, 1.1074 + eCSSKeyword_left, NS_STYLE_FLOAT_LEFT, 1.1075 + eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT, 1.1076 + eCSSKeyword_UNKNOWN,-1 1.1077 +}; 1.1078 + 1.1079 +const KTableValue nsCSSProps::kFloatEdgeKTable[] = { 1.1080 + eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT, 1.1081 + eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN, 1.1082 + eCSSKeyword_UNKNOWN,-1 1.1083 +}; 1.1084 + 1.1085 +const KTableValue nsCSSProps::kFontKTable[] = { 1.1086 + // CSS2. 1.1087 + eCSSKeyword_caption, NS_STYLE_FONT_CAPTION, 1.1088 + eCSSKeyword_icon, NS_STYLE_FONT_ICON, 1.1089 + eCSSKeyword_menu, NS_STYLE_FONT_MENU, 1.1090 + eCSSKeyword_message_box, NS_STYLE_FONT_MESSAGE_BOX, 1.1091 + eCSSKeyword_small_caption, NS_STYLE_FONT_SMALL_CAPTION, 1.1092 + eCSSKeyword_status_bar, NS_STYLE_FONT_STATUS_BAR, 1.1093 + 1.1094 + // Proposed for CSS3. 1.1095 + eCSSKeyword__moz_window, NS_STYLE_FONT_WINDOW, 1.1096 + eCSSKeyword__moz_document, NS_STYLE_FONT_DOCUMENT, 1.1097 + eCSSKeyword__moz_workspace, NS_STYLE_FONT_WORKSPACE, 1.1098 + eCSSKeyword__moz_desktop, NS_STYLE_FONT_DESKTOP, 1.1099 + eCSSKeyword__moz_info, NS_STYLE_FONT_INFO, 1.1100 + eCSSKeyword__moz_dialog, NS_STYLE_FONT_DIALOG, 1.1101 + eCSSKeyword__moz_button, NS_STYLE_FONT_BUTTON, 1.1102 + eCSSKeyword__moz_pull_down_menu, NS_STYLE_FONT_PULL_DOWN_MENU, 1.1103 + eCSSKeyword__moz_list, NS_STYLE_FONT_LIST, 1.1104 + eCSSKeyword__moz_field, NS_STYLE_FONT_FIELD, 1.1105 + eCSSKeyword_UNKNOWN,-1 1.1106 +}; 1.1107 + 1.1108 +const KTableValue nsCSSProps::kFontKerningKTable[] = { 1.1109 + eCSSKeyword_auto, NS_FONT_KERNING_AUTO, 1.1110 + eCSSKeyword_none, NS_FONT_KERNING_NONE, 1.1111 + eCSSKeyword_normal, NS_FONT_KERNING_NORMAL, 1.1112 + eCSSKeyword_UNKNOWN,-1 1.1113 +}; 1.1114 + 1.1115 +const KTableValue nsCSSProps::kFontSizeKTable[] = { 1.1116 + eCSSKeyword_xx_small, NS_STYLE_FONT_SIZE_XXSMALL, 1.1117 + eCSSKeyword_x_small, NS_STYLE_FONT_SIZE_XSMALL, 1.1118 + eCSSKeyword_small, NS_STYLE_FONT_SIZE_SMALL, 1.1119 + eCSSKeyword_medium, NS_STYLE_FONT_SIZE_MEDIUM, 1.1120 + eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE, 1.1121 + eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE, 1.1122 + eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE, 1.1123 + eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER, 1.1124 + eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER, 1.1125 + eCSSKeyword_UNKNOWN,-1 1.1126 +}; 1.1127 + 1.1128 +const KTableValue nsCSSProps::kFontSmoothingKTable[] = { 1.1129 + eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO, 1.1130 + eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE, 1.1131 + eCSSKeyword_UNKNOWN,-1 1.1132 +}; 1.1133 + 1.1134 +const KTableValue nsCSSProps::kFontStretchKTable[] = { 1.1135 + eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED, 1.1136 + eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED, 1.1137 + eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED, 1.1138 + eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED, 1.1139 + eCSSKeyword_normal, NS_STYLE_FONT_STRETCH_NORMAL, 1.1140 + eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED, 1.1141 + eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED, 1.1142 + eCSSKeyword_extra_expanded, NS_STYLE_FONT_STRETCH_EXTRA_EXPANDED, 1.1143 + eCSSKeyword_ultra_expanded, NS_STYLE_FONT_STRETCH_ULTRA_EXPANDED, 1.1144 + eCSSKeyword_UNKNOWN,-1 1.1145 +}; 1.1146 + 1.1147 +const KTableValue nsCSSProps::kFontStyleKTable[] = { 1.1148 + eCSSKeyword_normal, NS_STYLE_FONT_STYLE_NORMAL, 1.1149 + eCSSKeyword_italic, NS_STYLE_FONT_STYLE_ITALIC, 1.1150 + eCSSKeyword_oblique, NS_STYLE_FONT_STYLE_OBLIQUE, 1.1151 + eCSSKeyword_UNKNOWN,-1 1.1152 +}; 1.1153 + 1.1154 +const KTableValue nsCSSProps::kFontSynthesisKTable[] = { 1.1155 + eCSSKeyword_weight, NS_FONT_SYNTHESIS_WEIGHT, 1.1156 + eCSSKeyword_style, NS_FONT_SYNTHESIS_STYLE, 1.1157 + eCSSKeyword_UNKNOWN,-1 1.1158 +}; 1.1159 + 1.1160 + 1.1161 +const KTableValue nsCSSProps::kFontVariantKTable[] = { 1.1162 + eCSSKeyword_normal, NS_STYLE_FONT_VARIANT_NORMAL, 1.1163 + eCSSKeyword_small_caps, NS_STYLE_FONT_VARIANT_SMALL_CAPS, 1.1164 + eCSSKeyword_UNKNOWN,-1 1.1165 +}; 1.1166 + 1.1167 +const KTableValue nsCSSProps::kFontVariantAlternatesKTable[] = { 1.1168 + eCSSKeyword_historical_forms, NS_FONT_VARIANT_ALTERNATES_HISTORICAL, 1.1169 + eCSSKeyword_UNKNOWN,-1 1.1170 +}; 1.1171 + 1.1172 +const KTableValue nsCSSProps::kFontVariantAlternatesFuncsKTable[] = { 1.1173 + eCSSKeyword_stylistic, NS_FONT_VARIANT_ALTERNATES_STYLISTIC, 1.1174 + eCSSKeyword_styleset, NS_FONT_VARIANT_ALTERNATES_STYLESET, 1.1175 + eCSSKeyword_character_variant, NS_FONT_VARIANT_ALTERNATES_CHARACTER_VARIANT, 1.1176 + eCSSKeyword_swash, NS_FONT_VARIANT_ALTERNATES_SWASH, 1.1177 + eCSSKeyword_ornaments, NS_FONT_VARIANT_ALTERNATES_ORNAMENTS, 1.1178 + eCSSKeyword_annotation, NS_FONT_VARIANT_ALTERNATES_ANNOTATION, 1.1179 + eCSSKeyword_UNKNOWN,-1 1.1180 +}; 1.1181 + 1.1182 +const KTableValue nsCSSProps::kFontVariantCapsKTable[] = { 1.1183 + eCSSKeyword_small_caps, NS_FONT_VARIANT_CAPS_SMALLCAPS, 1.1184 + eCSSKeyword_all_small_caps, NS_FONT_VARIANT_CAPS_ALLSMALL, 1.1185 + eCSSKeyword_petite_caps, NS_FONT_VARIANT_CAPS_PETITECAPS, 1.1186 + eCSSKeyword_all_petite_caps, NS_FONT_VARIANT_CAPS_ALLPETITE, 1.1187 + eCSSKeyword_titling_caps, NS_FONT_VARIANT_CAPS_TITLING, 1.1188 + eCSSKeyword_unicase, NS_FONT_VARIANT_CAPS_UNICASE, 1.1189 + eCSSKeyword_UNKNOWN,-1 1.1190 +}; 1.1191 + 1.1192 +const KTableValue nsCSSProps::kFontVariantEastAsianKTable[] = { 1.1193 + eCSSKeyword_jis78, NS_FONT_VARIANT_EAST_ASIAN_JIS78, 1.1194 + eCSSKeyword_jis83, NS_FONT_VARIANT_EAST_ASIAN_JIS83, 1.1195 + eCSSKeyword_jis90, NS_FONT_VARIANT_EAST_ASIAN_JIS90, 1.1196 + eCSSKeyword_jis04, NS_FONT_VARIANT_EAST_ASIAN_JIS04, 1.1197 + eCSSKeyword_simplified, NS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED, 1.1198 + eCSSKeyword_traditional, NS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL, 1.1199 + eCSSKeyword_full_width, NS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH, 1.1200 + eCSSKeyword_proportional_width, NS_FONT_VARIANT_EAST_ASIAN_PROP_WIDTH, 1.1201 + eCSSKeyword_ruby, NS_FONT_VARIANT_EAST_ASIAN_RUBY, 1.1202 + eCSSKeyword_UNKNOWN,-1 1.1203 +}; 1.1204 + 1.1205 +const KTableValue nsCSSProps::kFontVariantLigaturesKTable[] = { 1.1206 + eCSSKeyword_none, NS_FONT_VARIANT_LIGATURES_NONE, 1.1207 + eCSSKeyword_common_ligatures, NS_FONT_VARIANT_LIGATURES_COMMON, 1.1208 + eCSSKeyword_no_common_ligatures, NS_FONT_VARIANT_LIGATURES_NO_COMMON, 1.1209 + eCSSKeyword_discretionary_ligatures, NS_FONT_VARIANT_LIGATURES_DISCRETIONARY, 1.1210 + eCSSKeyword_no_discretionary_ligatures, NS_FONT_VARIANT_LIGATURES_NO_DISCRETIONARY, 1.1211 + eCSSKeyword_historical_ligatures, NS_FONT_VARIANT_LIGATURES_HISTORICAL, 1.1212 + eCSSKeyword_no_historical_ligatures, NS_FONT_VARIANT_LIGATURES_NO_HISTORICAL, 1.1213 + eCSSKeyword_contextual, NS_FONT_VARIANT_LIGATURES_CONTEXTUAL, 1.1214 + eCSSKeyword_no_contextual, NS_FONT_VARIANT_LIGATURES_NO_CONTEXTUAL, 1.1215 + eCSSKeyword_UNKNOWN,-1 1.1216 +}; 1.1217 + 1.1218 +const KTableValue nsCSSProps::kFontVariantNumericKTable[] = { 1.1219 + eCSSKeyword_lining_nums, NS_FONT_VARIANT_NUMERIC_LINING, 1.1220 + eCSSKeyword_oldstyle_nums, NS_FONT_VARIANT_NUMERIC_OLDSTYLE, 1.1221 + eCSSKeyword_proportional_nums, NS_FONT_VARIANT_NUMERIC_PROPORTIONAL, 1.1222 + eCSSKeyword_tabular_nums, NS_FONT_VARIANT_NUMERIC_TABULAR, 1.1223 + eCSSKeyword_diagonal_fractions, NS_FONT_VARIANT_NUMERIC_DIAGONAL_FRACTIONS, 1.1224 + eCSSKeyword_stacked_fractions, NS_FONT_VARIANT_NUMERIC_STACKED_FRACTIONS, 1.1225 + eCSSKeyword_slashed_zero, NS_FONT_VARIANT_NUMERIC_SLASHZERO, 1.1226 + eCSSKeyword_ordinal, NS_FONT_VARIANT_NUMERIC_ORDINAL, 1.1227 + eCSSKeyword_UNKNOWN,-1 1.1228 +}; 1.1229 + 1.1230 +const KTableValue nsCSSProps::kFontVariantPositionKTable[] = { 1.1231 + eCSSKeyword_super, NS_FONT_VARIANT_POSITION_SUPER, 1.1232 + eCSSKeyword_sub, NS_FONT_VARIANT_POSITION_SUB, 1.1233 + eCSSKeyword_UNKNOWN,-1 1.1234 +}; 1.1235 + 1.1236 +const KTableValue nsCSSProps::kFontWeightKTable[] = { 1.1237 + eCSSKeyword_normal, NS_STYLE_FONT_WEIGHT_NORMAL, 1.1238 + eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD, 1.1239 + eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER, 1.1240 + eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER, 1.1241 + eCSSKeyword_UNKNOWN,-1 1.1242 +}; 1.1243 + 1.1244 +const KTableValue nsCSSProps::kGridAutoFlowKTable[] = { 1.1245 + eCSSKeyword_none, NS_STYLE_GRID_AUTO_FLOW_NONE, 1.1246 + eCSSKeyword_column, NS_STYLE_GRID_AUTO_FLOW_COLUMN, 1.1247 + eCSSKeyword_row, NS_STYLE_GRID_AUTO_FLOW_ROW, 1.1248 + eCSSKeyword_dense, NS_STYLE_GRID_AUTO_FLOW_DENSE, 1.1249 + eCSSKeyword_UNKNOWN,-1 1.1250 +}; 1.1251 + 1.1252 +const KTableValue nsCSSProps::kGridTrackBreadthKTable[] = { 1.1253 + eCSSKeyword_min_content, NS_STYLE_GRID_TRACK_BREADTH_MIN_CONTENT, 1.1254 + eCSSKeyword_max_content, NS_STYLE_GRID_TRACK_BREADTH_MAX_CONTENT, 1.1255 + eCSSKeyword_UNKNOWN,-1 1.1256 +}; 1.1257 + 1.1258 +const KTableValue nsCSSProps::kImageOrientationKTable[] = { 1.1259 + eCSSKeyword_flip, NS_STYLE_IMAGE_ORIENTATION_FLIP, 1.1260 + eCSSKeyword_from_image, NS_STYLE_IMAGE_ORIENTATION_FROM_IMAGE, 1.1261 + eCSSKeyword_UNKNOWN,-1 1.1262 +}; 1.1263 + 1.1264 +const KTableValue nsCSSProps::kImageOrientationFlipKTable[] = { 1.1265 + eCSSKeyword_flip, NS_STYLE_IMAGE_ORIENTATION_FLIP, 1.1266 + eCSSKeyword_UNKNOWN,-1 1.1267 +}; 1.1268 + 1.1269 +const KTableValue nsCSSProps::kIMEModeKTable[] = { 1.1270 + eCSSKeyword_normal, NS_STYLE_IME_MODE_NORMAL, 1.1271 + eCSSKeyword_auto, NS_STYLE_IME_MODE_AUTO, 1.1272 + eCSSKeyword_active, NS_STYLE_IME_MODE_ACTIVE, 1.1273 + eCSSKeyword_disabled, NS_STYLE_IME_MODE_DISABLED, 1.1274 + eCSSKeyword_inactive, NS_STYLE_IME_MODE_INACTIVE, 1.1275 + eCSSKeyword_UNKNOWN,-1 1.1276 +}; 1.1277 + 1.1278 +const KTableValue nsCSSProps::kLineHeightKTable[] = { 1.1279 + // -moz- prefixed, intended for internal use for single-line controls 1.1280 + eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT, 1.1281 + eCSSKeyword_UNKNOWN,-1 1.1282 +}; 1.1283 + 1.1284 +const KTableValue nsCSSProps::kListStylePositionKTable[] = { 1.1285 + eCSSKeyword_inside, NS_STYLE_LIST_STYLE_POSITION_INSIDE, 1.1286 + eCSSKeyword_outside, NS_STYLE_LIST_STYLE_POSITION_OUTSIDE, 1.1287 + eCSSKeyword_UNKNOWN,-1 1.1288 +}; 1.1289 + 1.1290 +const KTableValue nsCSSProps::kListStyleKTable[] = { 1.1291 + eCSSKeyword_none, NS_STYLE_LIST_STYLE_NONE, 1.1292 + eCSSKeyword_disc, NS_STYLE_LIST_STYLE_DISC, 1.1293 + eCSSKeyword_circle, NS_STYLE_LIST_STYLE_CIRCLE, 1.1294 + eCSSKeyword_square, NS_STYLE_LIST_STYLE_SQUARE, 1.1295 + eCSSKeyword_decimal, NS_STYLE_LIST_STYLE_DECIMAL, 1.1296 + eCSSKeyword_decimal_leading_zero, NS_STYLE_LIST_STYLE_DECIMAL_LEADING_ZERO, 1.1297 + eCSSKeyword_lower_roman, NS_STYLE_LIST_STYLE_LOWER_ROMAN, 1.1298 + eCSSKeyword_upper_roman, NS_STYLE_LIST_STYLE_UPPER_ROMAN, 1.1299 + eCSSKeyword_lower_greek, NS_STYLE_LIST_STYLE_LOWER_GREEK, 1.1300 + eCSSKeyword_lower_alpha, NS_STYLE_LIST_STYLE_LOWER_ALPHA, 1.1301 + eCSSKeyword_lower_latin, NS_STYLE_LIST_STYLE_LOWER_LATIN, 1.1302 + eCSSKeyword_upper_alpha, NS_STYLE_LIST_STYLE_UPPER_ALPHA, 1.1303 + eCSSKeyword_upper_latin, NS_STYLE_LIST_STYLE_UPPER_LATIN, 1.1304 + eCSSKeyword_hebrew, NS_STYLE_LIST_STYLE_HEBREW, 1.1305 + eCSSKeyword_armenian, NS_STYLE_LIST_STYLE_ARMENIAN, 1.1306 + eCSSKeyword_georgian, NS_STYLE_LIST_STYLE_GEORGIAN, 1.1307 + eCSSKeyword_cjk_decimal, NS_STYLE_LIST_STYLE_CJK_DECIMAL, 1.1308 + eCSSKeyword_cjk_ideographic, NS_STYLE_LIST_STYLE_CJK_IDEOGRAPHIC, 1.1309 + eCSSKeyword_hiragana, NS_STYLE_LIST_STYLE_HIRAGANA, 1.1310 + eCSSKeyword_katakana, NS_STYLE_LIST_STYLE_KATAKANA, 1.1311 + eCSSKeyword_hiragana_iroha, NS_STYLE_LIST_STYLE_HIRAGANA_IROHA, 1.1312 + eCSSKeyword_katakana_iroha, NS_STYLE_LIST_STYLE_KATAKANA_IROHA, 1.1313 + eCSSKeyword_japanese_informal, NS_STYLE_LIST_STYLE_JAPANESE_INFORMAL, 1.1314 + eCSSKeyword_japanese_formal, NS_STYLE_LIST_STYLE_JAPANESE_FORMAL, 1.1315 + eCSSKeyword_korean_hangul_formal, NS_STYLE_LIST_STYLE_KOREAN_HANGUL_FORMAL, 1.1316 + eCSSKeyword_korean_hanja_informal, NS_STYLE_LIST_STYLE_KOREAN_HANJA_INFORMAL, 1.1317 + eCSSKeyword_korean_hanja_formal, NS_STYLE_LIST_STYLE_KOREAN_HANJA_FORMAL, 1.1318 + eCSSKeyword_simp_chinese_informal, NS_STYLE_LIST_STYLE_SIMP_CHINESE_INFORMAL, 1.1319 + eCSSKeyword_simp_chinese_formal, NS_STYLE_LIST_STYLE_SIMP_CHINESE_FORMAL, 1.1320 + eCSSKeyword_trad_chinese_informal, NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL, 1.1321 + eCSSKeyword_trad_chinese_formal, NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL, 1.1322 + eCSSKeyword__moz_cjk_heavenly_stem, NS_STYLE_LIST_STYLE_MOZ_CJK_HEAVENLY_STEM, 1.1323 + eCSSKeyword__moz_cjk_earthly_branch, NS_STYLE_LIST_STYLE_MOZ_CJK_EARTHLY_BRANCH, 1.1324 + eCSSKeyword__moz_trad_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_INFORMAL, 1.1325 + eCSSKeyword__moz_trad_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_TRAD_CHINESE_FORMAL, 1.1326 + eCSSKeyword__moz_simp_chinese_informal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_INFORMAL, 1.1327 + eCSSKeyword__moz_simp_chinese_formal, NS_STYLE_LIST_STYLE_MOZ_SIMP_CHINESE_FORMAL, 1.1328 + eCSSKeyword__moz_japanese_informal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_INFORMAL, 1.1329 + eCSSKeyword__moz_japanese_formal, NS_STYLE_LIST_STYLE_MOZ_JAPANESE_FORMAL, 1.1330 + eCSSKeyword__moz_arabic_indic, NS_STYLE_LIST_STYLE_MOZ_ARABIC_INDIC, 1.1331 + eCSSKeyword__moz_persian, NS_STYLE_LIST_STYLE_MOZ_PERSIAN, 1.1332 + eCSSKeyword__moz_urdu, NS_STYLE_LIST_STYLE_MOZ_URDU, 1.1333 + eCSSKeyword__moz_devanagari, NS_STYLE_LIST_STYLE_MOZ_DEVANAGARI, 1.1334 + eCSSKeyword__moz_gurmukhi, NS_STYLE_LIST_STYLE_MOZ_GURMUKHI, 1.1335 + eCSSKeyword__moz_gujarati, NS_STYLE_LIST_STYLE_MOZ_GUJARATI, 1.1336 + eCSSKeyword__moz_oriya, NS_STYLE_LIST_STYLE_MOZ_ORIYA, 1.1337 + eCSSKeyword__moz_kannada, NS_STYLE_LIST_STYLE_MOZ_KANNADA, 1.1338 + eCSSKeyword__moz_malayalam, NS_STYLE_LIST_STYLE_MOZ_MALAYALAM, 1.1339 + eCSSKeyword__moz_bengali, NS_STYLE_LIST_STYLE_MOZ_BENGALI, 1.1340 + eCSSKeyword__moz_tamil, NS_STYLE_LIST_STYLE_MOZ_TAMIL, 1.1341 + eCSSKeyword__moz_telugu, NS_STYLE_LIST_STYLE_MOZ_TELUGU, 1.1342 + eCSSKeyword__moz_thai, NS_STYLE_LIST_STYLE_MOZ_THAI, 1.1343 + eCSSKeyword__moz_lao, NS_STYLE_LIST_STYLE_MOZ_LAO, 1.1344 + eCSSKeyword__moz_myanmar, NS_STYLE_LIST_STYLE_MOZ_MYANMAR, 1.1345 + eCSSKeyword__moz_khmer, NS_STYLE_LIST_STYLE_MOZ_KHMER, 1.1346 + eCSSKeyword__moz_hangul, NS_STYLE_LIST_STYLE_MOZ_HANGUL, 1.1347 + eCSSKeyword__moz_hangul_consonant, NS_STYLE_LIST_STYLE_MOZ_HANGUL_CONSONANT, 1.1348 + eCSSKeyword__moz_ethiopic_halehame, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME, 1.1349 + eCSSKeyword__moz_ethiopic_numeric, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_NUMERIC, 1.1350 + eCSSKeyword__moz_ethiopic_halehame_am, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_AM, 1.1351 + eCSSKeyword__moz_ethiopic_halehame_ti_er, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ER, 1.1352 + eCSSKeyword__moz_ethiopic_halehame_ti_et, NS_STYLE_LIST_STYLE_MOZ_ETHIOPIC_HALEHAME_TI_ET, 1.1353 + eCSSKeyword_UNKNOWN,-1 1.1354 +}; 1.1355 + 1.1356 +const KTableValue nsCSSProps::kMathVariantKTable[] = { 1.1357 + eCSSKeyword_none, NS_MATHML_MATHVARIANT_NONE, 1.1358 + eCSSKeyword_normal, NS_MATHML_MATHVARIANT_NORMAL, 1.1359 + eCSSKeyword_bold, NS_MATHML_MATHVARIANT_BOLD, 1.1360 + eCSSKeyword_italic, NS_MATHML_MATHVARIANT_ITALIC, 1.1361 + eCSSKeyword_bold_italic, NS_MATHML_MATHVARIANT_BOLD_ITALIC, 1.1362 + eCSSKeyword_script, NS_MATHML_MATHVARIANT_SCRIPT, 1.1363 + eCSSKeyword_bold_script, NS_MATHML_MATHVARIANT_BOLD_SCRIPT, 1.1364 + eCSSKeyword_fraktur, NS_MATHML_MATHVARIANT_FRAKTUR, 1.1365 + eCSSKeyword_double_struck, NS_MATHML_MATHVARIANT_DOUBLE_STRUCK, 1.1366 + eCSSKeyword_bold_fraktur, NS_MATHML_MATHVARIANT_BOLD_FRAKTUR, 1.1367 + eCSSKeyword_sans_serif, NS_MATHML_MATHVARIANT_SANS_SERIF, 1.1368 + eCSSKeyword_bold_sans_serif, NS_MATHML_MATHVARIANT_BOLD_SANS_SERIF, 1.1369 + eCSSKeyword_sans_serif_italic, NS_MATHML_MATHVARIANT_SANS_SERIF_ITALIC, 1.1370 + eCSSKeyword_sans_serif_bold_italic, NS_MATHML_MATHVARIANT_SANS_SERIF_BOLD_ITALIC, 1.1371 + eCSSKeyword_monospace, NS_MATHML_MATHVARIANT_MONOSPACE, 1.1372 + eCSSKeyword_initial, NS_MATHML_MATHVARIANT_INITIAL, 1.1373 + eCSSKeyword_tailed, NS_MATHML_MATHVARIANT_TAILED, 1.1374 + eCSSKeyword_looped, NS_MATHML_MATHVARIANT_LOOPED, 1.1375 + eCSSKeyword_stretched, NS_MATHML_MATHVARIANT_STRETCHED, 1.1376 + eCSSKeyword_UNKNOWN,-1 1.1377 +}; 1.1378 + 1.1379 +const KTableValue nsCSSProps::kMathDisplayKTable[] = { 1.1380 + eCSSKeyword_inline, NS_MATHML_DISPLAYSTYLE_INLINE, 1.1381 + eCSSKeyword_block, NS_MATHML_DISPLAYSTYLE_BLOCK, 1.1382 + eCSSKeyword_UNKNOWN,-1 1.1383 +}; 1.1384 + 1.1385 +const KTableValue nsCSSProps::kContextOpacityKTable[] = { 1.1386 + eCSSKeyword_context_fill_opacity, NS_STYLE_CONTEXT_FILL_OPACITY, 1.1387 + eCSSKeyword_context_stroke_opacity, NS_STYLE_CONTEXT_STROKE_OPACITY, 1.1388 + eCSSKeyword_UNKNOWN,-1 1.1389 +}; 1.1390 + 1.1391 +const KTableValue nsCSSProps::kContextPatternKTable[] = { 1.1392 + eCSSKeyword_context_fill, NS_COLOR_CONTEXT_FILL, 1.1393 + eCSSKeyword_context_stroke, NS_COLOR_CONTEXT_STROKE, 1.1394 + eCSSKeyword_UNKNOWN,-1 1.1395 +}; 1.1396 + 1.1397 +const KTableValue nsCSSProps::kOrientKTable[] = { 1.1398 + eCSSKeyword_horizontal, NS_STYLE_ORIENT_HORIZONTAL, 1.1399 + eCSSKeyword_vertical, NS_STYLE_ORIENT_VERTICAL, 1.1400 + eCSSKeyword_auto, NS_STYLE_ORIENT_AUTO, 1.1401 + eCSSKeyword_UNKNOWN, -1 1.1402 +}; 1.1403 + 1.1404 +// Same as kBorderStyleKTable except 'hidden'. 1.1405 +const KTableValue nsCSSProps::kOutlineStyleKTable[] = { 1.1406 + eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE, 1.1407 + eCSSKeyword_auto, NS_STYLE_BORDER_STYLE_AUTO, 1.1408 + eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED, 1.1409 + eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED, 1.1410 + eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID, 1.1411 + eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE, 1.1412 + eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE, 1.1413 + eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE, 1.1414 + eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET, 1.1415 + eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET, 1.1416 + eCSSKeyword_UNKNOWN,-1 1.1417 +}; 1.1418 + 1.1419 +const KTableValue nsCSSProps::kOutlineColorKTable[] = { 1.1420 + eCSSKeyword__moz_use_text_color, NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, 1.1421 + eCSSKeyword_UNKNOWN,-1 1.1422 +}; 1.1423 + 1.1424 +const KTableValue nsCSSProps::kOverflowKTable[] = { 1.1425 + eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO, 1.1426 + eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE, 1.1427 + eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN, 1.1428 + eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL, 1.1429 + // Deprecated: 1.1430 + eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN, 1.1431 + eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL, 1.1432 + eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL, 1.1433 + eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP, 1.1434 + eCSSKeyword_UNKNOWN,-1 1.1435 +}; 1.1436 + 1.1437 +const KTableValue nsCSSProps::kOverflowClipBoxKTable[] = { 1.1438 + eCSSKeyword_padding_box, NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX, 1.1439 + eCSSKeyword_content_box, NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX, 1.1440 + eCSSKeyword_UNKNOWN,-1 1.1441 +}; 1.1442 + 1.1443 +const KTableValue nsCSSProps::kOverflowSubKTable[] = { 1.1444 + eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO, 1.1445 + eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE, 1.1446 + eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN, 1.1447 + eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL, 1.1448 + // Deprecated: 1.1449 + eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP, 1.1450 + eCSSKeyword_UNKNOWN,-1 1.1451 +}; 1.1452 + 1.1453 +const KTableValue nsCSSProps::kPageBreakKTable[] = { 1.1454 + eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO, 1.1455 + eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS, 1.1456 + eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID, 1.1457 + eCSSKeyword_left, NS_STYLE_PAGE_BREAK_LEFT, 1.1458 + eCSSKeyword_right, NS_STYLE_PAGE_BREAK_RIGHT, 1.1459 + eCSSKeyword_UNKNOWN,-1 1.1460 +}; 1.1461 + 1.1462 +const KTableValue nsCSSProps::kPageBreakInsideKTable[] = { 1.1463 + eCSSKeyword_auto, NS_STYLE_PAGE_BREAK_AUTO, 1.1464 + eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID, 1.1465 + eCSSKeyword_UNKNOWN,-1 1.1466 +}; 1.1467 + 1.1468 +const KTableValue nsCSSProps::kPageMarksKTable[] = { 1.1469 + eCSSKeyword_none, NS_STYLE_PAGE_MARKS_NONE, 1.1470 + eCSSKeyword_crop, NS_STYLE_PAGE_MARKS_CROP, 1.1471 + eCSSKeyword_cross, NS_STYLE_PAGE_MARKS_REGISTER, 1.1472 + eCSSKeyword_UNKNOWN,-1 1.1473 +}; 1.1474 + 1.1475 +const KTableValue nsCSSProps::kPageSizeKTable[] = { 1.1476 + eCSSKeyword_landscape, NS_STYLE_PAGE_SIZE_LANDSCAPE, 1.1477 + eCSSKeyword_portrait, NS_STYLE_PAGE_SIZE_PORTRAIT, 1.1478 + eCSSKeyword_UNKNOWN,-1 1.1479 +}; 1.1480 + 1.1481 +const KTableValue nsCSSProps::kPointerEventsKTable[] = { 1.1482 + eCSSKeyword_none, NS_STYLE_POINTER_EVENTS_NONE, 1.1483 + eCSSKeyword_visiblepainted, NS_STYLE_POINTER_EVENTS_VISIBLEPAINTED, 1.1484 + eCSSKeyword_visiblefill, NS_STYLE_POINTER_EVENTS_VISIBLEFILL, 1.1485 + eCSSKeyword_visiblestroke, NS_STYLE_POINTER_EVENTS_VISIBLESTROKE, 1.1486 + eCSSKeyword_visible, NS_STYLE_POINTER_EVENTS_VISIBLE, 1.1487 + eCSSKeyword_painted, NS_STYLE_POINTER_EVENTS_PAINTED, 1.1488 + eCSSKeyword_fill, NS_STYLE_POINTER_EVENTS_FILL, 1.1489 + eCSSKeyword_stroke, NS_STYLE_POINTER_EVENTS_STROKE, 1.1490 + eCSSKeyword_all, NS_STYLE_POINTER_EVENTS_ALL, 1.1491 + eCSSKeyword_auto, NS_STYLE_POINTER_EVENTS_AUTO, 1.1492 + eCSSKeyword_UNKNOWN, -1 1.1493 +}; 1.1494 + 1.1495 +KTableValue nsCSSProps::kPositionKTable[] = { 1.1496 + eCSSKeyword_static, NS_STYLE_POSITION_STATIC, 1.1497 + eCSSKeyword_relative, NS_STYLE_POSITION_RELATIVE, 1.1498 + eCSSKeyword_absolute, NS_STYLE_POSITION_ABSOLUTE, 1.1499 + eCSSKeyword_fixed, NS_STYLE_POSITION_FIXED, 1.1500 + // The next entry is controlled by the layout.css.sticky.enabled pref. 1.1501 + eCSSKeyword_sticky, NS_STYLE_POSITION_STICKY, 1.1502 + eCSSKeyword_UNKNOWN,-1 1.1503 +}; 1.1504 + 1.1505 +const KTableValue nsCSSProps::kRadialGradientShapeKTable[] = { 1.1506 + eCSSKeyword_circle, NS_STYLE_GRADIENT_SHAPE_CIRCULAR, 1.1507 + eCSSKeyword_ellipse, NS_STYLE_GRADIENT_SHAPE_ELLIPTICAL, 1.1508 + eCSSKeyword_UNKNOWN,-1 1.1509 +}; 1.1510 + 1.1511 +const KTableValue nsCSSProps::kRadialGradientSizeKTable[] = { 1.1512 + eCSSKeyword_closest_side, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, 1.1513 + eCSSKeyword_closest_corner, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER, 1.1514 + eCSSKeyword_farthest_side, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE, 1.1515 + eCSSKeyword_farthest_corner, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, 1.1516 + eCSSKeyword_UNKNOWN,-1 1.1517 +}; 1.1518 + 1.1519 +const KTableValue nsCSSProps::kRadialGradientLegacySizeKTable[] = { 1.1520 + eCSSKeyword_closest_side, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, 1.1521 + eCSSKeyword_closest_corner, NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER, 1.1522 + eCSSKeyword_farthest_side, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE, 1.1523 + eCSSKeyword_farthest_corner, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, 1.1524 + // synonyms 1.1525 + eCSSKeyword_contain, NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, 1.1526 + eCSSKeyword_cover, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, 1.1527 + eCSSKeyword_UNKNOWN,-1 1.1528 +}; 1.1529 + 1.1530 +const KTableValue nsCSSProps::kResizeKTable[] = { 1.1531 + eCSSKeyword_none, NS_STYLE_RESIZE_NONE, 1.1532 + eCSSKeyword_both, NS_STYLE_RESIZE_BOTH, 1.1533 + eCSSKeyword_horizontal, NS_STYLE_RESIZE_HORIZONTAL, 1.1534 + eCSSKeyword_vertical, NS_STYLE_RESIZE_VERTICAL, 1.1535 + eCSSKeyword_UNKNOWN,-1 1.1536 +}; 1.1537 + 1.1538 +const KTableValue nsCSSProps::kStackSizingKTable[] = { 1.1539 + eCSSKeyword_ignore, NS_STYLE_STACK_SIZING_IGNORE, 1.1540 + eCSSKeyword_stretch_to_fit, NS_STYLE_STACK_SIZING_STRETCH_TO_FIT, 1.1541 + eCSSKeyword_UNKNOWN,-1 1.1542 +}; 1.1543 + 1.1544 +const KTableValue nsCSSProps::kTableLayoutKTable[] = { 1.1545 + eCSSKeyword_auto, NS_STYLE_TABLE_LAYOUT_AUTO, 1.1546 + eCSSKeyword_fixed, NS_STYLE_TABLE_LAYOUT_FIXED, 1.1547 + eCSSKeyword_UNKNOWN,-1 1.1548 +}; 1.1549 + 1.1550 +KTableValue nsCSSProps::kTextAlignKTable[] = { 1.1551 + eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT, 1.1552 + eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT, 1.1553 + eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER, 1.1554 + eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY, 1.1555 + eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER, 1.1556 + eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT, 1.1557 + eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT, 1.1558 + eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT, 1.1559 + eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END, 1.1560 + eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE, 1.1561 + eCSSKeyword_UNKNOWN,-1 1.1562 +}; 1.1563 + 1.1564 +KTableValue nsCSSProps::kTextAlignLastKTable[] = { 1.1565 + eCSSKeyword_auto, NS_STYLE_TEXT_ALIGN_AUTO, 1.1566 + eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT, 1.1567 + eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT, 1.1568 + eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER, 1.1569 + eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY, 1.1570 + eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT, 1.1571 + eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END, 1.1572 + eCSSKeyword_true, NS_STYLE_TEXT_ALIGN_TRUE, 1.1573 + eCSSKeyword_UNKNOWN,-1 1.1574 +}; 1.1575 + 1.1576 +const KTableValue nsCSSProps::kTextCombineUprightKTable[] = { 1.1577 + eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE, 1.1578 + eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL, 1.1579 + eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2, // w/o number ==> 2 1.1580 + eCSSKeyword_UNKNOWN,-1 1.1581 +}; 1.1582 + 1.1583 +const KTableValue nsCSSProps::kTextDecorationLineKTable[] = { 1.1584 + eCSSKeyword_none, NS_STYLE_TEXT_DECORATION_LINE_NONE, 1.1585 + eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE, 1.1586 + eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_LINE_OVERLINE, 1.1587 + eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH, 1.1588 + eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_LINE_BLINK, 1.1589 + eCSSKeyword__moz_anchor_decoration, NS_STYLE_TEXT_DECORATION_LINE_PREF_ANCHORS, 1.1590 + eCSSKeyword_UNKNOWN,-1 1.1591 +}; 1.1592 + 1.1593 +const KTableValue nsCSSProps::kTextDecorationStyleKTable[] = { 1.1594 + eCSSKeyword__moz_none, NS_STYLE_TEXT_DECORATION_STYLE_NONE, 1.1595 + eCSSKeyword_solid, NS_STYLE_TEXT_DECORATION_STYLE_SOLID, 1.1596 + eCSSKeyword_double, NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE, 1.1597 + eCSSKeyword_dotted, NS_STYLE_TEXT_DECORATION_STYLE_DOTTED, 1.1598 + eCSSKeyword_dashed, NS_STYLE_TEXT_DECORATION_STYLE_DASHED, 1.1599 + eCSSKeyword_wavy, NS_STYLE_TEXT_DECORATION_STYLE_WAVY, 1.1600 + eCSSKeyword_UNKNOWN,-1 1.1601 +}; 1.1602 + 1.1603 +const KTableValue nsCSSProps::kTextOrientationKTable[] = { 1.1604 + eCSSKeyword_auto, NS_STYLE_TEXT_ORIENTATION_AUTO, 1.1605 + eCSSKeyword_upright, NS_STYLE_TEXT_ORIENTATION_UPRIGHT, 1.1606 + eCSSKeyword_sideways, NS_STYLE_TEXT_ORIENTATION_SIDEWAYS, 1.1607 + eCSSKeyword_UNKNOWN, -1 1.1608 +}; 1.1609 + 1.1610 +const KTableValue nsCSSProps::kTextOverflowKTable[] = { 1.1611 + eCSSKeyword_clip, NS_STYLE_TEXT_OVERFLOW_CLIP, 1.1612 + eCSSKeyword_ellipsis, NS_STYLE_TEXT_OVERFLOW_ELLIPSIS, 1.1613 + eCSSKeyword_UNKNOWN, -1 1.1614 +}; 1.1615 + 1.1616 +const KTableValue nsCSSProps::kTextTransformKTable[] = { 1.1617 + eCSSKeyword_none, NS_STYLE_TEXT_TRANSFORM_NONE, 1.1618 + eCSSKeyword_capitalize, NS_STYLE_TEXT_TRANSFORM_CAPITALIZE, 1.1619 + eCSSKeyword_lowercase, NS_STYLE_TEXT_TRANSFORM_LOWERCASE, 1.1620 + eCSSKeyword_uppercase, NS_STYLE_TEXT_TRANSFORM_UPPERCASE, 1.1621 + eCSSKeyword_full_width, NS_STYLE_TEXT_TRANSFORM_FULLWIDTH, 1.1622 + eCSSKeyword_UNKNOWN,-1 1.1623 +}; 1.1624 + 1.1625 +const KTableValue nsCSSProps::kTouchActionKTable[] = { 1.1626 + eCSSKeyword_none, NS_STYLE_TOUCH_ACTION_NONE, 1.1627 + eCSSKeyword_auto, NS_STYLE_TOUCH_ACTION_AUTO, 1.1628 + eCSSKeyword_pan_x, NS_STYLE_TOUCH_ACTION_PAN_X, 1.1629 + eCSSKeyword_pan_y, NS_STYLE_TOUCH_ACTION_PAN_Y, 1.1630 + eCSSKeyword_manipulation, NS_STYLE_TOUCH_ACTION_MANIPULATION, 1.1631 + eCSSKeyword_UNKNOWN, -1 1.1632 +}; 1.1633 + 1.1634 +const KTableValue nsCSSProps::kTransitionTimingFunctionKTable[] = { 1.1635 + eCSSKeyword_ease, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE, 1.1636 + eCSSKeyword_linear, NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR, 1.1637 + eCSSKeyword_ease_in, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN, 1.1638 + eCSSKeyword_ease_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_OUT, 1.1639 + eCSSKeyword_ease_in_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT, 1.1640 + eCSSKeyword_step_start, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_START, 1.1641 + eCSSKeyword_step_end, NS_STYLE_TRANSITION_TIMING_FUNCTION_STEP_END, 1.1642 + eCSSKeyword_UNKNOWN,-1 1.1643 +}; 1.1644 + 1.1645 +const KTableValue nsCSSProps::kUnicodeBidiKTable[] = { 1.1646 + eCSSKeyword_normal, NS_STYLE_UNICODE_BIDI_NORMAL, 1.1647 + eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED, 1.1648 + eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE, 1.1649 + eCSSKeyword__moz_isolate, NS_STYLE_UNICODE_BIDI_ISOLATE, 1.1650 + eCSSKeyword__moz_isolate_override, NS_STYLE_UNICODE_BIDI_ISOLATE_OVERRIDE, 1.1651 + eCSSKeyword__moz_plaintext, NS_STYLE_UNICODE_BIDI_PLAINTEXT, 1.1652 + eCSSKeyword_UNKNOWN,-1 1.1653 +}; 1.1654 + 1.1655 +const KTableValue nsCSSProps::kUserFocusKTable[] = { 1.1656 + eCSSKeyword_none, NS_STYLE_USER_FOCUS_NONE, 1.1657 + eCSSKeyword_normal, NS_STYLE_USER_FOCUS_NORMAL, 1.1658 + eCSSKeyword_ignore, NS_STYLE_USER_FOCUS_IGNORE, 1.1659 + eCSSKeyword_select_all, NS_STYLE_USER_FOCUS_SELECT_ALL, 1.1660 + eCSSKeyword_select_before, NS_STYLE_USER_FOCUS_SELECT_BEFORE, 1.1661 + eCSSKeyword_select_after, NS_STYLE_USER_FOCUS_SELECT_AFTER, 1.1662 + eCSSKeyword_select_same, NS_STYLE_USER_FOCUS_SELECT_SAME, 1.1663 + eCSSKeyword_select_menu, NS_STYLE_USER_FOCUS_SELECT_MENU, 1.1664 + eCSSKeyword_UNKNOWN,-1 1.1665 +}; 1.1666 + 1.1667 +const KTableValue nsCSSProps::kUserInputKTable[] = { 1.1668 + eCSSKeyword_none, NS_STYLE_USER_INPUT_NONE, 1.1669 + eCSSKeyword_auto, NS_STYLE_USER_INPUT_AUTO, 1.1670 + eCSSKeyword_enabled, NS_STYLE_USER_INPUT_ENABLED, 1.1671 + eCSSKeyword_disabled, NS_STYLE_USER_INPUT_DISABLED, 1.1672 + eCSSKeyword_UNKNOWN,-1 1.1673 +}; 1.1674 + 1.1675 +const KTableValue nsCSSProps::kUserModifyKTable[] = { 1.1676 + eCSSKeyword_read_only, NS_STYLE_USER_MODIFY_READ_ONLY, 1.1677 + eCSSKeyword_read_write, NS_STYLE_USER_MODIFY_READ_WRITE, 1.1678 + eCSSKeyword_write_only, NS_STYLE_USER_MODIFY_WRITE_ONLY, 1.1679 + eCSSKeyword_UNKNOWN,-1 1.1680 +}; 1.1681 + 1.1682 +const KTableValue nsCSSProps::kUserSelectKTable[] = { 1.1683 + eCSSKeyword_none, NS_STYLE_USER_SELECT_NONE, 1.1684 + eCSSKeyword_auto, NS_STYLE_USER_SELECT_AUTO, 1.1685 + eCSSKeyword_text, NS_STYLE_USER_SELECT_TEXT, 1.1686 + eCSSKeyword_element, NS_STYLE_USER_SELECT_ELEMENT, 1.1687 + eCSSKeyword_elements, NS_STYLE_USER_SELECT_ELEMENTS, 1.1688 + eCSSKeyword_all, NS_STYLE_USER_SELECT_ALL, 1.1689 + eCSSKeyword_toggle, NS_STYLE_USER_SELECT_TOGGLE, 1.1690 + eCSSKeyword_tri_state, NS_STYLE_USER_SELECT_TRI_STATE, 1.1691 + eCSSKeyword__moz_all, NS_STYLE_USER_SELECT_MOZ_ALL, 1.1692 + eCSSKeyword__moz_none, NS_STYLE_USER_SELECT_NONE, 1.1693 + eCSSKeyword_UNKNOWN,-1 1.1694 +}; 1.1695 + 1.1696 +const KTableValue nsCSSProps::kVerticalAlignKTable[] = { 1.1697 + eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE, 1.1698 + eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB, 1.1699 + eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER, 1.1700 + eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP, 1.1701 + eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP, 1.1702 + eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE, 1.1703 + eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE, 1.1704 + eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM, 1.1705 + eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM, 1.1706 + eCSSKeyword_UNKNOWN,-1 1.1707 +}; 1.1708 + 1.1709 +const KTableValue nsCSSProps::kVisibilityKTable[] = { 1.1710 + eCSSKeyword_visible, NS_STYLE_VISIBILITY_VISIBLE, 1.1711 + eCSSKeyword_hidden, NS_STYLE_VISIBILITY_HIDDEN, 1.1712 + eCSSKeyword_collapse, NS_STYLE_VISIBILITY_COLLAPSE, 1.1713 + eCSSKeyword_UNKNOWN,-1 1.1714 +}; 1.1715 + 1.1716 +const KTableValue nsCSSProps::kWhitespaceKTable[] = { 1.1717 + eCSSKeyword_normal, NS_STYLE_WHITESPACE_NORMAL, 1.1718 + eCSSKeyword_pre, NS_STYLE_WHITESPACE_PRE, 1.1719 + eCSSKeyword_nowrap, NS_STYLE_WHITESPACE_NOWRAP, 1.1720 + eCSSKeyword_pre_wrap, NS_STYLE_WHITESPACE_PRE_WRAP, 1.1721 + eCSSKeyword_pre_line, NS_STYLE_WHITESPACE_PRE_LINE, 1.1722 + eCSSKeyword__moz_pre_discard_newlines, NS_STYLE_WHITESPACE_PRE_DISCARD_NEWLINES, 1.1723 + eCSSKeyword_UNKNOWN,-1 1.1724 +}; 1.1725 + 1.1726 +const KTableValue nsCSSProps::kWidthKTable[] = { 1.1727 + eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT, 1.1728 + eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT, 1.1729 + eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT, 1.1730 + eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE, 1.1731 + eCSSKeyword_UNKNOWN,-1 1.1732 +}; 1.1733 + 1.1734 +const KTableValue nsCSSProps::kWindowShadowKTable[] = { 1.1735 + eCSSKeyword_none, NS_STYLE_WINDOW_SHADOW_NONE, 1.1736 + eCSSKeyword_default, NS_STYLE_WINDOW_SHADOW_DEFAULT, 1.1737 + eCSSKeyword_menu, NS_STYLE_WINDOW_SHADOW_MENU, 1.1738 + eCSSKeyword_tooltip, NS_STYLE_WINDOW_SHADOW_TOOLTIP, 1.1739 + eCSSKeyword_sheet, NS_STYLE_WINDOW_SHADOW_SHEET, 1.1740 + eCSSKeyword_UNKNOWN,-1 1.1741 +}; 1.1742 + 1.1743 +const KTableValue nsCSSProps::kWordBreakKTable[] = { 1.1744 + eCSSKeyword_normal, NS_STYLE_WORDBREAK_NORMAL, 1.1745 + eCSSKeyword_break_all, NS_STYLE_WORDBREAK_BREAK_ALL, 1.1746 + eCSSKeyword_keep_all, NS_STYLE_WORDBREAK_KEEP_ALL, 1.1747 + eCSSKeyword_UNKNOWN,-1 1.1748 +}; 1.1749 + 1.1750 +const KTableValue nsCSSProps::kWordWrapKTable[] = { 1.1751 + eCSSKeyword_normal, NS_STYLE_WORDWRAP_NORMAL, 1.1752 + eCSSKeyword_break_word, NS_STYLE_WORDWRAP_BREAK_WORD, 1.1753 + eCSSKeyword_UNKNOWN,-1 1.1754 +}; 1.1755 + 1.1756 +const KTableValue nsCSSProps::kWritingModeKTable[] = { 1.1757 + eCSSKeyword_horizontal_tb, NS_STYLE_WRITING_MODE_HORIZONTAL_TB, 1.1758 + eCSSKeyword_vertical_lr, NS_STYLE_WRITING_MODE_VERTICAL_LR, 1.1759 + eCSSKeyword_vertical_rl, NS_STYLE_WRITING_MODE_VERTICAL_RL, 1.1760 + eCSSKeyword_UNKNOWN, -1 1.1761 +}; 1.1762 + 1.1763 +const KTableValue nsCSSProps::kHyphensKTable[] = { 1.1764 + eCSSKeyword_none, NS_STYLE_HYPHENS_NONE, 1.1765 + eCSSKeyword_manual, NS_STYLE_HYPHENS_MANUAL, 1.1766 + eCSSKeyword_auto, NS_STYLE_HYPHENS_AUTO, 1.1767 + eCSSKeyword_UNKNOWN,-1 1.1768 +}; 1.1769 + 1.1770 +// Specific keyword tables for XUL.properties 1.1771 +const KTableValue nsCSSProps::kBoxAlignKTable[] = { 1.1772 + eCSSKeyword_stretch, NS_STYLE_BOX_ALIGN_STRETCH, 1.1773 + eCSSKeyword_start, NS_STYLE_BOX_ALIGN_START, 1.1774 + eCSSKeyword_center, NS_STYLE_BOX_ALIGN_CENTER, 1.1775 + eCSSKeyword_baseline, NS_STYLE_BOX_ALIGN_BASELINE, 1.1776 + eCSSKeyword_end, NS_STYLE_BOX_ALIGN_END, 1.1777 + eCSSKeyword_UNKNOWN,-1 1.1778 +}; 1.1779 + 1.1780 +const KTableValue nsCSSProps::kBoxDirectionKTable[] = { 1.1781 + eCSSKeyword_normal, NS_STYLE_BOX_DIRECTION_NORMAL, 1.1782 + eCSSKeyword_reverse, NS_STYLE_BOX_DIRECTION_REVERSE, 1.1783 + eCSSKeyword_UNKNOWN,-1 1.1784 +}; 1.1785 + 1.1786 +const KTableValue nsCSSProps::kBoxOrientKTable[] = { 1.1787 + eCSSKeyword_horizontal, NS_STYLE_BOX_ORIENT_HORIZONTAL, 1.1788 + eCSSKeyword_vertical, NS_STYLE_BOX_ORIENT_VERTICAL, 1.1789 + eCSSKeyword_inline_axis, NS_STYLE_BOX_ORIENT_HORIZONTAL, 1.1790 + eCSSKeyword_block_axis, NS_STYLE_BOX_ORIENT_VERTICAL, 1.1791 + eCSSKeyword_UNKNOWN,-1 1.1792 +}; 1.1793 + 1.1794 +const KTableValue nsCSSProps::kBoxPackKTable[] = { 1.1795 + eCSSKeyword_start, NS_STYLE_BOX_PACK_START, 1.1796 + eCSSKeyword_center, NS_STYLE_BOX_PACK_CENTER, 1.1797 + eCSSKeyword_end, NS_STYLE_BOX_PACK_END, 1.1798 + eCSSKeyword_justify, NS_STYLE_BOX_PACK_JUSTIFY, 1.1799 + eCSSKeyword_UNKNOWN,-1 1.1800 +}; 1.1801 + 1.1802 +// keyword tables for SVG properties 1.1803 + 1.1804 +const KTableValue nsCSSProps::kDominantBaselineKTable[] = { 1.1805 + eCSSKeyword_auto, NS_STYLE_DOMINANT_BASELINE_AUTO, 1.1806 + eCSSKeyword_use_script, NS_STYLE_DOMINANT_BASELINE_USE_SCRIPT, 1.1807 + eCSSKeyword_no_change, NS_STYLE_DOMINANT_BASELINE_NO_CHANGE, 1.1808 + eCSSKeyword_reset_size, NS_STYLE_DOMINANT_BASELINE_RESET_SIZE, 1.1809 + eCSSKeyword_alphabetic, NS_STYLE_DOMINANT_BASELINE_ALPHABETIC, 1.1810 + eCSSKeyword_hanging, NS_STYLE_DOMINANT_BASELINE_HANGING, 1.1811 + eCSSKeyword_ideographic, NS_STYLE_DOMINANT_BASELINE_IDEOGRAPHIC, 1.1812 + eCSSKeyword_mathematical, NS_STYLE_DOMINANT_BASELINE_MATHEMATICAL, 1.1813 + eCSSKeyword_central, NS_STYLE_DOMINANT_BASELINE_CENTRAL, 1.1814 + eCSSKeyword_middle, NS_STYLE_DOMINANT_BASELINE_MIDDLE, 1.1815 + eCSSKeyword_text_after_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_AFTER_EDGE, 1.1816 + eCSSKeyword_text_before_edge, NS_STYLE_DOMINANT_BASELINE_TEXT_BEFORE_EDGE, 1.1817 + eCSSKeyword_UNKNOWN, -1 1.1818 +}; 1.1819 + 1.1820 +const KTableValue nsCSSProps::kFillRuleKTable[] = { 1.1821 + eCSSKeyword_nonzero, NS_STYLE_FILL_RULE_NONZERO, 1.1822 + eCSSKeyword_evenodd, NS_STYLE_FILL_RULE_EVENODD, 1.1823 + eCSSKeyword_UNKNOWN, -1 1.1824 +}; 1.1825 + 1.1826 +const KTableValue nsCSSProps::kFilterFunctionKTable[] = { 1.1827 + eCSSKeyword_blur, NS_STYLE_FILTER_BLUR, 1.1828 + eCSSKeyword_brightness, NS_STYLE_FILTER_BRIGHTNESS, 1.1829 + eCSSKeyword_contrast, NS_STYLE_FILTER_CONTRAST, 1.1830 + eCSSKeyword_grayscale, NS_STYLE_FILTER_GRAYSCALE, 1.1831 + eCSSKeyword_invert, NS_STYLE_FILTER_INVERT, 1.1832 + eCSSKeyword_opacity, NS_STYLE_FILTER_OPACITY, 1.1833 + eCSSKeyword_saturate, NS_STYLE_FILTER_SATURATE, 1.1834 + eCSSKeyword_sepia, NS_STYLE_FILTER_SEPIA, 1.1835 + eCSSKeyword_hue_rotate, NS_STYLE_FILTER_HUE_ROTATE, 1.1836 + eCSSKeyword_drop_shadow, NS_STYLE_FILTER_DROP_SHADOW, 1.1837 + eCSSKeyword_UNKNOWN, -1 1.1838 +}; 1.1839 + 1.1840 +const KTableValue nsCSSProps::kImageRenderingKTable[] = { 1.1841 + eCSSKeyword_auto, NS_STYLE_IMAGE_RENDERING_AUTO, 1.1842 + eCSSKeyword_optimizespeed, NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED, 1.1843 + eCSSKeyword_optimizequality, NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY, 1.1844 + eCSSKeyword__moz_crisp_edges, NS_STYLE_IMAGE_RENDERING_CRISPEDGES, 1.1845 + eCSSKeyword_UNKNOWN, -1 1.1846 +}; 1.1847 + 1.1848 +const KTableValue nsCSSProps::kMaskTypeKTable[] = { 1.1849 + eCSSKeyword_luminance, NS_STYLE_MASK_TYPE_LUMINANCE, 1.1850 + eCSSKeyword_alpha, NS_STYLE_MASK_TYPE_ALPHA, 1.1851 + eCSSKeyword_UNKNOWN, -1 1.1852 +}; 1.1853 + 1.1854 +const KTableValue nsCSSProps::kShapeRenderingKTable[] = { 1.1855 + eCSSKeyword_auto, NS_STYLE_SHAPE_RENDERING_AUTO, 1.1856 + eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED, 1.1857 + eCSSKeyword_crispedges, NS_STYLE_SHAPE_RENDERING_CRISPEDGES, 1.1858 + eCSSKeyword_geometricprecision, NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION, 1.1859 + eCSSKeyword_UNKNOWN, -1 1.1860 +}; 1.1861 + 1.1862 +const KTableValue nsCSSProps::kStrokeLinecapKTable[] = { 1.1863 + eCSSKeyword_butt, NS_STYLE_STROKE_LINECAP_BUTT, 1.1864 + eCSSKeyword_round, NS_STYLE_STROKE_LINECAP_ROUND, 1.1865 + eCSSKeyword_square, NS_STYLE_STROKE_LINECAP_SQUARE, 1.1866 + eCSSKeyword_UNKNOWN, -1 1.1867 +}; 1.1868 + 1.1869 +const KTableValue nsCSSProps::kStrokeLinejoinKTable[] = { 1.1870 + eCSSKeyword_miter, NS_STYLE_STROKE_LINEJOIN_MITER, 1.1871 + eCSSKeyword_round, NS_STYLE_STROKE_LINEJOIN_ROUND, 1.1872 + eCSSKeyword_bevel, NS_STYLE_STROKE_LINEJOIN_BEVEL, 1.1873 + eCSSKeyword_UNKNOWN, -1 1.1874 +}; 1.1875 + 1.1876 +// Lookup table to store the sole objectValue keyword to let SVG glyphs inherit 1.1877 +// certain stroke-* properties from the outer text object 1.1878 +const KTableValue nsCSSProps::kStrokeContextValueKTable[] = { 1.1879 + eCSSKeyword_context_value, NS_STYLE_STROKE_PROP_CONTEXT_VALUE, 1.1880 + eCSSKeyword_UNKNOWN, -1 1.1881 +}; 1.1882 + 1.1883 +const KTableValue nsCSSProps::kTextAnchorKTable[] = { 1.1884 + eCSSKeyword_start, NS_STYLE_TEXT_ANCHOR_START, 1.1885 + eCSSKeyword_middle, NS_STYLE_TEXT_ANCHOR_MIDDLE, 1.1886 + eCSSKeyword_end, NS_STYLE_TEXT_ANCHOR_END, 1.1887 + eCSSKeyword_UNKNOWN, -1 1.1888 +}; 1.1889 + 1.1890 +const KTableValue nsCSSProps::kTextRenderingKTable[] = { 1.1891 + eCSSKeyword_auto, NS_STYLE_TEXT_RENDERING_AUTO, 1.1892 + eCSSKeyword_optimizespeed, NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED, 1.1893 + eCSSKeyword_optimizelegibility, NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY, 1.1894 + eCSSKeyword_geometricprecision, NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION, 1.1895 + eCSSKeyword_UNKNOWN, -1 1.1896 +}; 1.1897 + 1.1898 +const KTableValue nsCSSProps::kVectorEffectKTable[] = { 1.1899 + eCSSKeyword_none, NS_STYLE_VECTOR_EFFECT_NONE, 1.1900 + eCSSKeyword_non_scaling_stroke, NS_STYLE_VECTOR_EFFECT_NON_SCALING_STROKE, 1.1901 + eCSSKeyword_UNKNOWN, -1 1.1902 +}; 1.1903 + 1.1904 +const KTableValue nsCSSProps::kColorInterpolationKTable[] = { 1.1905 + eCSSKeyword_auto, NS_STYLE_COLOR_INTERPOLATION_AUTO, 1.1906 + eCSSKeyword_srgb, NS_STYLE_COLOR_INTERPOLATION_SRGB, 1.1907 + eCSSKeyword_linearrgb, NS_STYLE_COLOR_INTERPOLATION_LINEARRGB, 1.1908 + eCSSKeyword_UNKNOWN, -1 1.1909 +}; 1.1910 + 1.1911 +const KTableValue nsCSSProps::kColumnFillKTable[] = { 1.1912 + eCSSKeyword_auto, NS_STYLE_COLUMN_FILL_AUTO, 1.1913 + eCSSKeyword_balance, NS_STYLE_COLUMN_FILL_BALANCE, 1.1914 + eCSSKeyword_UNKNOWN, -1 1.1915 +}; 1.1916 + 1.1917 +static bool IsKeyValSentinel(nsCSSKeyword aKey, KTableValue aValue) 1.1918 +{ 1.1919 + return aKey == eCSSKeyword_UNKNOWN && aValue == -1; 1.1920 +} 1.1921 + 1.1922 +int32_t 1.1923 +nsCSSProps::FindIndexOfKeyword(nsCSSKeyword aKeyword, 1.1924 + const KTableValue aTable[]) 1.1925 +{ 1.1926 + if (eCSSKeyword_UNKNOWN == aKeyword) { 1.1927 + // NOTE: we can have keyword tables where eCSSKeyword_UNKNOWN is used 1.1928 + // not only for the sentinel, but also in the middle of the table to 1.1929 + // knock out values that have been disabled by prefs, e.g. kDisplayKTable. 1.1930 + // So we deal with eCSSKeyword_UNKNOWN up front to avoid returning a valid 1.1931 + // index in the loop below. 1.1932 + return -1; 1.1933 + } 1.1934 + int32_t i = 0; 1.1935 + for (;;) { 1.1936 + nsCSSKeyword key = nsCSSKeyword(aTable[i]); 1.1937 + int32_t val = aTable[i + 1]; 1.1938 + if (::IsKeyValSentinel(key, val)) { 1.1939 + break; 1.1940 + } 1.1941 + if (aKeyword == key) { 1.1942 + return i; 1.1943 + } 1.1944 + i += 2; 1.1945 + } 1.1946 + return -1; 1.1947 +} 1.1948 + 1.1949 +bool 1.1950 +nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const KTableValue aTable[], 1.1951 + int32_t& aResult) 1.1952 +{ 1.1953 + int32_t index = FindIndexOfKeyword(aKeyword, aTable); 1.1954 + if (index >= 0) { 1.1955 + aResult = aTable[index + 1]; 1.1956 + return true; 1.1957 + } 1.1958 + return false; 1.1959 +} 1.1960 + 1.1961 +nsCSSKeyword 1.1962 +nsCSSProps::ValueToKeywordEnum(int32_t aValue, const KTableValue aTable[]) 1.1963 +{ 1.1964 + NS_ASSERTION(KTableValue(aValue) == aValue, "Value out of range"); 1.1965 + int32_t i = 1; 1.1966 + for (;;) { 1.1967 + int32_t val = aTable[i]; 1.1968 + nsCSSKeyword key = nsCSSKeyword(aTable[i - 1]); 1.1969 + if (::IsKeyValSentinel(key, val)) { 1.1970 + break; 1.1971 + } 1.1972 + if (aValue == val) { 1.1973 + return key; 1.1974 + } 1.1975 + i += 2; 1.1976 + } 1.1977 + return eCSSKeyword_UNKNOWN; 1.1978 +} 1.1979 + 1.1980 +const nsAFlatCString& 1.1981 +nsCSSProps::ValueToKeyword(int32_t aValue, const KTableValue aTable[]) 1.1982 +{ 1.1983 + NS_ASSERTION(KTableValue(aValue) == aValue, "Value out of range"); 1.1984 + nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable); 1.1985 + if (keyword == eCSSKeyword_UNKNOWN) { 1.1986 + static nsDependentCString sNullStr(""); 1.1987 + return sNullStr; 1.1988 + } else { 1.1989 + return nsCSSKeywords::GetStringValue(keyword); 1.1990 + } 1.1991 +} 1.1992 + 1.1993 +/* static */ const KTableValue* const 1.1994 +nsCSSProps::kKeywordTableTable[eCSSProperty_COUNT_no_shorthands] = { 1.1995 + #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ 1.1996 + kwtable_, stylestruct_, stylestructoffset_, animtype_) \ 1.1997 + kwtable_, 1.1998 + #include "nsCSSPropList.h" 1.1999 + #undef CSS_PROP 1.2000 +}; 1.2001 + 1.2002 +const nsAFlatCString& 1.2003 +nsCSSProps::LookupPropertyValue(nsCSSProperty aProp, int32_t aValue) 1.2004 +{ 1.2005 + NS_ABORT_IF_FALSE(aProp >= 0 && aProp < eCSSProperty_COUNT, 1.2006 + "property out of range"); 1.2007 + NS_ASSERTION(KTableValue(aValue) == aValue, "Value out of range"); 1.2008 + 1.2009 + const KTableValue* kwtable = nullptr; 1.2010 + if (aProp < eCSSProperty_COUNT_no_shorthands) 1.2011 + kwtable = kKeywordTableTable[aProp]; 1.2012 + 1.2013 + if (kwtable) 1.2014 + return ValueToKeyword(aValue, kwtable); 1.2015 + 1.2016 + static nsDependentCString sNullStr(""); 1.2017 + return sNullStr; 1.2018 +} 1.2019 + 1.2020 +bool nsCSSProps::GetColorName(int32_t aPropValue, nsCString &aStr) 1.2021 +{ 1.2022 + bool rv = false; 1.2023 + 1.2024 + // first get the keyword corresponding to the property Value from the color table 1.2025 + nsCSSKeyword keyword = ValueToKeywordEnum(aPropValue, kColorKTable); 1.2026 + 1.2027 + // next get the name as a string from the keywords table 1.2028 + if (keyword != eCSSKeyword_UNKNOWN) { 1.2029 + nsCSSKeywords::AddRefTable(); 1.2030 + aStr = nsCSSKeywords::GetStringValue(keyword); 1.2031 + nsCSSKeywords::ReleaseTable(); 1.2032 + rv = true; 1.2033 + } 1.2034 + return rv; 1.2035 +} 1.2036 + 1.2037 +const nsStyleStructID nsCSSProps::kSIDTable[eCSSProperty_COUNT_no_shorthands] = { 1.2038 + // Note that this uses the special BackendOnly style struct ID 1.2039 + // (which does need to be valid for storing in the 1.2040 + // nsCSSCompressedDataBlock::mStyleBits bitfield). 1.2041 + #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ 1.2042 + kwtable_, stylestruct_, stylestructoffset_, animtype_) \ 1.2043 + eStyleStruct_##stylestruct_, 1.2044 + 1.2045 + #include "nsCSSPropList.h" 1.2046 + 1.2047 + #undef CSS_PROP 1.2048 +}; 1.2049 + 1.2050 +const nsStyleAnimType 1.2051 +nsCSSProps::kAnimTypeTable[eCSSProperty_COUNT_no_shorthands] = { 1.2052 +#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ 1.2053 + stylestruct_, stylestructoffset_, animtype_) \ 1.2054 + animtype_, 1.2055 +#include "nsCSSPropList.h" 1.2056 +#undef CSS_PROP 1.2057 +}; 1.2058 + 1.2059 +const ptrdiff_t 1.2060 +nsCSSProps::kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands] = { 1.2061 +#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ 1.2062 + stylestruct_, stylestructoffset_, animtype_) \ 1.2063 + stylestructoffset_, 1.2064 +#include "nsCSSPropList.h" 1.2065 +#undef CSS_PROP 1.2066 +}; 1.2067 + 1.2068 +const uint32_t nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = { 1.2069 +#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ 1.2070 + stylestruct_, stylestructoffset_, animtype_) \ 1.2071 + flags_, 1.2072 +#include "nsCSSPropList.h" 1.2073 +#undef CSS_PROP 1.2074 +#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) flags_, 1.2075 +#include "nsCSSPropList.h" 1.2076 +#undef CSS_PROP_SHORTHAND 1.2077 +}; 1.2078 + 1.2079 +static const nsCSSProperty gAllSubpropTable[] = { 1.2080 +#define CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND 1.2081 +#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ 1.2082 + stylestruct_, stylestructoffset_, animtype_) \ 1.2083 + eCSSProperty_##id_, 1.2084 +#include "nsCSSPropList.h" 1.2085 +#undef CSS_PROP 1.2086 +#undef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND 1.2087 + eCSSProperty_UNKNOWN 1.2088 +}; 1.2089 + 1.2090 +static const nsCSSProperty gAnimationSubpropTable[] = { 1.2091 + eCSSProperty_animation_duration, 1.2092 + eCSSProperty_animation_timing_function, 1.2093 + eCSSProperty_animation_delay, 1.2094 + eCSSProperty_animation_direction, 1.2095 + eCSSProperty_animation_fill_mode, 1.2096 + eCSSProperty_animation_iteration_count, 1.2097 + // List animation-name last so we serialize it last, in case it has 1.2098 + // a value that conflicts with one of the other properties. (See 1.2099 + // how Declaration::GetValue serializes 'animation'. 1.2100 + eCSSProperty_animation_name, 1.2101 + eCSSProperty_UNKNOWN 1.2102 +}; 1.2103 + 1.2104 +static const nsCSSProperty gBorderRadiusSubpropTable[] = { 1.2105 + // Code relies on these being in topleft-topright-bottomright-bottomleft 1.2106 + // order. 1.2107 + eCSSProperty_border_top_left_radius, 1.2108 + eCSSProperty_border_top_right_radius, 1.2109 + eCSSProperty_border_bottom_right_radius, 1.2110 + eCSSProperty_border_bottom_left_radius, 1.2111 + eCSSProperty_UNKNOWN 1.2112 +}; 1.2113 + 1.2114 +static const nsCSSProperty gOutlineRadiusSubpropTable[] = { 1.2115 + // Code relies on these being in topleft-topright-bottomright-bottomleft 1.2116 + // order. 1.2117 + eCSSProperty__moz_outline_radius_topLeft, 1.2118 + eCSSProperty__moz_outline_radius_topRight, 1.2119 + eCSSProperty__moz_outline_radius_bottomRight, 1.2120 + eCSSProperty__moz_outline_radius_bottomLeft, 1.2121 + eCSSProperty_UNKNOWN 1.2122 +}; 1.2123 + 1.2124 +static const nsCSSProperty gBackgroundSubpropTable[] = { 1.2125 + eCSSProperty_background_color, 1.2126 + eCSSProperty_background_image, 1.2127 + eCSSProperty_background_repeat, 1.2128 + eCSSProperty_background_attachment, 1.2129 + eCSSProperty_background_position, 1.2130 + eCSSProperty_background_clip, 1.2131 + eCSSProperty_background_origin, 1.2132 + eCSSProperty_background_size, 1.2133 + eCSSProperty_UNKNOWN 1.2134 +}; 1.2135 + 1.2136 +static const nsCSSProperty gBorderSubpropTable[] = { 1.2137 + eCSSProperty_border_top_width, 1.2138 + eCSSProperty_border_right_width_value, 1.2139 + eCSSProperty_border_right_width_ltr_source, 1.2140 + eCSSProperty_border_right_width_rtl_source, 1.2141 + eCSSProperty_border_bottom_width, 1.2142 + eCSSProperty_border_left_width_value, 1.2143 + eCSSProperty_border_left_width_ltr_source, 1.2144 + eCSSProperty_border_left_width_rtl_source, 1.2145 + eCSSProperty_border_top_style, 1.2146 + eCSSProperty_border_right_style_value, 1.2147 + eCSSProperty_border_right_style_ltr_source, 1.2148 + eCSSProperty_border_right_style_rtl_source, 1.2149 + eCSSProperty_border_bottom_style, 1.2150 + eCSSProperty_border_left_style_value, 1.2151 + eCSSProperty_border_left_style_ltr_source, 1.2152 + eCSSProperty_border_left_style_rtl_source, 1.2153 + eCSSProperty_border_top_color, 1.2154 + eCSSProperty_border_right_color_value, 1.2155 + eCSSProperty_border_right_color_ltr_source, 1.2156 + eCSSProperty_border_right_color_rtl_source, 1.2157 + eCSSProperty_border_bottom_color, 1.2158 + eCSSProperty_border_left_color_value, 1.2159 + eCSSProperty_border_left_color_ltr_source, 1.2160 + eCSSProperty_border_left_color_rtl_source, 1.2161 + eCSSProperty_border_top_colors, 1.2162 + eCSSProperty_border_right_colors, 1.2163 + eCSSProperty_border_bottom_colors, 1.2164 + eCSSProperty_border_left_colors, 1.2165 + eCSSProperty_border_image_source, 1.2166 + eCSSProperty_border_image_slice, 1.2167 + eCSSProperty_border_image_width, 1.2168 + eCSSProperty_border_image_outset, 1.2169 + eCSSProperty_border_image_repeat, 1.2170 + eCSSProperty_UNKNOWN 1.2171 +}; 1.2172 + 1.2173 +static const nsCSSProperty gBorderBottomSubpropTable[] = { 1.2174 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2175 + // It also depends on the color being third. 1.2176 + eCSSProperty_border_bottom_width, 1.2177 + eCSSProperty_border_bottom_style, 1.2178 + eCSSProperty_border_bottom_color, 1.2179 + eCSSProperty_UNKNOWN 1.2180 +}; 1.2181 + 1.2182 +static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 && 1.2183 + NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3, 1.2184 + "box side constants not top/right/bottom/left == 0/1/2/3"); 1.2185 +static const nsCSSProperty gBorderColorSubpropTable[] = { 1.2186 + // Code relies on these being in top-right-bottom-left order. 1.2187 + // Code relies on these matching the NS_SIDE_* constants. 1.2188 + eCSSProperty_border_top_color, 1.2189 + eCSSProperty_border_right_color_value, 1.2190 + eCSSProperty_border_bottom_color, 1.2191 + eCSSProperty_border_left_color_value, 1.2192 + // extras: 1.2193 + eCSSProperty_border_left_color_ltr_source, 1.2194 + eCSSProperty_border_left_color_rtl_source, 1.2195 + eCSSProperty_border_right_color_ltr_source, 1.2196 + eCSSProperty_border_right_color_rtl_source, 1.2197 + eCSSProperty_UNKNOWN 1.2198 +}; 1.2199 + 1.2200 +static const nsCSSProperty gBorderEndColorSubpropTable[] = { 1.2201 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2202 + eCSSProperty_border_end_color_value, 1.2203 + eCSSProperty_border_right_color_ltr_source, 1.2204 + eCSSProperty_border_left_color_rtl_source, 1.2205 + eCSSProperty_UNKNOWN 1.2206 +}; 1.2207 + 1.2208 +static const nsCSSProperty gBorderLeftColorSubpropTable[] = { 1.2209 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2210 + eCSSProperty_border_left_color_value, 1.2211 + eCSSProperty_border_left_color_ltr_source, 1.2212 + eCSSProperty_border_left_color_rtl_source, 1.2213 + eCSSProperty_UNKNOWN 1.2214 +}; 1.2215 + 1.2216 +static const nsCSSProperty gBorderRightColorSubpropTable[] = { 1.2217 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2218 + eCSSProperty_border_right_color_value, 1.2219 + eCSSProperty_border_right_color_ltr_source, 1.2220 + eCSSProperty_border_right_color_rtl_source, 1.2221 + eCSSProperty_UNKNOWN 1.2222 +}; 1.2223 + 1.2224 +static const nsCSSProperty gBorderStartColorSubpropTable[] = { 1.2225 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2226 + eCSSProperty_border_start_color_value, 1.2227 + eCSSProperty_border_left_color_ltr_source, 1.2228 + eCSSProperty_border_right_color_rtl_source, 1.2229 + eCSSProperty_UNKNOWN 1.2230 +}; 1.2231 + 1.2232 +static const nsCSSProperty gBorderEndSubpropTable[] = { 1.2233 + // nsCSSDeclaration.cpp output the subproperties in this order. 1.2234 + // It also depends on the color being third. 1.2235 + eCSSProperty_border_end_width_value, 1.2236 + eCSSProperty_border_end_style_value, 1.2237 + eCSSProperty_border_end_color_value, 1.2238 + // extras: 1.2239 + eCSSProperty_border_right_width_ltr_source, 1.2240 + eCSSProperty_border_left_width_rtl_source, 1.2241 + eCSSProperty_border_right_style_ltr_source, 1.2242 + eCSSProperty_border_left_style_rtl_source, 1.2243 + eCSSProperty_border_right_color_ltr_source, 1.2244 + eCSSProperty_border_left_color_rtl_source, 1.2245 + eCSSProperty_UNKNOWN 1.2246 +}; 1.2247 + 1.2248 +static const nsCSSProperty gBorderLeftSubpropTable[] = { 1.2249 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2250 + // It also depends on the color being third. 1.2251 + eCSSProperty_border_left_width_value, 1.2252 + eCSSProperty_border_left_style_value, 1.2253 + eCSSProperty_border_left_color_value, 1.2254 + // extras: 1.2255 + eCSSProperty_border_left_width_ltr_source, 1.2256 + eCSSProperty_border_left_width_rtl_source, 1.2257 + eCSSProperty_border_left_style_ltr_source, 1.2258 + eCSSProperty_border_left_style_rtl_source, 1.2259 + eCSSProperty_border_left_color_ltr_source, 1.2260 + eCSSProperty_border_left_color_rtl_source, 1.2261 + eCSSProperty_UNKNOWN 1.2262 +}; 1.2263 + 1.2264 +static const nsCSSProperty gBorderRightSubpropTable[] = { 1.2265 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2266 + // It also depends on the color being third. 1.2267 + eCSSProperty_border_right_width_value, 1.2268 + eCSSProperty_border_right_style_value, 1.2269 + eCSSProperty_border_right_color_value, 1.2270 + // extras: 1.2271 + eCSSProperty_border_right_width_ltr_source, 1.2272 + eCSSProperty_border_right_width_rtl_source, 1.2273 + eCSSProperty_border_right_style_ltr_source, 1.2274 + eCSSProperty_border_right_style_rtl_source, 1.2275 + eCSSProperty_border_right_color_ltr_source, 1.2276 + eCSSProperty_border_right_color_rtl_source, 1.2277 + eCSSProperty_UNKNOWN 1.2278 +}; 1.2279 + 1.2280 +static const nsCSSProperty gBorderStartSubpropTable[] = { 1.2281 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2282 + // It also depends on the color being third. 1.2283 + eCSSProperty_border_start_width_value, 1.2284 + eCSSProperty_border_start_style_value, 1.2285 + eCSSProperty_border_start_color_value, 1.2286 + // extras: 1.2287 + eCSSProperty_border_left_width_ltr_source, 1.2288 + eCSSProperty_border_right_width_rtl_source, 1.2289 + eCSSProperty_border_left_style_ltr_source, 1.2290 + eCSSProperty_border_right_style_rtl_source, 1.2291 + eCSSProperty_border_left_color_ltr_source, 1.2292 + eCSSProperty_border_right_color_rtl_source, 1.2293 + eCSSProperty_UNKNOWN 1.2294 +}; 1.2295 + 1.2296 +static const nsCSSProperty gBorderStyleSubpropTable[] = { 1.2297 + // Code relies on these being in top-right-bottom-left order. 1.2298 + eCSSProperty_border_top_style, 1.2299 + eCSSProperty_border_right_style_value, 1.2300 + eCSSProperty_border_bottom_style, 1.2301 + eCSSProperty_border_left_style_value, 1.2302 + // extras: 1.2303 + eCSSProperty_border_left_style_ltr_source, 1.2304 + eCSSProperty_border_left_style_rtl_source, 1.2305 + eCSSProperty_border_right_style_ltr_source, 1.2306 + eCSSProperty_border_right_style_rtl_source, 1.2307 + eCSSProperty_UNKNOWN 1.2308 +}; 1.2309 + 1.2310 +static const nsCSSProperty gBorderLeftStyleSubpropTable[] = { 1.2311 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2312 + eCSSProperty_border_left_style_value, 1.2313 + eCSSProperty_border_left_style_ltr_source, 1.2314 + eCSSProperty_border_left_style_rtl_source, 1.2315 + eCSSProperty_UNKNOWN 1.2316 +}; 1.2317 + 1.2318 +static const nsCSSProperty gBorderRightStyleSubpropTable[] = { 1.2319 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2320 + eCSSProperty_border_right_style_value, 1.2321 + eCSSProperty_border_right_style_ltr_source, 1.2322 + eCSSProperty_border_right_style_rtl_source, 1.2323 + eCSSProperty_UNKNOWN 1.2324 +}; 1.2325 + 1.2326 +static const nsCSSProperty gBorderStartStyleSubpropTable[] = { 1.2327 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2328 + eCSSProperty_border_start_style_value, 1.2329 + eCSSProperty_border_left_style_ltr_source, 1.2330 + eCSSProperty_border_right_style_rtl_source, 1.2331 + eCSSProperty_UNKNOWN 1.2332 +}; 1.2333 + 1.2334 +static const nsCSSProperty gBorderEndStyleSubpropTable[] = { 1.2335 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2336 + eCSSProperty_border_end_style_value, 1.2337 + eCSSProperty_border_right_style_ltr_source, 1.2338 + eCSSProperty_border_left_style_rtl_source, 1.2339 + eCSSProperty_UNKNOWN 1.2340 +}; 1.2341 + 1.2342 +static const nsCSSProperty gBorderTopSubpropTable[] = { 1.2343 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2344 + // It also depends on the color being third. 1.2345 + eCSSProperty_border_top_width, 1.2346 + eCSSProperty_border_top_style, 1.2347 + eCSSProperty_border_top_color, 1.2348 + eCSSProperty_UNKNOWN 1.2349 +}; 1.2350 + 1.2351 +static const nsCSSProperty gBorderWidthSubpropTable[] = { 1.2352 + // Code relies on these being in top-right-bottom-left order. 1.2353 + eCSSProperty_border_top_width, 1.2354 + eCSSProperty_border_right_width_value, 1.2355 + eCSSProperty_border_bottom_width, 1.2356 + eCSSProperty_border_left_width_value, 1.2357 + // extras: 1.2358 + eCSSProperty_border_left_width_ltr_source, 1.2359 + eCSSProperty_border_left_width_rtl_source, 1.2360 + eCSSProperty_border_right_width_ltr_source, 1.2361 + eCSSProperty_border_right_width_rtl_source, 1.2362 + eCSSProperty_UNKNOWN 1.2363 +}; 1.2364 + 1.2365 +static const nsCSSProperty gBorderLeftWidthSubpropTable[] = { 1.2366 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2367 + eCSSProperty_border_left_width_value, 1.2368 + eCSSProperty_border_left_width_ltr_source, 1.2369 + eCSSProperty_border_left_width_rtl_source, 1.2370 + eCSSProperty_UNKNOWN 1.2371 +}; 1.2372 + 1.2373 +static const nsCSSProperty gBorderRightWidthSubpropTable[] = { 1.2374 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2375 + eCSSProperty_border_right_width_value, 1.2376 + eCSSProperty_border_right_width_ltr_source, 1.2377 + eCSSProperty_border_right_width_rtl_source, 1.2378 + eCSSProperty_UNKNOWN 1.2379 +}; 1.2380 + 1.2381 +static const nsCSSProperty gBorderStartWidthSubpropTable[] = { 1.2382 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2383 + eCSSProperty_border_start_width_value, 1.2384 + eCSSProperty_border_left_width_ltr_source, 1.2385 + eCSSProperty_border_right_width_rtl_source, 1.2386 + eCSSProperty_UNKNOWN 1.2387 +}; 1.2388 + 1.2389 +static const nsCSSProperty gBorderEndWidthSubpropTable[] = { 1.2390 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2391 + eCSSProperty_border_end_width_value, 1.2392 + eCSSProperty_border_right_width_ltr_source, 1.2393 + eCSSProperty_border_left_width_rtl_source, 1.2394 + eCSSProperty_UNKNOWN 1.2395 +}; 1.2396 + 1.2397 +static const nsCSSProperty gFontSubpropTable[] = { 1.2398 + eCSSProperty_font_family, 1.2399 + eCSSProperty_font_style, 1.2400 + eCSSProperty_font_variant, 1.2401 + eCSSProperty_font_weight, 1.2402 + eCSSProperty_font_size, 1.2403 + eCSSProperty_line_height, 1.2404 + eCSSProperty_font_size_adjust, 1.2405 + eCSSProperty_font_stretch, 1.2406 + eCSSProperty__x_system_font, 1.2407 + eCSSProperty_font_feature_settings, 1.2408 + eCSSProperty_font_language_override, 1.2409 + eCSSProperty_font_kerning, 1.2410 + eCSSProperty_font_synthesis, 1.2411 + eCSSProperty_font_variant_alternates, 1.2412 + eCSSProperty_font_variant_caps, 1.2413 + eCSSProperty_font_variant_east_asian, 1.2414 + eCSSProperty_font_variant_ligatures, 1.2415 + eCSSProperty_font_variant_numeric, 1.2416 + eCSSProperty_font_variant_position, 1.2417 + eCSSProperty_UNKNOWN 1.2418 +}; 1.2419 + 1.2420 +static const nsCSSProperty gListStyleSubpropTable[] = { 1.2421 + eCSSProperty_list_style_type, 1.2422 + eCSSProperty_list_style_image, 1.2423 + eCSSProperty_list_style_position, 1.2424 + eCSSProperty_UNKNOWN 1.2425 +}; 1.2426 + 1.2427 +static const nsCSSProperty gMarginSubpropTable[] = { 1.2428 + // Code relies on these being in top-right-bottom-left order. 1.2429 + eCSSProperty_margin_top, 1.2430 + eCSSProperty_margin_right_value, 1.2431 + eCSSProperty_margin_bottom, 1.2432 + eCSSProperty_margin_left_value, 1.2433 + // extras: 1.2434 + eCSSProperty_margin_left_ltr_source, 1.2435 + eCSSProperty_margin_left_rtl_source, 1.2436 + eCSSProperty_margin_right_ltr_source, 1.2437 + eCSSProperty_margin_right_rtl_source, 1.2438 + eCSSProperty_UNKNOWN 1.2439 +}; 1.2440 + 1.2441 +static const nsCSSProperty gMarginLeftSubpropTable[] = { 1.2442 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2443 + eCSSProperty_margin_left_value, 1.2444 + eCSSProperty_margin_left_ltr_source, 1.2445 + eCSSProperty_margin_left_rtl_source, 1.2446 + eCSSProperty_UNKNOWN 1.2447 +}; 1.2448 + 1.2449 +static const nsCSSProperty gMarginRightSubpropTable[] = { 1.2450 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2451 + eCSSProperty_margin_right_value, 1.2452 + eCSSProperty_margin_right_ltr_source, 1.2453 + eCSSProperty_margin_right_rtl_source, 1.2454 + eCSSProperty_UNKNOWN 1.2455 +}; 1.2456 + 1.2457 +static const nsCSSProperty gMarginStartSubpropTable[] = { 1.2458 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2459 + eCSSProperty_margin_start_value, 1.2460 + eCSSProperty_margin_left_ltr_source, 1.2461 + eCSSProperty_margin_right_rtl_source, 1.2462 + eCSSProperty_UNKNOWN 1.2463 +}; 1.2464 + 1.2465 +static const nsCSSProperty gMarginEndSubpropTable[] = { 1.2466 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2467 + eCSSProperty_margin_end_value, 1.2468 + eCSSProperty_margin_right_ltr_source, 1.2469 + eCSSProperty_margin_left_rtl_source, 1.2470 + eCSSProperty_UNKNOWN 1.2471 +}; 1.2472 + 1.2473 + 1.2474 +static const nsCSSProperty gOutlineSubpropTable[] = { 1.2475 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2476 + // It also depends on the color being third. 1.2477 + eCSSProperty_outline_width, 1.2478 + eCSSProperty_outline_style, 1.2479 + eCSSProperty_outline_color, 1.2480 + eCSSProperty_UNKNOWN 1.2481 +}; 1.2482 + 1.2483 +static const nsCSSProperty gColumnsSubpropTable[] = { 1.2484 + eCSSProperty__moz_column_count, 1.2485 + eCSSProperty__moz_column_width, 1.2486 + eCSSProperty_UNKNOWN 1.2487 +}; 1.2488 + 1.2489 +static const nsCSSProperty gColumnRuleSubpropTable[] = { 1.2490 + // nsCSSDeclaration.cpp outputs the subproperties in this order. 1.2491 + // It also depends on the color being third. 1.2492 + eCSSProperty__moz_column_rule_width, 1.2493 + eCSSProperty__moz_column_rule_style, 1.2494 + eCSSProperty__moz_column_rule_color, 1.2495 + eCSSProperty_UNKNOWN 1.2496 +}; 1.2497 + 1.2498 +static const nsCSSProperty gFlexSubpropTable[] = { 1.2499 + eCSSProperty_flex_grow, 1.2500 + eCSSProperty_flex_shrink, 1.2501 + eCSSProperty_flex_basis, 1.2502 + eCSSProperty_UNKNOWN 1.2503 +}; 1.2504 + 1.2505 +static const nsCSSProperty gFlexFlowSubpropTable[] = { 1.2506 + eCSSProperty_flex_direction, 1.2507 + eCSSProperty_flex_wrap, 1.2508 + eCSSProperty_UNKNOWN 1.2509 +}; 1.2510 + 1.2511 +static const nsCSSProperty gGridTemplateSubpropTable[] = { 1.2512 + eCSSProperty_grid_template_areas, 1.2513 + eCSSProperty_grid_template_columns, 1.2514 + eCSSProperty_grid_template_rows, 1.2515 + eCSSProperty_UNKNOWN 1.2516 +}; 1.2517 + 1.2518 +static const nsCSSProperty gGridSubpropTable[] = { 1.2519 + eCSSProperty_grid_template_areas, 1.2520 + eCSSProperty_grid_template_columns, 1.2521 + eCSSProperty_grid_template_rows, 1.2522 + eCSSProperty_grid_auto_flow, 1.2523 + eCSSProperty_grid_auto_columns, 1.2524 + eCSSProperty_grid_auto_rows, 1.2525 + eCSSProperty_UNKNOWN 1.2526 +}; 1.2527 + 1.2528 +static const nsCSSProperty gGridColumnSubpropTable[] = { 1.2529 + eCSSProperty_grid_column_start, 1.2530 + eCSSProperty_grid_column_end, 1.2531 + eCSSProperty_UNKNOWN 1.2532 +}; 1.2533 + 1.2534 +static const nsCSSProperty gGridRowSubpropTable[] = { 1.2535 + eCSSProperty_grid_row_start, 1.2536 + eCSSProperty_grid_row_end, 1.2537 + eCSSProperty_UNKNOWN 1.2538 +}; 1.2539 + 1.2540 +static const nsCSSProperty gGridAreaSubpropTable[] = { 1.2541 + eCSSProperty_grid_row_start, 1.2542 + eCSSProperty_grid_column_start, 1.2543 + eCSSProperty_grid_row_end, 1.2544 + eCSSProperty_grid_column_end, 1.2545 + eCSSProperty_UNKNOWN 1.2546 +}; 1.2547 + 1.2548 +static const nsCSSProperty gOverflowSubpropTable[] = { 1.2549 + eCSSProperty_overflow_x, 1.2550 + eCSSProperty_overflow_y, 1.2551 + eCSSProperty_UNKNOWN 1.2552 +}; 1.2553 + 1.2554 +static const nsCSSProperty gPaddingSubpropTable[] = { 1.2555 + // Code relies on these being in top-right-bottom-left order. 1.2556 + eCSSProperty_padding_top, 1.2557 + eCSSProperty_padding_right_value, 1.2558 + eCSSProperty_padding_bottom, 1.2559 + eCSSProperty_padding_left_value, 1.2560 + // extras: 1.2561 + eCSSProperty_padding_left_ltr_source, 1.2562 + eCSSProperty_padding_left_rtl_source, 1.2563 + eCSSProperty_padding_right_ltr_source, 1.2564 + eCSSProperty_padding_right_rtl_source, 1.2565 + eCSSProperty_UNKNOWN 1.2566 +}; 1.2567 + 1.2568 +static const nsCSSProperty gPaddingLeftSubpropTable[] = { 1.2569 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2570 + eCSSProperty_padding_left_value, 1.2571 + eCSSProperty_padding_left_ltr_source, 1.2572 + eCSSProperty_padding_left_rtl_source, 1.2573 + eCSSProperty_UNKNOWN 1.2574 +}; 1.2575 + 1.2576 +static const nsCSSProperty gPaddingRightSubpropTable[] = { 1.2577 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2578 + eCSSProperty_padding_right_value, 1.2579 + eCSSProperty_padding_right_ltr_source, 1.2580 + eCSSProperty_padding_right_rtl_source, 1.2581 + eCSSProperty_UNKNOWN 1.2582 +}; 1.2583 + 1.2584 +static const nsCSSProperty gPaddingStartSubpropTable[] = { 1.2585 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2586 + eCSSProperty_padding_start_value, 1.2587 + eCSSProperty_padding_left_ltr_source, 1.2588 + eCSSProperty_padding_right_rtl_source, 1.2589 + eCSSProperty_UNKNOWN 1.2590 +}; 1.2591 + 1.2592 +static const nsCSSProperty gPaddingEndSubpropTable[] = { 1.2593 + // nsCSSParser::ParseDirectionalBoxProperty depends on this order 1.2594 + eCSSProperty_padding_end_value, 1.2595 + eCSSProperty_padding_right_ltr_source, 1.2596 + eCSSProperty_padding_left_rtl_source, 1.2597 + eCSSProperty_UNKNOWN 1.2598 +}; 1.2599 + 1.2600 +static const nsCSSProperty gTextDecorationSubpropTable[] = { 1.2601 + eCSSProperty_text_decoration_color, 1.2602 + eCSSProperty_text_decoration_line, 1.2603 + eCSSProperty_text_decoration_style, 1.2604 + eCSSProperty_UNKNOWN 1.2605 +}; 1.2606 + 1.2607 +static const nsCSSProperty gTransitionSubpropTable[] = { 1.2608 + eCSSProperty_transition_property, 1.2609 + eCSSProperty_transition_duration, 1.2610 + eCSSProperty_transition_timing_function, 1.2611 + eCSSProperty_transition_delay, 1.2612 + eCSSProperty_UNKNOWN 1.2613 +}; 1.2614 + 1.2615 +static const nsCSSProperty gBorderImageSubpropTable[] = { 1.2616 + eCSSProperty_border_image_source, 1.2617 + eCSSProperty_border_image_slice, 1.2618 + eCSSProperty_border_image_width, 1.2619 + eCSSProperty_border_image_outset, 1.2620 + eCSSProperty_border_image_repeat, 1.2621 + eCSSProperty_UNKNOWN 1.2622 +}; 1.2623 + 1.2624 +static const nsCSSProperty gMarkerSubpropTable[] = { 1.2625 + eCSSProperty_marker_start, 1.2626 + eCSSProperty_marker_mid, 1.2627 + eCSSProperty_marker_end, 1.2628 + eCSSProperty_UNKNOWN 1.2629 +}; 1.2630 + 1.2631 +// Subproperty tables for shorthands that are just aliases with 1.2632 +// different parsing rules. 1.2633 +static const nsCSSProperty gMozTransformSubpropTable[] = { 1.2634 + eCSSProperty_transform, 1.2635 + eCSSProperty_UNKNOWN 1.2636 +}; 1.2637 + 1.2638 +const nsCSSProperty *const 1.2639 +nsCSSProps::kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands] = { 1.2640 +#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_ 1.2641 +// Need an extra level of macro nesting to force expansion of method_ 1.2642 +// params before they get pasted. 1.2643 +#define NSCSSPROPS_INNER_MACRO(method_) g##method_##SubpropTable, 1.2644 +#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ 1.2645 + NSCSSPROPS_INNER_MACRO(method_) 1.2646 +#include "nsCSSPropList.h" 1.2647 +#undef CSS_PROP_SHORTHAND 1.2648 +#undef NSCSSPROPS_INNER_MACRO 1.2649 +#undef CSS_PROP_PUBLIC_OR_PRIVATE 1.2650 +}; 1.2651 + 1.2652 + 1.2653 +#define ENUM_DATA_FOR_PROPERTY(name_, id_, method_, flags_, pref_, \ 1.2654 + parsevariant_, kwtable_, stylestructoffset_, \ 1.2655 + animtype_) \ 1.2656 + ePropertyIndex_for_##id_, 1.2657 + 1.2658 +// The order of these enums must match the g*Flags arrays in nsRuleNode.cpp. 1.2659 + 1.2660 +enum FontCheckCounter { 1.2661 + #define CSS_PROP_FONT ENUM_DATA_FOR_PROPERTY 1.2662 + #include "nsCSSPropList.h" 1.2663 + #undef CSS_PROP_FONT 1.2664 + ePropertyCount_for_Font 1.2665 +}; 1.2666 + 1.2667 +enum DisplayCheckCounter { 1.2668 + #define CSS_PROP_DISPLAY ENUM_DATA_FOR_PROPERTY 1.2669 + #include "nsCSSPropList.h" 1.2670 + #undef CSS_PROP_DISPLAY 1.2671 + ePropertyCount_for_Display 1.2672 +}; 1.2673 + 1.2674 +enum VisibilityCheckCounter { 1.2675 + #define CSS_PROP_VISIBILITY ENUM_DATA_FOR_PROPERTY 1.2676 + #include "nsCSSPropList.h" 1.2677 + #undef CSS_PROP_VISIBILITY 1.2678 + ePropertyCount_for_Visibility 1.2679 +}; 1.2680 + 1.2681 +enum MarginCheckCounter { 1.2682 + #define CSS_PROP_MARGIN ENUM_DATA_FOR_PROPERTY 1.2683 + #include "nsCSSPropList.h" 1.2684 + #undef CSS_PROP_MARGIN 1.2685 + ePropertyCount_for_Margin 1.2686 +}; 1.2687 + 1.2688 +enum BorderCheckCounter { 1.2689 + #define CSS_PROP_BORDER ENUM_DATA_FOR_PROPERTY 1.2690 + #include "nsCSSPropList.h" 1.2691 + #undef CSS_PROP_BORDER 1.2692 + ePropertyCount_for_Border 1.2693 +}; 1.2694 + 1.2695 +enum PaddingCheckCounter { 1.2696 + #define CSS_PROP_PADDING ENUM_DATA_FOR_PROPERTY 1.2697 + #include "nsCSSPropList.h" 1.2698 + #undef CSS_PROP_PADDING 1.2699 + ePropertyCount_for_Padding 1.2700 +}; 1.2701 + 1.2702 +enum OutlineCheckCounter { 1.2703 + #define CSS_PROP_OUTLINE ENUM_DATA_FOR_PROPERTY 1.2704 + #include "nsCSSPropList.h" 1.2705 + #undef CSS_PROP_OUTLINE 1.2706 + ePropertyCount_for_Outline 1.2707 +}; 1.2708 + 1.2709 +enum ListCheckCounter { 1.2710 + #define CSS_PROP_LIST ENUM_DATA_FOR_PROPERTY 1.2711 + #include "nsCSSPropList.h" 1.2712 + #undef CSS_PROP_LIST 1.2713 + ePropertyCount_for_List 1.2714 +}; 1.2715 + 1.2716 +enum ColorCheckCounter { 1.2717 + #define CSS_PROP_COLOR ENUM_DATA_FOR_PROPERTY 1.2718 + #include "nsCSSPropList.h" 1.2719 + #undef CSS_PROP_COLOR 1.2720 + ePropertyCount_for_Color 1.2721 +}; 1.2722 + 1.2723 +enum BackgroundCheckCounter { 1.2724 + #define CSS_PROP_BACKGROUND ENUM_DATA_FOR_PROPERTY 1.2725 + #include "nsCSSPropList.h" 1.2726 + #undef CSS_PROP_BACKGROUND 1.2727 + ePropertyCount_for_Background 1.2728 +}; 1.2729 + 1.2730 +enum PositionCheckCounter { 1.2731 + #define CSS_PROP_POSITION ENUM_DATA_FOR_PROPERTY 1.2732 + #include "nsCSSPropList.h" 1.2733 + #undef CSS_PROP_POSITION 1.2734 + ePropertyCount_for_Position 1.2735 +}; 1.2736 + 1.2737 +enum TableCheckCounter { 1.2738 + #define CSS_PROP_TABLE ENUM_DATA_FOR_PROPERTY 1.2739 + #include "nsCSSPropList.h" 1.2740 + #undef CSS_PROP_TABLE 1.2741 + ePropertyCount_for_Table 1.2742 +}; 1.2743 + 1.2744 +enum TableBorderCheckCounter { 1.2745 + #define CSS_PROP_TABLEBORDER ENUM_DATA_FOR_PROPERTY 1.2746 + #include "nsCSSPropList.h" 1.2747 + #undef CSS_PROP_TABLEBORDER 1.2748 + ePropertyCount_for_TableBorder 1.2749 +}; 1.2750 + 1.2751 +enum ContentCheckCounter { 1.2752 + #define CSS_PROP_CONTENT ENUM_DATA_FOR_PROPERTY 1.2753 + #include "nsCSSPropList.h" 1.2754 + #undef CSS_PROP_CONTENT 1.2755 + ePropertyCount_for_Content 1.2756 +}; 1.2757 + 1.2758 +enum QuotesCheckCounter { 1.2759 + #define CSS_PROP_QUOTES ENUM_DATA_FOR_PROPERTY 1.2760 + #include "nsCSSPropList.h" 1.2761 + #undef CSS_PROP_QUOTES 1.2762 + ePropertyCount_for_Quotes 1.2763 +}; 1.2764 + 1.2765 +enum TextCheckCounter { 1.2766 + #define CSS_PROP_TEXT ENUM_DATA_FOR_PROPERTY 1.2767 + #include "nsCSSPropList.h" 1.2768 + #undef CSS_PROP_TEXT 1.2769 + ePropertyCount_for_Text 1.2770 +}; 1.2771 + 1.2772 +enum TextResetCheckCounter { 1.2773 + #define CSS_PROP_TEXTRESET ENUM_DATA_FOR_PROPERTY 1.2774 + #include "nsCSSPropList.h" 1.2775 + #undef CSS_PROP_TEXTRESET 1.2776 + ePropertyCount_for_TextReset 1.2777 +}; 1.2778 + 1.2779 +enum UserInterfaceCheckCounter { 1.2780 + #define CSS_PROP_USERINTERFACE ENUM_DATA_FOR_PROPERTY 1.2781 + #include "nsCSSPropList.h" 1.2782 + #undef CSS_PROP_USERINTERFACE 1.2783 + ePropertyCount_for_UserInterface 1.2784 +}; 1.2785 + 1.2786 +enum UIResetCheckCounter { 1.2787 + #define CSS_PROP_UIRESET ENUM_DATA_FOR_PROPERTY 1.2788 + #include "nsCSSPropList.h" 1.2789 + #undef CSS_PROP_UIRESET 1.2790 + ePropertyCount_for_UIReset 1.2791 +}; 1.2792 + 1.2793 +enum XULCheckCounter { 1.2794 + #define CSS_PROP_XUL ENUM_DATA_FOR_PROPERTY 1.2795 + #include "nsCSSPropList.h" 1.2796 + #undef CSS_PROP_XUL 1.2797 + ePropertyCount_for_XUL 1.2798 +}; 1.2799 + 1.2800 +enum SVGCheckCounter { 1.2801 + #define CSS_PROP_SVG ENUM_DATA_FOR_PROPERTY 1.2802 + #include "nsCSSPropList.h" 1.2803 + #undef CSS_PROP_SVG 1.2804 + ePropertyCount_for_SVG 1.2805 +}; 1.2806 + 1.2807 +enum SVGResetCheckCounter { 1.2808 + #define CSS_PROP_SVGRESET ENUM_DATA_FOR_PROPERTY 1.2809 + #include "nsCSSPropList.h" 1.2810 + #undef CSS_PROP_SVGRESET 1.2811 + ePropertyCount_for_SVGReset 1.2812 +}; 1.2813 + 1.2814 +enum ColumnCheckCounter { 1.2815 + #define CSS_PROP_COLUMN ENUM_DATA_FOR_PROPERTY 1.2816 + #include "nsCSSPropList.h" 1.2817 + #undef CSS_PROP_COLUMN 1.2818 + ePropertyCount_for_Column 1.2819 +}; 1.2820 + 1.2821 +enum VariablesCheckCounter { 1.2822 + #define CSS_PROP_VARIABLES ENUM_DATA_FOR_PROPERTY 1.2823 + #include "nsCSSPropList.h" 1.2824 + #undef CSS_PROP_VARIABLES 1.2825 + ePropertyCount_for_Variables 1.2826 +}; 1.2827 + 1.2828 +#undef ENUM_DATA_FOR_PROPERTY 1.2829 + 1.2830 +/* static */ const size_t 1.2831 +nsCSSProps::gPropertyCountInStruct[nsStyleStructID_Length] = { 1.2832 + #define STYLE_STRUCT(name, checkdata_cb) \ 1.2833 + ePropertyCount_for_##name, 1.2834 + #include "nsStyleStructList.h" 1.2835 + #undef STYLE_STRUCT 1.2836 +}; 1.2837 + 1.2838 +/* static */ const size_t 1.2839 +nsCSSProps::gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands] = { 1.2840 + 1.2841 + #define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, \ 1.2842 + parsevariant_, kwtable_) \ 1.2843 + size_t(-1), 1.2844 + #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ 1.2845 + kwtable_, stylestruct_, stylestructoffset_, animtype_) \ 1.2846 + ePropertyIndex_for_##id_, 1.2847 + #include "nsCSSPropList.h" 1.2848 + #undef CSS_PROP 1.2849 + #undef CSS_PROP_BACKENDONLY 1.2850 + 1.2851 +}; 1.2852 + 1.2853 +/* static */ bool 1.2854 +nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = { 1.2855 + #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \ 1.2856 + kwtable_, stylestruct_, stylestructoffset_, animtype_) \ 1.2857 + true, 1.2858 + #include "nsCSSPropList.h" 1.2859 + #undef CSS_PROP 1.2860 + 1.2861 + #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ 1.2862 + true, 1.2863 + #include "nsCSSPropList.h" 1.2864 + #undef CSS_PROP_SHORTHAND 1.2865 + 1.2866 + #define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_) \ 1.2867 + true, 1.2868 + #include "nsCSSPropAliasList.h" 1.2869 + #undef CSS_PROP_ALIAS 1.2870 +};