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