nsCSSProps.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /*
  6. * methods for dealing with CSS properties and tables of the keyword
  7. * values they accept
  8. */
  9. #ifndef nsCSSProps_h___
  10. #define nsCSSProps_h___
  11. #include <limits>
  12. #include <type_traits>
  13. #include "nsIAtom.h"
  14. #include "nsString.h"
  15. #include "nsCSSPropertyID.h"
  16. #include "nsStyleStructFwd.h"
  17. #include "nsCSSKeywords.h"
  18. #include "mozilla/CSSEnabledState.h"
  19. #include "mozilla/UseCounter.h"
  20. #include "mozilla/EnumTypeTraits.h"
  21. // Length of the "--" prefix on custom names (such as custom property names,
  22. // and, in the future, custom media query names).
  23. #define CSS_CUSTOM_NAME_PREFIX_LENGTH 2
  24. // Flags for ParseVariant method
  25. #define VARIANT_KEYWORD 0x000001 // K
  26. #define VARIANT_LENGTH 0x000002 // L
  27. #define VARIANT_PERCENT 0x000004 // P
  28. #define VARIANT_COLOR 0x000008 // C eCSSUnit_*Color, eCSSUnit_Ident (e.g. "red")
  29. #define VARIANT_URL 0x000010 // U
  30. #define VARIANT_NUMBER 0x000020 // N
  31. #define VARIANT_INTEGER 0x000040 // I
  32. #define VARIANT_ANGLE 0x000080 // G
  33. #define VARIANT_FREQUENCY 0x000100 // F
  34. #define VARIANT_TIME 0x000200 // T
  35. #define VARIANT_STRING 0x000400 // S
  36. #define VARIANT_COUNTER 0x000800 //
  37. #define VARIANT_ATTR 0x001000 //
  38. #define VARIANT_IDENTIFIER 0x002000 // D
  39. #define VARIANT_IDENTIFIER_NO_INHERIT 0x004000 // like above, but excluding
  40. // 'inherit' and 'initial'
  41. #define VARIANT_OPACITY 0x008000 // Take floats and percents as input, output float.
  42. #define VARIANT_AUTO 0x010000 // A
  43. #define VARIANT_INHERIT 0x020000 // H eCSSUnit_Initial, eCSSUnit_Inherit, eCSSUnit_Unset
  44. #define VARIANT_NONE 0x040000 // O
  45. #define VARIANT_NORMAL 0x080000 // M
  46. #define VARIANT_SYSFONT 0x100000 // eCSSUnit_System_Font
  47. #define VARIANT_GRADIENT 0x200000 // eCSSUnit_Gradient
  48. #define VARIANT_TIMING_FUNCTION 0x400000 // cubic-bezier() and steps()
  49. #define VARIANT_ALL 0x800000 //
  50. #define VARIANT_IMAGE_RECT 0x01000000 // eCSSUnit_Function
  51. // This is an extra bit that says that a VARIANT_ANGLE allows unitless zero:
  52. #define VARIANT_ZERO_ANGLE 0x02000000 // unitless zero for angles
  53. #define VARIANT_CALC 0x04000000 // eCSSUnit_Calc
  54. #define VARIANT_ELEMENT 0x08000000 // eCSSUnit_Element
  55. #define VARIANT_NONNEGATIVE_DIMENSION 0x10000000 // Only lengths greater than or equal to 0.0
  56. // Keyword used iff gfx.font_rendering.opentype_svg.enabled is true:
  57. #define VARIANT_OPENTYPE_SVG_KEYWORD 0x20000000
  58. #define VARIANT_ABSOLUTE_DIMENSION 0x40000000 // B Only lengths with absolute length unit
  59. // Variants that can consume more than one token
  60. #define VARIANT_MULTIPLE_TOKENS \
  61. (VARIANT_COLOR | /* rgb(...), hsl(...), etc. */ \
  62. VARIANT_COUNTER | /* counter(...), counters(...) */ \
  63. VARIANT_ATTR | /* attr(...) */ \
  64. VARIANT_GRADIENT | /* linear-gradient(...), etc. */ \
  65. VARIANT_TIMING_FUNCTION | /* cubic-bezier(...), steps(...) */ \
  66. VARIANT_IMAGE_RECT | /* -moz-image-rect(...) */ \
  67. VARIANT_CALC | /* calc(...) */ \
  68. VARIANT_ELEMENT) /* -moz-element(...) */
  69. // Common combinations of variants
  70. #define VARIANT_AL (VARIANT_AUTO | VARIANT_LENGTH)
  71. #define VARIANT_LP (VARIANT_LENGTH | VARIANT_PERCENT)
  72. #define VARIANT_LN (VARIANT_LENGTH | VARIANT_NUMBER)
  73. #define VARIANT_AH (VARIANT_AUTO | VARIANT_INHERIT)
  74. #define VARIANT_AHLP (VARIANT_AH | VARIANT_LP)
  75. #define VARIANT_AHI (VARIANT_AH | VARIANT_INTEGER)
  76. #define VARIANT_AHK (VARIANT_AH | VARIANT_KEYWORD)
  77. #define VARIANT_AHKLP (VARIANT_AHLP | VARIANT_KEYWORD)
  78. #define VARIANT_AHL (VARIANT_AH | VARIANT_LENGTH)
  79. #define VARIANT_AHKL (VARIANT_AHK | VARIANT_LENGTH)
  80. #define VARIANT_HK (VARIANT_INHERIT | VARIANT_KEYWORD)
  81. #define VARIANT_HKF (VARIANT_HK | VARIANT_FREQUENCY)
  82. #define VARIANT_HKI (VARIANT_HK | VARIANT_INTEGER)
  83. #define VARIANT_HKL (VARIANT_HK | VARIANT_LENGTH)
  84. #define VARIANT_HKLP (VARIANT_HK | VARIANT_LP)
  85. #define VARIANT_HKLPO (VARIANT_HKLP | VARIANT_NONE)
  86. #define VARIANT_HL (VARIANT_INHERIT | VARIANT_LENGTH)
  87. #define VARIANT_HI (VARIANT_INHERIT | VARIANT_INTEGER)
  88. #define VARIANT_HLP (VARIANT_HL | VARIANT_PERCENT)
  89. #define VARIANT_HLPN (VARIANT_HLP | VARIANT_NUMBER)
  90. #define VARIANT_HLPO (VARIANT_HLP | VARIANT_NONE)
  91. #define VARIANT_HTP (VARIANT_INHERIT | VARIANT_TIME | VARIANT_PERCENT)
  92. #define VARIANT_HMK (VARIANT_HK | VARIANT_NORMAL)
  93. #define VARIANT_HC (VARIANT_INHERIT | VARIANT_COLOR)
  94. #define VARIANT_HCK (VARIANT_HK | VARIANT_COLOR)
  95. #define VARIANT_HUK (VARIANT_HK | VARIANT_URL)
  96. #define VARIANT_HUO (VARIANT_INHERIT | VARIANT_URL | VARIANT_NONE)
  97. #define VARIANT_AHUO (VARIANT_AUTO | VARIANT_HUO)
  98. #define VARIANT_HPN (VARIANT_INHERIT | VARIANT_PERCENT | VARIANT_NUMBER)
  99. #define VARIANT_PN (VARIANT_PERCENT | VARIANT_NUMBER)
  100. #define VARIANT_ALPN (VARIANT_AL | VARIANT_PN)
  101. #define VARIANT_HN (VARIANT_INHERIT | VARIANT_NUMBER)
  102. #define VARIANT_HON (VARIANT_HN | VARIANT_NONE)
  103. #define VARIANT_HOS (VARIANT_INHERIT | VARIANT_NONE | VARIANT_STRING)
  104. #define VARIANT_LPN (VARIANT_LP | VARIANT_NUMBER)
  105. #define VARIANT_UK (VARIANT_URL | VARIANT_KEYWORD)
  106. #define VARIANT_UO (VARIANT_URL | VARIANT_NONE)
  107. #define VARIANT_ANGLE_OR_ZERO (VARIANT_ANGLE | VARIANT_ZERO_ANGLE)
  108. #define VARIANT_LB (VARIANT_LENGTH | VARIANT_ABSOLUTE_DIMENSION)
  109. #define VARIANT_LBCALC (VARIANT_LB | VARIANT_CALC)
  110. #define VARIANT_LCALC (VARIANT_LENGTH | VARIANT_CALC)
  111. #define VARIANT_LPCALC (VARIANT_LCALC | VARIANT_PERCENT)
  112. #define VARIANT_LNCALC (VARIANT_LCALC | VARIANT_NUMBER)
  113. #define VARIANT_LPNCALC (VARIANT_LNCALC | VARIANT_PERCENT)
  114. #define VARIANT_IMAGE (VARIANT_URL | VARIANT_NONE | VARIANT_GRADIENT | \
  115. VARIANT_IMAGE_RECT | VARIANT_ELEMENT)
  116. // Flags for the kFlagsTable bitfield (flags_ in nsCSSPropList.h)
  117. // This property is a logical property (such as padding-inline-start).
  118. #define CSS_PROPERTY_LOGICAL (1<<0)
  119. #define CSS_PROPERTY_VALUE_LIST_USES_COMMAS (1<<1) /* otherwise spaces */
  120. #define CSS_PROPERTY_APPLIES_TO_FIRST_LETTER (1<<2)
  121. #define CSS_PROPERTY_APPLIES_TO_FIRST_LINE (1<<3)
  122. #define CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE \
  123. (CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_APPLIES_TO_FIRST_LINE)
  124. // Note that 'background-color' is ignored differently from the other
  125. // properties that have this set, but that's just special-cased.
  126. #define CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED (1<<4)
  127. // A property that needs to have image loads started when a URL value
  128. // for the property is used for an element. This is supported only
  129. // for a few possible value formats: image directly in the value; list
  130. // of images; and with CSS_PROPERTY_IMAGE_IS_IN_ARRAY_0, image in slot
  131. // 0 of an array, or list of such arrays.
  132. #define CSS_PROPERTY_START_IMAGE_LOADS (1<<5)
  133. // Should be set only for properties with START_IMAGE_LOADS. Indicates
  134. // that the property has an array value with a URL/image value at index
  135. // 0 in the array, rather than the URL/image being in the value or value
  136. // list.
  137. #define CSS_PROPERTY_IMAGE_IS_IN_ARRAY_0 (1<<6)
  138. // This is a logical property that represents some value associated with
  139. // a logical axis rather than a logical box side, and thus has two
  140. // corresponding physical properties it could set rather than four. For
  141. // example, the block-size logical property has this flag set, as it
  142. // represents the size in either the block or inline axis dimensions, and
  143. // has two corresponding physical properties, width and height. Must not
  144. // be used in conjunction with CSS_PROPERTY_LOGICAL_END_EDGE.
  145. #define CSS_PROPERTY_LOGICAL_AXIS (1<<7)
  146. // This property allows calc() between lengths and percentages and
  147. // stores such calc() expressions in its style structs (typically in an
  148. // nsStyleCoord, although this is not the case for 'background-position'
  149. // and 'background-size').
  150. #define CSS_PROPERTY_STORES_CALC (1<<8)
  151. // Define what mechanism the CSS parser uses for parsing the property.
  152. // See CSSParserImpl::ParseProperty(nsCSSPropertyID). Don't use 0 so that
  153. // we can verify that every property sets one of the values.
  154. //
  155. // CSS_PROPERTY_PARSE_FUNCTION must be used for shorthand properties,
  156. // since it's the only mechanism that allows appending values for
  157. // separate properties. Longhand properties that require custom parsing
  158. // functions should prefer using CSS_PROPERTY_PARSE_VALUE (or
  159. // CSS_PROPERTY_PARSE_VALUE_LIST) and
  160. // CSS_PROPERTY_VALUE_PARSER_FUNCTION, though a number of existing
  161. // longhand properties use CSS_PROPERTY_PARSE_FUNCTION instead.
  162. #define CSS_PROPERTY_PARSE_PROPERTY_MASK (7<<9)
  163. #define CSS_PROPERTY_PARSE_INACCESSIBLE (1<<9)
  164. #define CSS_PROPERTY_PARSE_FUNCTION (2<<9)
  165. #define CSS_PROPERTY_PARSE_VALUE (3<<9)
  166. #define CSS_PROPERTY_PARSE_VALUE_LIST (4<<9)
  167. // See CSSParserImpl::ParseSingleValueProperty and comment above
  168. // CSS_PROPERTY_PARSE_FUNCTION (which is different).
  169. #define CSS_PROPERTY_VALUE_PARSER_FUNCTION (1<<12)
  170. static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
  171. CSS_PROPERTY_VALUE_PARSER_FUNCTION) == 0,
  172. "didn't leave enough room for the parse property constants");
  173. #define CSS_PROPERTY_VALUE_RESTRICTION_MASK (3<<13)
  174. // The parser (in particular, CSSParserImpl::ParseSingleValueProperty)
  175. // should enforce that the value of this property must be 0 or larger.
  176. #define CSS_PROPERTY_VALUE_NONNEGATIVE (1<<13)
  177. // The parser (in particular, CSSParserImpl::ParseSingleValueProperty)
  178. // should enforce that the value of this property must be 1 or larger.
  179. #define CSS_PROPERTY_VALUE_AT_LEAST_ONE (2<<13)
  180. // Does this property support the hashless hex color quirk in quirks mode?
  181. #define CSS_PROPERTY_HASHLESS_COLOR_QUIRK (1<<15)
  182. // Does this property support the unitless length quirk in quirks mode?
  183. #define CSS_PROPERTY_UNITLESS_LENGTH_QUIRK (1<<16)
  184. // Is this property (which must be a shorthand) really an alias?
  185. #define CSS_PROPERTY_IS_ALIAS (1<<17)
  186. // Does the property apply to ::placeholder?
  187. #define CSS_PROPERTY_APPLIES_TO_PLACEHOLDER (1<<18)
  188. // This property is allowed in an @page rule.
  189. #define CSS_PROPERTY_APPLIES_TO_PAGE_RULE (1<<19)
  190. // This property's getComputedStyle implementation requires layout to be
  191. // flushed.
  192. #define CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH (1<<20)
  193. // This property requires a stacking context.
  194. #define CSS_PROPERTY_CREATES_STACKING_CONTEXT (1<<21)
  195. // The following two flags along with the pref defines where the this
  196. // property can be used:
  197. // * If none of the two flags is presented, the pref completely controls
  198. // the availability of this property. And in that case, if it has no
  199. // pref, this property is usable everywhere.
  200. // * If any of the flags is set, this property is always enabled in the
  201. // specific contexts regardless of the value of the pref. If there is
  202. // no pref for this property at all in this case, it is an internal-
  203. // only property, which cannot be used anywhere else, and should be
  204. // wrapped in "#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL".
  205. // Note that, these flags have no effect on the use of aliases of this
  206. // property.
  207. // Furthermore, for the purposes of animation (including triggering
  208. // transitions) these flags are ignored. That is, if the property is disabled
  209. // by a pref, we will *not* run animations or transitions on it even in
  210. // UA sheets or chrome.
  211. #define CSS_PROPERTY_ENABLED_MASK (3<<22)
  212. #define CSS_PROPERTY_ENABLED_IN_UA_SHEETS (1<<22)
  213. #define CSS_PROPERTY_ENABLED_IN_CHROME (1<<23)
  214. #define CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME \
  215. (CSS_PROPERTY_ENABLED_IN_UA_SHEETS | CSS_PROPERTY_ENABLED_IN_CHROME)
  216. // This property's unitless values are pixels.
  217. #define CSS_PROPERTY_NUMBERS_ARE_PIXELS (1<<24)
  218. // This property is a logical property for one of the two block axis
  219. // sides (such as margin-block-start or margin-block-end). Must only be
  220. // set if CSS_PROPERTY_LOGICAL is set. When not set, the logical
  221. // property is for one of the two inline axis sides (such as
  222. // margin-inline-start or margin-inline-end).
  223. #define CSS_PROPERTY_LOGICAL_BLOCK_AXIS (1<<25)
  224. // This property is a logical property for the "end" edge of the
  225. // axis determined by the presence or absence of
  226. // CSS_PROPERTY_LOGICAL_BLOCK_AXIS (such as margin-block-end or
  227. // margin-inline-end). Must only be set if CSS_PROPERTY_LOGICAL is set.
  228. // When not set, the logical property is for the "start" edge (such as
  229. // margin-block-start or margin-inline-start).
  230. #define CSS_PROPERTY_LOGICAL_END_EDGE (1<<26)
  231. // This property can be animated on the compositor.
  232. #define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR (1<<27)
  233. // This property is an internal property that is not represented
  234. // in the DOM. Properties with this flag must be defined in an #ifndef
  235. // CSS_PROP_LIST_EXCLUDE_INTERNAL section of nsCSSPropList.h.
  236. #define CSS_PROPERTY_INTERNAL (1<<28)
  237. // This property has values that can establish a containing block for
  238. // fixed positioned and absolutely positioned elements.
  239. // This should be set for any properties that can cause an element to be
  240. // such a containing block, as implemented in
  241. // nsStyleDisplay::IsFixedPosContainingBlock.
  242. #define CSS_PROPERTY_FIXPOS_CB (1<<29)
  243. // This property has values that can establish a containing block for
  244. // absolutely positioned elements.
  245. // This should be set for any properties that can cause an element to be
  246. // such a containing block, as implemented in
  247. // nsStyleDisplay::IsAbsPosContainingBlock.
  248. // It does not need to be set for properties that also have
  249. // CSS_PROPERTY_FIXPOS_CB set.
  250. #define CSS_PROPERTY_ABSPOS_CB (1<<30)
  251. /**
  252. * Types of animatable values.
  253. */
  254. enum nsStyleAnimType {
  255. // requires a custom implementation in
  256. // StyleAnimationValue::ExtractComputedValue
  257. eStyleAnimType_Custom,
  258. // nsStyleCoord with animatable values
  259. eStyleAnimType_Coord,
  260. // same as Coord, except for one side of an nsStyleSides
  261. // listed in the same order as the NS_STYLE_* constants
  262. eStyleAnimType_Sides_Top,
  263. eStyleAnimType_Sides_Right,
  264. eStyleAnimType_Sides_Bottom,
  265. eStyleAnimType_Sides_Left,
  266. // similar, but for the *pair* of coord members of an nsStyleCorners
  267. // for the relevant corner
  268. eStyleAnimType_Corner_TopLeft,
  269. eStyleAnimType_Corner_TopRight,
  270. eStyleAnimType_Corner_BottomRight,
  271. eStyleAnimType_Corner_BottomLeft,
  272. // nscoord values
  273. eStyleAnimType_nscoord,
  274. // float values
  275. eStyleAnimType_float,
  276. // nscolor values
  277. eStyleAnimType_Color,
  278. // StyleComplexColor values
  279. eStyleAnimType_ComplexColor,
  280. // nsStyleSVGPaint values
  281. eStyleAnimType_PaintServer,
  282. // RefPtr<nsCSSShadowArray> values
  283. eStyleAnimType_Shadow,
  284. // discrete values
  285. eStyleAnimType_Discrete,
  286. // property not animatable
  287. eStyleAnimType_None
  288. };
  289. // Empty class derived from nsIAtom so that function signatures can
  290. // require an atom from the atom list.
  291. class nsICSSProperty : public nsIAtom {};
  292. class nsCSSProps {
  293. public:
  294. typedef mozilla::CSSEnabledState EnabledState;
  295. struct KTableEntry
  296. {
  297. // KTableEntry objects can be initialized either with an int16_t value
  298. // or a value of an enumeration type that can fit within an int16_t.
  299. KTableEntry(nsCSSKeyword aKeyword, int16_t aValue)
  300. : mKeyword(aKeyword)
  301. , mValue(aValue)
  302. {
  303. }
  304. template<typename T,
  305. typename = typename std::enable_if<std::is_enum<T>::value>::type>
  306. KTableEntry(nsCSSKeyword aKeyword, T aValue)
  307. : mKeyword(aKeyword)
  308. , mValue(static_cast<int16_t>(aValue))
  309. {
  310. static_assert(mozilla::EnumTypeFitsWithin<T, int16_t>::value,
  311. "aValue must be an enum that fits within mValue");
  312. }
  313. nsCSSKeyword mKeyword;
  314. int16_t mValue;
  315. };
  316. static void AddRefTable(void);
  317. static void ReleaseTable(void);
  318. // Looks up the property with name aProperty and returns its corresponding
  319. // nsCSSPropertyID value. If aProperty is the name of a custom property,
  320. // then eCSSPropertyExtra_variable will be returned.
  321. static nsCSSPropertyID LookupProperty(const nsAString& aProperty,
  322. EnabledState aEnabled);
  323. static nsCSSPropertyID LookupProperty(const nsACString& aProperty,
  324. EnabledState aEnabled);
  325. // As above, but looked up using a property's IDL name.
  326. // eCSSPropertyExtra_variable won't be returned from these methods.
  327. static nsCSSPropertyID LookupPropertyByIDLName(
  328. const nsAString& aPropertyIDLName,
  329. EnabledState aEnabled);
  330. static nsCSSPropertyID LookupPropertyByIDLName(
  331. const nsACString& aPropertyIDLName,
  332. EnabledState aEnabled);
  333. // Returns whether aProperty is a custom property name, i.e. begins with
  334. // "--". This assumes that the CSS Variables pref has been enabled.
  335. static bool IsCustomPropertyName(const nsAString& aProperty);
  336. static bool IsCustomPropertyName(const nsACString& aProperty);
  337. static inline bool IsShorthand(nsCSSPropertyID aProperty) {
  338. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
  339. "out of range");
  340. return (aProperty >= eCSSProperty_COUNT_no_shorthands);
  341. }
  342. // Must be given a longhand property.
  343. static bool IsInherited(nsCSSPropertyID aProperty);
  344. // Same but for @font-face descriptors
  345. static nsCSSFontDesc LookupFontDesc(const nsAString& aProperty);
  346. static nsCSSFontDesc LookupFontDesc(const nsACString& aProperty);
  347. // For @counter-style descriptors
  348. static nsCSSCounterDesc LookupCounterDesc(const nsAString& aProperty);
  349. static nsCSSCounterDesc LookupCounterDesc(const nsACString& aProperty);
  350. // For predefined counter styles which need to be lower-cased during parse
  351. static bool IsPredefinedCounterStyle(const nsAString& aStyle);
  352. static bool IsPredefinedCounterStyle(const nsACString& aStyle);
  353. // Given a property enum, get the string value
  354. static const nsAFlatCString& GetStringValue(nsCSSPropertyID aProperty);
  355. static const nsAFlatCString& GetStringValue(nsCSSFontDesc aFontDesc);
  356. static const nsAFlatCString& GetStringValue(nsCSSCounterDesc aCounterDesc);
  357. // Given a CSS Property and a Property Enum Value
  358. // Return back a const nsString& representation of the
  359. // value. Return back nullstr if no value is found
  360. static const nsAFlatCString& LookupPropertyValue(nsCSSPropertyID aProperty, int32_t aValue);
  361. // Get a color name for a predefined color value like buttonhighlight or activeborder
  362. // Sets the aStr param to the name of the propertyID
  363. static bool GetColorName(int32_t aPropID, nsCString &aStr);
  364. // Returns the index of |aKeyword| in |aTable|, if it exists there;
  365. // otherwise, returns -1.
  366. // NOTE: Generally, clients should call FindKeyword() instead of this method.
  367. static int32_t FindIndexOfKeyword(nsCSSKeyword aKeyword,
  368. const KTableEntry aTable[]);
  369. // Find |aKeyword| in |aTable|, if found set |aValue| to its corresponding value.
  370. // If not found, return false and do not set |aValue|.
  371. static bool FindKeyword(nsCSSKeyword aKeyword, const KTableEntry aTable[],
  372. int32_t& aValue);
  373. // Return the first keyword in |aTable| that has the corresponding value |aValue|.
  374. // Return |eCSSKeyword_UNKNOWN| if not found.
  375. static nsCSSKeyword ValueToKeywordEnum(int32_t aValue,
  376. const KTableEntry aTable[]);
  377. template<typename T,
  378. typename = typename std::enable_if<std::is_enum<T>::value>::type>
  379. static nsCSSKeyword ValueToKeywordEnum(T aValue,
  380. const KTableEntry aTable[])
  381. {
  382. static_assert(mozilla::EnumTypeFitsWithin<T, int16_t>::value,
  383. "aValue must be an enum that fits within KTableEntry::mValue");
  384. return ValueToKeywordEnum(static_cast<int16_t>(aValue), aTable);
  385. }
  386. // Ditto but as a string, return "" when not found.
  387. static const nsAFlatCString& ValueToKeyword(int32_t aValue,
  388. const KTableEntry aTable[]);
  389. template<typename T,
  390. typename = typename std::enable_if<std::is_enum<T>::value>::type>
  391. static const nsAFlatCString& ValueToKeyword(T aValue,
  392. const KTableEntry aTable[])
  393. {
  394. static_assert(mozilla::EnumTypeFitsWithin<T, int16_t>::value,
  395. "aValue must be an enum that fits within KTableEntry::mValue");
  396. return ValueToKeyword(static_cast<int16_t>(aValue), aTable);
  397. }
  398. static const nsStyleStructID kSIDTable[eCSSProperty_COUNT_no_shorthands];
  399. static const KTableEntry* const kKeywordTableTable[eCSSProperty_COUNT_no_shorthands];
  400. static const nsStyleAnimType kAnimTypeTable[eCSSProperty_COUNT_no_shorthands];
  401. static const ptrdiff_t
  402. kStyleStructOffsetTable[eCSSProperty_COUNT_no_shorthands];
  403. private:
  404. static const uint32_t kFlagsTable[eCSSProperty_COUNT];
  405. public:
  406. static inline bool PropHasFlags(nsCSSPropertyID aProperty, uint32_t aFlags)
  407. {
  408. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
  409. "out of range");
  410. MOZ_ASSERT(!(aFlags & CSS_PROPERTY_PARSE_PROPERTY_MASK),
  411. "The CSS_PROPERTY_PARSE_* values are not bitflags; don't pass "
  412. "them to PropHasFlags. You probably want PropertyParseType "
  413. "instead.");
  414. return (nsCSSProps::kFlagsTable[aProperty] & aFlags) == aFlags;
  415. }
  416. static inline uint32_t PropertyParseType(nsCSSPropertyID aProperty)
  417. {
  418. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
  419. "out of range");
  420. return nsCSSProps::kFlagsTable[aProperty] &
  421. CSS_PROPERTY_PARSE_PROPERTY_MASK;
  422. }
  423. static inline uint32_t ValueRestrictions(nsCSSPropertyID aProperty)
  424. {
  425. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
  426. "out of range");
  427. return nsCSSProps::kFlagsTable[aProperty] &
  428. CSS_PROPERTY_VALUE_RESTRICTION_MASK;
  429. }
  430. private:
  431. // Lives in nsCSSParser.cpp for the macros it depends on.
  432. static const uint32_t kParserVariantTable[eCSSProperty_COUNT_no_shorthands];
  433. public:
  434. static inline uint32_t ParserVariant(nsCSSPropertyID aProperty) {
  435. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
  436. "out of range");
  437. return nsCSSProps::kParserVariantTable[aProperty];
  438. }
  439. private:
  440. // A table for shorthand properties. The appropriate index is the
  441. // property ID minus eCSSProperty_COUNT_no_shorthands.
  442. static const nsCSSPropertyID *const
  443. kSubpropertyTable[eCSSProperty_COUNT - eCSSProperty_COUNT_no_shorthands];
  444. public:
  445. static inline
  446. const nsCSSPropertyID * SubpropertyEntryFor(nsCSSPropertyID aProperty) {
  447. MOZ_ASSERT(eCSSProperty_COUNT_no_shorthands <= aProperty &&
  448. aProperty < eCSSProperty_COUNT,
  449. "out of range");
  450. return nsCSSProps::kSubpropertyTable[aProperty -
  451. eCSSProperty_COUNT_no_shorthands];
  452. }
  453. // Returns an eCSSProperty_UNKNOWN-terminated array of the shorthand
  454. // properties containing |aProperty|, sorted from those that contain
  455. // the most properties to those that contain the least.
  456. static const nsCSSPropertyID * ShorthandsContaining(nsCSSPropertyID aProperty) {
  457. MOZ_ASSERT(gShorthandsContainingPool, "uninitialized");
  458. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
  459. "out of range");
  460. return gShorthandsContainingTable[aProperty];
  461. }
  462. private:
  463. // gShorthandsContainingTable is an array of the return values for
  464. // ShorthandsContaining (arrays of nsCSSPropertyID terminated by
  465. // eCSSProperty_UNKNOWN) pointing into memory in
  466. // gShorthandsContainingPool (which contains all of those arrays in a
  467. // single allocation, and is the one pointer that should be |free|d).
  468. static nsCSSPropertyID *gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands];
  469. static nsCSSPropertyID* gShorthandsContainingPool;
  470. static bool BuildShorthandsContainingTable();
  471. private:
  472. static const size_t gPropertyCountInStruct[nsStyleStructID_Length];
  473. static const size_t gPropertyIndexInStruct[eCSSProperty_COUNT_no_shorthands];
  474. public:
  475. /**
  476. * Return the number of properties that must be cascaded when
  477. * nsRuleNode builds the nsStyle* for aSID.
  478. */
  479. static size_t PropertyCountInStruct(nsStyleStructID aSID) {
  480. MOZ_ASSERT(0 <= aSID && aSID < nsStyleStructID_Length,
  481. "out of range");
  482. return gPropertyCountInStruct[aSID];
  483. }
  484. /**
  485. * Return an index for aProperty that is unique within its SID and in
  486. * the range 0 <= index < PropertyCountInStruct(aSID).
  487. */
  488. static size_t PropertyIndexInStruct(nsCSSPropertyID aProperty) {
  489. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
  490. "out of range");
  491. return gPropertyIndexInStruct[aProperty];
  492. }
  493. private:
  494. // A table for logical property groups. Indexes are
  495. // nsCSSPropertyLogicalGroup values.
  496. static const nsCSSPropertyID* const
  497. kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT];
  498. public:
  499. /**
  500. * Returns an array of longhand physical properties which can be set by
  501. * the argument, which must be a logical longhand property. The returned
  502. * array is terminated by an eCSSProperty_UNKNOWN value. For example,
  503. * given eCSSProperty_margin_block_start, returns an array of the four
  504. * properties eCSSProperty_margin_top, eCSSProperty_margin_right,
  505. * eCSSProperty_margin_bottom and eCSSProperty_margin_left, followed
  506. * by the sentinel.
  507. *
  508. * When called with a property that has the CSS_PROPERTY_LOGICAL_AXIS
  509. * flag, the returned array will have two values preceding the sentinel;
  510. * otherwise it will have four.
  511. *
  512. * (Note that the running time of this function is proportional to the
  513. * number of logical longhand properties that exist. If we start
  514. * getting too many of these properties, we should make kLogicalGroupTable
  515. * be a simple array of eCSSProperty_COUNT length.)
  516. */
  517. static const nsCSSPropertyID* LogicalGroup(nsCSSPropertyID aProperty);
  518. private:
  519. static bool gPropertyEnabled[eCSSProperty_COUNT_with_aliases];
  520. private:
  521. // Defined in the generated nsCSSPropsGenerated.inc.
  522. static const char* const kIDLNameTable[eCSSProperty_COUNT];
  523. public:
  524. /**
  525. * Returns the IDL name of the specified property, which must be a
  526. * longhand, logical or shorthand property. The IDL name is the property
  527. * name with any hyphen-lowercase character pairs replaced by an
  528. * uppercase character:
  529. * https://drafts.csswg.org/cssom/#css-property-to-idl-attribute
  530. *
  531. * As a special case, the string "cssFloat" is returned for the float
  532. * property. nullptr is returned for internal properties.
  533. */
  534. static const char* PropertyIDLName(nsCSSPropertyID aProperty)
  535. {
  536. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
  537. "out of range");
  538. return kIDLNameTable[aProperty];
  539. }
  540. private:
  541. static const int32_t kIDLNameSortPositionTable[eCSSProperty_COUNT];
  542. public:
  543. /**
  544. * Returns the position of the specified property in a list of all
  545. * properties sorted by their IDL name.
  546. */
  547. static int32_t PropertyIDLNameSortPosition(nsCSSPropertyID aProperty)
  548. {
  549. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
  550. "out of range");
  551. return kIDLNameSortPositionTable[aProperty];
  552. }
  553. static bool IsEnabled(nsCSSPropertyID aProperty) {
  554. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_with_aliases,
  555. "out of range");
  556. return gPropertyEnabled[aProperty];
  557. }
  558. // A table for the use counter associated with each CSS property. If a
  559. // property does not have a use counter defined in UseCounters.conf, then
  560. // its associated entry is |eUseCounter_UNKNOWN|.
  561. static const mozilla::UseCounter gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands];
  562. public:
  563. static mozilla::UseCounter UseCounterFor(nsCSSPropertyID aProperty) {
  564. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
  565. "out of range");
  566. return gPropertyUseCounter[aProperty];
  567. }
  568. static bool IsEnabled(nsCSSPropertyID aProperty, EnabledState aEnabled)
  569. {
  570. if (IsEnabled(aProperty)) {
  571. return true;
  572. }
  573. if (aEnabled == EnabledState::eIgnoreEnabledState) {
  574. return true;
  575. }
  576. if ((aEnabled & EnabledState::eInUASheets) &&
  577. PropHasFlags(aProperty, CSS_PROPERTY_ENABLED_IN_UA_SHEETS))
  578. {
  579. return true;
  580. }
  581. if ((aEnabled & EnabledState::eInChrome) &&
  582. PropHasFlags(aProperty, CSS_PROPERTY_ENABLED_IN_CHROME))
  583. {
  584. return true;
  585. }
  586. return false;
  587. }
  588. public:
  589. static void AddRefAtoms();
  590. static nsICSSProperty* AtomForProperty(nsCSSPropertyID aProperty)
  591. {
  592. MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT);
  593. return gPropertyAtomTable[aProperty];
  594. }
  595. #define CSS_PROP(name_, id_, ...) static nsICSSProperty* id_;
  596. #define CSS_PROP_SHORTHAND(name_, id_, ...) CSS_PROP(name_, id_, ...)
  597. #define CSS_PROP_LIST_INCLUDE_LOGICAL
  598. #include "nsCSSPropList.h"
  599. #undef CSS_PROP_LIST_INCLUDE_LOGICAL
  600. #undef CSS_PROP_SHORTHAND
  601. #undef CSS_PROP
  602. private:
  603. static nsICSSProperty* gPropertyAtomTable[eCSSProperty_COUNT];
  604. public:
  605. // Storing the enabledstate_ value in an nsCSSPropertyID variable is a small hack
  606. // to avoid needing a separate variable declaration for its real type
  607. // (CSSEnabledState), which would then require using a block and
  608. // therefore a pair of macros by consumers for the start and end of the loop.
  609. #define CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(it_, prop_, enabledstate_) \
  610. for (const nsCSSPropertyID *it_ = nsCSSProps::SubpropertyEntryFor(prop_), \
  611. es_ = (nsCSSPropertyID)((enabledstate_) | \
  612. CSSEnabledState(0)); \
  613. *it_ != eCSSProperty_UNKNOWN; ++it_) \
  614. if (nsCSSProps::IsEnabled(*it_, (mozilla::CSSEnabledState) es_))
  615. // Keyword/Enum value tables
  616. static const KTableEntry kAnimationDirectionKTable[];
  617. static const KTableEntry kAnimationFillModeKTable[];
  618. static const KTableEntry kAnimationIterationCountKTable[];
  619. static const KTableEntry kAnimationPlayStateKTable[];
  620. static const KTableEntry kAnimationTimingFunctionKTable[];
  621. static const KTableEntry kAppearanceKTable[];
  622. static const KTableEntry kAzimuthKTable[];
  623. static const KTableEntry kBackfaceVisibilityKTable[];
  624. static const KTableEntry kTransformStyleKTable[];
  625. static const KTableEntry kImageLayerAttachmentKTable[];
  626. static const KTableEntry kImageLayerOriginKTable[];
  627. static const KTableEntry kBackgroundOriginKTable[];
  628. static const KTableEntry kMaskOriginKTable[];
  629. static const KTableEntry kImageLayerPositionKTable[];
  630. static const KTableEntry kImageLayerRepeatKTable[];
  631. static const KTableEntry kImageLayerRepeatPartKTable[];
  632. static const KTableEntry kImageLayerSizeKTable[];
  633. static const KTableEntry kImageLayerCompositeKTable[];
  634. static const KTableEntry kImageLayerModeKTable[];
  635. // Not const because we modify its entries when the pref
  636. // "layout.css.background-clip.text" changes:
  637. static KTableEntry kBackgroundClipKTable[];
  638. static const KTableEntry kMaskClipKTable[];
  639. static const KTableEntry kBlendModeKTable[];
  640. static const KTableEntry kBorderCollapseKTable[];
  641. static const KTableEntry kBorderImageRepeatKTable[];
  642. static const KTableEntry kBorderImageSliceKTable[];
  643. static const KTableEntry kBorderStyleKTable[];
  644. static const KTableEntry kBorderWidthKTable[];
  645. static const KTableEntry kBoxAlignKTable[];
  646. static const KTableEntry kBoxDecorationBreakKTable[];
  647. static const KTableEntry kBoxDirectionKTable[];
  648. static const KTableEntry kBoxOrientKTable[];
  649. static const KTableEntry kBoxPackKTable[];
  650. static const KTableEntry kClipPathGeometryBoxKTable[];
  651. static const KTableEntry kCounterRangeKTable[];
  652. static const KTableEntry kCounterSpeakAsKTable[];
  653. static const KTableEntry kCounterSymbolsSystemKTable[];
  654. static const KTableEntry kCounterSystemKTable[];
  655. static const KTableEntry kDominantBaselineKTable[];
  656. static const KTableEntry kShapeRadiusKTable[];
  657. static const KTableEntry kFillRuleKTable[];
  658. static const KTableEntry kFilterFunctionKTable[];
  659. static const KTableEntry kImageRenderingKTable[];
  660. static const KTableEntry kShapeOutsideShapeBoxKTable[];
  661. static const KTableEntry kShapeRenderingKTable[];
  662. static const KTableEntry kStrokeLinecapKTable[];
  663. static const KTableEntry kStrokeLinejoinKTable[];
  664. static const KTableEntry kStrokeContextValueKTable[];
  665. static const KTableEntry kVectorEffectKTable[];
  666. static const KTableEntry kTextAnchorKTable[];
  667. static const KTableEntry kTextRenderingKTable[];
  668. static const KTableEntry kColorAdjustKTable[];
  669. static const KTableEntry kColorInterpolationKTable[];
  670. static const KTableEntry kColumnFillKTable[];
  671. static const KTableEntry kBoxPropSourceKTable[];
  672. static const KTableEntry kBoxShadowTypeKTable[];
  673. static const KTableEntry kBoxSizingKTable[];
  674. static const KTableEntry kCaptionSideKTable[];
  675. // Not const because we modify its entries when the pref
  676. // "layout.css.float-logical-values.enabled" changes:
  677. static KTableEntry kClearKTable[];
  678. static const KTableEntry kColorKTable[];
  679. static const KTableEntry kContentKTable[];
  680. static const KTableEntry kControlCharacterVisibilityKTable[];
  681. static const KTableEntry kCursorKTable[];
  682. static const KTableEntry kDirectionKTable[];
  683. // Not const because we modify its entries when various
  684. // "layout.css.*.enabled" prefs changes:
  685. static KTableEntry kDisplayKTable[];
  686. static const KTableEntry kElevationKTable[];
  687. static const KTableEntry kEmptyCellsKTable[];
  688. // -- tables for parsing the {align,justify}-{content,items,self} properties --
  689. static const KTableEntry kAlignAllKeywords[];
  690. static const KTableEntry kAlignOverflowPosition[]; // <overflow-position>
  691. static const KTableEntry kAlignSelfPosition[]; // <self-position>
  692. static const KTableEntry kAlignLegacy[]; // 'legacy'
  693. static const KTableEntry kAlignLegacyPosition[]; // 'left/right/center'
  694. static const KTableEntry kAlignAutoNormalStretchBaseline[]; // 'auto/normal/stretch/baseline'
  695. static const KTableEntry kAlignNormalStretchBaseline[]; // 'normal/stretch/baseline'
  696. static const KTableEntry kAlignNormalBaseline[]; // 'normal/baseline'
  697. static const KTableEntry kAlignContentDistribution[]; // <content-distribution>
  698. static const KTableEntry kAlignContentPosition[]; // <content-position>
  699. // -- tables for auto-completion of the {align,justify}-{content,items,self} properties --
  700. static const KTableEntry kAutoCompletionAlignJustifySelf[];
  701. static const KTableEntry kAutoCompletionAlignItems[];
  702. static const KTableEntry kAutoCompletionAlignJustifyContent[];
  703. // ------------------------------------------------------------------
  704. static const KTableEntry kFlexDirectionKTable[];
  705. static const KTableEntry kFlexWrapKTable[];
  706. // Not const because we modify its entries when the pref
  707. // "layout.css.float-logical-values.enabled" changes:
  708. static KTableEntry kFloatKTable[];
  709. static const KTableEntry kFloatEdgeKTable[];
  710. static const KTableEntry kFontDisplayKTable[];
  711. static const KTableEntry kFontKTable[];
  712. static const KTableEntry kFontKerningKTable[];
  713. static const KTableEntry kFontSizeKTable[];
  714. static const KTableEntry kFontSmoothingKTable[];
  715. static const KTableEntry kFontStretchKTable[];
  716. static const KTableEntry kFontStyleKTable[];
  717. static const KTableEntry kFontSynthesisKTable[];
  718. static const KTableEntry kFontVariantKTable[];
  719. static const KTableEntry kFontVariantAlternatesKTable[];
  720. static const KTableEntry kFontVariantAlternatesFuncsKTable[];
  721. static const KTableEntry kFontVariantCapsKTable[];
  722. static const KTableEntry kFontVariantEastAsianKTable[];
  723. static const KTableEntry kFontVariantLigaturesKTable[];
  724. static const KTableEntry kFontVariantNumericKTable[];
  725. static const KTableEntry kFontVariantPositionKTable[];
  726. static const KTableEntry kFontWeightKTable[];
  727. static const KTableEntry kGridAutoFlowKTable[];
  728. static const KTableEntry kGridTrackBreadthKTable[];
  729. static const KTableEntry kHyphensKTable[];
  730. static const KTableEntry kImageOrientationKTable[];
  731. static const KTableEntry kImageOrientationFlipKTable[];
  732. static const KTableEntry kIsolationKTable[];
  733. static const KTableEntry kIMEModeKTable[];
  734. static const KTableEntry kLineHeightKTable[];
  735. static const KTableEntry kListStylePositionKTable[];
  736. static const KTableEntry kListStyleKTable[];
  737. static const KTableEntry kMaskTypeKTable[];
  738. static const KTableEntry kMathVariantKTable[];
  739. static const KTableEntry kMathDisplayKTable[];
  740. static const KTableEntry kContainKTable[];
  741. static const KTableEntry kContextOpacityKTable[];
  742. static const KTableEntry kContextPatternKTable[];
  743. static const KTableEntry kObjectFitKTable[];
  744. static const KTableEntry kOrientKTable[];
  745. static const KTableEntry kOutlineStyleKTable[];
  746. static const KTableEntry kOverflowKTable[];
  747. static const KTableEntry kOverflowSubKTable[];
  748. static const KTableEntry kOverflowClipBoxKTable[];
  749. static const KTableEntry kOverflowWrapKTable[];
  750. static const KTableEntry kPageBreakKTable[];
  751. static const KTableEntry kPageBreakInsideKTable[];
  752. static const KTableEntry kPageMarksKTable[];
  753. static const KTableEntry kPageSizeKTable[];
  754. static const KTableEntry kPitchKTable[];
  755. static const KTableEntry kPointerEventsKTable[];
  756. static const KTableEntry kPositionKTable[];
  757. static const KTableEntry kRadialGradientShapeKTable[];
  758. static const KTableEntry kRadialGradientSizeKTable[];
  759. static const KTableEntry kRadialGradientLegacySizeKTable[];
  760. static const KTableEntry kResizeKTable[];
  761. static const KTableEntry kRubyAlignKTable[];
  762. static const KTableEntry kRubyPositionKTable[];
  763. static const KTableEntry kScrollBehaviorKTable[];
  764. static const KTableEntry kScrollSnapTypeKTable[];
  765. static const KTableEntry kScrollbarWidthKTable[];
  766. static const KTableEntry kSpeakKTable[];
  767. static const KTableEntry kSpeakHeaderKTable[];
  768. static const KTableEntry kSpeakNumeralKTable[];
  769. static const KTableEntry kSpeakPunctuationKTable[];
  770. static const KTableEntry kSpeechRateKTable[];
  771. static const KTableEntry kStackSizingKTable[];
  772. static const KTableEntry kTableLayoutKTable[];
  773. // Not const because we modify its entries when the pref
  774. // "layout.css.text-align-unsafe-value.enabled" changes:
  775. static KTableEntry kTextAlignKTable[];
  776. static KTableEntry kTextAlignLastKTable[];
  777. static const KTableEntry kTextCombineUprightKTable[];
  778. static const KTableEntry kTextDecorationLineKTable[];
  779. static const KTableEntry kTextDecorationStyleKTable[];
  780. static const KTableEntry kTextEmphasisPositionKTable[];
  781. static const KTableEntry kTextEmphasisStyleFillKTable[];
  782. static const KTableEntry kTextEmphasisStyleShapeKTable[];
  783. static const KTableEntry kTextJustifyKTable[];
  784. static const KTableEntry kTextOrientationKTable[];
  785. static const KTableEntry kTextOverflowKTable[];
  786. static const KTableEntry kTextTransformKTable[];
  787. static const KTableEntry kTouchActionKTable[];
  788. static const KTableEntry kTopLayerKTable[];
  789. static const KTableEntry kTransformBoxKTable[];
  790. static const KTableEntry kTransitionTimingFunctionKTable[];
  791. static const KTableEntry kUnicodeBidiKTable[];
  792. static const KTableEntry kUserFocusKTable[];
  793. static const KTableEntry kUserInputKTable[];
  794. static const KTableEntry kUserModifyKTable[];
  795. static const KTableEntry kUserSelectKTable[];
  796. static const KTableEntry kVerticalAlignKTable[];
  797. static const KTableEntry kVisibilityKTable[];
  798. static const KTableEntry kVolumeKTable[];
  799. static const KTableEntry kWhitespaceKTable[];
  800. static const KTableEntry kWidthKTable[]; // also min-width, max-width
  801. static const KTableEntry kWindowDraggingKTable[];
  802. static const KTableEntry kWindowShadowKTable[];
  803. static const KTableEntry kWordBreakKTable[];
  804. static const KTableEntry kWritingModeKTable[];
  805. };
  806. #endif /* nsCSSProps_h___ */