StyleSheetSpecification.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. /*
  2. * This source file is part of libRocket, the HTML/CSS Interface Middleware
  3. *
  4. * For the latest information, see http://www.librocket.com
  5. *
  6. * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. *
  26. */
  27. #include "precompiled.h"
  28. #include "../../Include/Rocket/Core/StyleSheetSpecification.h"
  29. #include "PropertyParserNumber.h"
  30. #include "PropertyParserAnimation.h"
  31. #include "PropertyParserColour.h"
  32. #include "PropertyParserKeyword.h"
  33. #include "PropertyParserString.h"
  34. #include "PropertyParserTransform.h"
  35. #include "PropertyShorthandDefinition.h"
  36. #include "DirtyPropertyList.h"
  37. namespace Rocket {
  38. namespace Core {
  39. static StyleSheetSpecification* instance = NULL;
  40. static DirtyPropertyList registered_inherited_properties;
  41. StyleSheetSpecification::StyleSheetSpecification() :
  42. // Reserve space for all defined ids and some more for custom properties
  43. properties(2 * (size_t)PropertyId::NumDefinedIds, 2 * (size_t)ShorthandId::NumDefinedIds)
  44. {
  45. ROCKET_ASSERT(instance == NULL);
  46. instance = this;
  47. registered_inherited_properties.Clear();
  48. }
  49. StyleSheetSpecification::~StyleSheetSpecification()
  50. {
  51. ROCKET_ASSERT(instance == this);
  52. instance = NULL;
  53. }
  54. PropertyDefinition& StyleSheetSpecification::RegisterProperty(PropertyId id, const String& property_name, const String& default_value, bool inherited, bool forces_layout)
  55. {
  56. auto& result = properties.RegisterProperty(property_name, default_value, inherited, forces_layout, id);
  57. if (inherited)
  58. registered_inherited_properties.Insert(result.GetId());
  59. return result;
  60. }
  61. ShorthandId StyleSheetSpecification::RegisterShorthand(ShorthandId id, const String& shorthand_name, const String& property_names, ShorthandType type)
  62. {
  63. return properties.RegisterShorthand(shorthand_name, property_names, type, id);
  64. }
  65. bool StyleSheetSpecification::Initialise()
  66. {
  67. if (instance == NULL)
  68. {
  69. new StyleSheetSpecification();
  70. instance->RegisterDefaultParsers();
  71. instance->RegisterDefaultProperties();
  72. }
  73. return true;
  74. }
  75. void StyleSheetSpecification::Shutdown()
  76. {
  77. if (instance != NULL)
  78. {
  79. for (ParserMap::iterator iterator = instance->parsers.begin(); iterator != instance->parsers.end(); ++iterator)
  80. (*iterator).second->Release();
  81. delete instance;
  82. }
  83. }
  84. // Registers a parser for use in property definitions.
  85. bool StyleSheetSpecification::RegisterParser(const String& parser_name, PropertyParser* parser)
  86. {
  87. ParserMap::iterator iterator = instance->parsers.find(parser_name);
  88. if (iterator != instance->parsers.end())
  89. (*iterator).second->Release();
  90. instance->parsers[parser_name] = parser;
  91. return true;
  92. }
  93. // Returns the parser registered with a specific name.
  94. PropertyParser* StyleSheetSpecification::GetParser(const String& parser_name)
  95. {
  96. ParserMap::iterator iterator = instance->parsers.find(parser_name);
  97. if (iterator == instance->parsers.end())
  98. return NULL;
  99. return (*iterator).second;
  100. }
  101. // Registers a property with a new definition.
  102. PropertyDefinition& StyleSheetSpecification::RegisterProperty(const String& property_name, const String& default_value, bool inherited, bool forces_layout)
  103. {
  104. ROCKET_ASSERTMSG((size_t)instance->properties.property_map.GetId(property_name) < (size_t)PropertyId::FirstCustomId, "Custom property name matches an internal property, please make a unique name for the given property.");
  105. return instance->RegisterProperty(PropertyId::Invalid, property_name, default_value, inherited, forces_layout);
  106. }
  107. // Returns a property definition.
  108. const PropertyDefinition* StyleSheetSpecification::GetProperty(const String& property_name)
  109. {
  110. return instance->properties.GetProperty(property_name);
  111. }
  112. const PropertyDefinition* StyleSheetSpecification::GetProperty(PropertyId id)
  113. {
  114. return instance->properties.GetProperty(id);
  115. }
  116. // Fetches a list of the names of all registered property definitions.
  117. const PropertyNameList& StyleSheetSpecification::GetRegisteredProperties()
  118. {
  119. return instance->properties.GetRegisteredProperties();
  120. }
  121. const PropertyNameList & StyleSheetSpecification::GetRegisteredInheritedProperties()
  122. {
  123. return instance->properties.GetRegisteredInheritedProperties();
  124. }
  125. // Registers a shorthand property definition.
  126. ShorthandId StyleSheetSpecification::RegisterShorthand(const String& shorthand_name, const String& property_names, ShorthandType type)
  127. {
  128. ROCKET_ASSERTMSG(instance->properties.property_map.GetId(shorthand_name) == PropertyId::Invalid, "Custom shorthand name matches a property name, please make a unique name.");
  129. ROCKET_ASSERTMSG((size_t)instance->properties.shorthand_map.GetId(shorthand_name) < (size_t)ShorthandId::FirstCustomId, "Custom shorthand name matches an internal shorthand, please make a unique name for the given shorthand property.");
  130. return instance->properties.RegisterShorthand(shorthand_name, property_names, type);
  131. }
  132. // Returns a shorthand definition.
  133. const ShorthandDefinition* StyleSheetSpecification::GetShorthand(const String& shorthand_name)
  134. {
  135. return instance->properties.GetShorthand(shorthand_name);
  136. }
  137. const ShorthandDefinition* StyleSheetSpecification::GetShorthand(ShorthandId id)
  138. {
  139. return instance->properties.GetShorthand(id);
  140. }
  141. // Parses a property declaration, setting any parsed and validated properties on the given dictionary.
  142. bool StyleSheetSpecification::ParsePropertyDeclaration(PropertyDictionary& dictionary, const String& property_name, const String& property_value, const String& source_file, int source_line_number)
  143. {
  144. return instance->properties.ParsePropertyDeclaration(dictionary, property_name, property_value, source_file, source_line_number);
  145. }
  146. PropertyId StyleSheetSpecification::GetPropertyId(const String& property_name)
  147. {
  148. return instance->properties.property_map.GetId(property_name);
  149. }
  150. ShorthandId StyleSheetSpecification::GetShorthandId(const String& shorthand_name)
  151. {
  152. return instance->properties.shorthand_map.GetId(shorthand_name);
  153. }
  154. const String& StyleSheetSpecification::GetPropertyName(PropertyId id)
  155. {
  156. return instance->properties.property_map.GetName(id);
  157. }
  158. const String& StyleSheetSpecification::GetShorthandName(ShorthandId id)
  159. {
  160. return instance->properties.shorthand_map.GetName(id);
  161. }
  162. const DirtyPropertyList& StyleSheetSpecification::GetRegisteredInheritedPropertyBitList()
  163. {
  164. return registered_inherited_properties;
  165. }
  166. std::vector<PropertyId> StyleSheetSpecification::GetShorthandUnderlyingProperties(ShorthandId id)
  167. {
  168. std::vector<PropertyId> result;
  169. const ShorthandDefinition* shorthand = instance->properties.GetShorthand(id);
  170. if (!shorthand)
  171. return result;
  172. result.reserve(shorthand->items.size());
  173. for (auto& item : shorthand->items)
  174. {
  175. if (item.type == ShorthandItemType::Property)
  176. {
  177. result.push_back(item.property_id);
  178. }
  179. else if (item.type == ShorthandItemType::Shorthand)
  180. {
  181. // When we have a shorthand pointing to another shorthands, call us recursively
  182. std::vector<PropertyId> new_items = GetShorthandUnderlyingProperties(item.shorthand_id);
  183. result.insert(result.end(), new_items.begin(), new_items.end());
  184. }
  185. }
  186. return result;
  187. }
  188. const PropertySpecification& StyleSheetSpecification::GetPropertySpecification()
  189. {
  190. return instance->properties;
  191. }
  192. // Registers Rocket's default parsers.
  193. void StyleSheetSpecification::RegisterDefaultParsers()
  194. {
  195. RegisterParser("number", new PropertyParserNumber(Property::NUMBER));
  196. RegisterParser("length", new PropertyParserNumber(Property::LENGTH, Property::PX));
  197. RegisterParser("length_percent", new PropertyParserNumber(Property::LENGTH_PERCENT, Property::PX));
  198. RegisterParser("number_length_percent", new PropertyParserNumber(Property::NUMBER_LENGTH_PERCENT, Property::PX));
  199. RegisterParser("angle", new PropertyParserNumber(Property::ANGLE, Property::RAD));
  200. RegisterParser("keyword", new PropertyParserKeyword());
  201. RegisterParser("string", new PropertyParserString());
  202. RegisterParser(ANIMATION, new PropertyParserAnimation(PropertyParserAnimation::ANIMATION_PARSER));
  203. RegisterParser(TRANSITION, new PropertyParserAnimation(PropertyParserAnimation::TRANSITION_PARSER));
  204. RegisterParser(COLOR, new PropertyParserColour());
  205. RegisterParser(TRANSFORM, new PropertyParserTransform());
  206. }
  207. // Registers Rocket's default style properties.
  208. void StyleSheetSpecification::RegisterDefaultProperties()
  209. {
  210. // Style property specifications (ala RCSS).
  211. RegisterProperty(PropertyId::MarginTop, MARGIN_TOP, "0px", false, true)
  212. .AddParser("keyword", "auto")
  213. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  214. RegisterProperty(PropertyId::MarginRight, MARGIN_RIGHT, "0px", false, true)
  215. .AddParser("keyword", "auto")
  216. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  217. RegisterProperty(PropertyId::MarginBottom, MARGIN_BOTTOM, "0px", false, true)
  218. .AddParser("keyword", "auto")
  219. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  220. RegisterProperty(PropertyId::MarginLeft, MARGIN_LEFT, "0px", false, true)
  221. .AddParser("keyword", "auto")
  222. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  223. RegisterShorthand(ShorthandId::Margin, MARGIN, "margin-top, margin-right, margin-bottom, margin-left", ShorthandType::Box);
  224. RegisterProperty(PropertyId::PaddingTop, PADDING_TOP, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  225. RegisterProperty(PropertyId::PaddingRight, PADDING_RIGHT, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  226. RegisterProperty(PropertyId::PaddingBottom, PADDING_BOTTOM, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  227. RegisterProperty(PropertyId::PaddingLeft, PADDING_LEFT, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  228. RegisterShorthand(ShorthandId::Padding, PADDING, "padding-top, padding-right, padding-bottom, padding-left", ShorthandType::Box);
  229. RegisterProperty(PropertyId::BorderTopWidth, BORDER_TOP_WIDTH, "0px", false, true).AddParser("length");
  230. RegisterProperty(PropertyId::BorderRightWidth, BORDER_RIGHT_WIDTH, "0px", false, true).AddParser("length");
  231. RegisterProperty(PropertyId::BorderBottomWidth, BORDER_BOTTOM_WIDTH, "0px", false, true).AddParser("length");
  232. RegisterProperty(PropertyId::BorderLeftWidth, BORDER_LEFT_WIDTH, "0px", false, true).AddParser("length");
  233. RegisterShorthand(ShorthandId::BorderWidth, BORDER_WIDTH, "border-top-width, border-right-width, border-bottom-width, border-left-width", ShorthandType::Box);
  234. RegisterProperty(PropertyId::BorderTopColor, BORDER_TOP_COLOR, "black", false, false).AddParser(COLOR);
  235. RegisterProperty(PropertyId::BorderRightColor, BORDER_RIGHT_COLOR, "black", false, false).AddParser(COLOR);
  236. RegisterProperty(PropertyId::BorderBottomColor, BORDER_BOTTOM_COLOR, "black", false, false).AddParser(COLOR);
  237. RegisterProperty(PropertyId::BorderLeftColor, BORDER_LEFT_COLOR, "black", false, false).AddParser(COLOR);
  238. RegisterShorthand(ShorthandId::BorderColor, BORDER_COLOR, "border-top-color, border-right-color, border-bottom-color, border-left-color", ShorthandType::Box);
  239. RegisterShorthand(ShorthandId::BorderTop, BORDER_TOP, "border-top-width, border-top-color", ShorthandType::FallThrough);
  240. RegisterShorthand(ShorthandId::BorderRight, BORDER_RIGHT, "border-right-width, border-right-color", ShorthandType::FallThrough);
  241. RegisterShorthand(ShorthandId::BorderBottom, BORDER_BOTTOM, "border-bottom-width, border-bottom-color", ShorthandType::FallThrough);
  242. RegisterShorthand(ShorthandId::BorderLeft, BORDER_LEFT, "border-left-width, border-left-color", ShorthandType::FallThrough);
  243. RegisterShorthand(ShorthandId::Border, BORDER, "border-top, border-right, border-bottom, border-left", ShorthandType::Recursive);
  244. RegisterProperty(PropertyId::Display, DISPLAY, "inline", false, true).AddParser("keyword", "none, block, inline, inline-block");
  245. RegisterProperty(PropertyId::Position, POSITION, "static", false, true).AddParser("keyword", "static, relative, absolute, fixed");
  246. RegisterProperty(PropertyId::Top, TOP, "auto", false, false)
  247. .AddParser("keyword", "auto")
  248. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
  249. RegisterProperty(PropertyId::Right, RIGHT, "auto", false, false)
  250. .AddParser("keyword", "auto")
  251. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  252. RegisterProperty(PropertyId::Bottom, BOTTOM, "auto", false, false)
  253. .AddParser("keyword", "auto")
  254. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
  255. RegisterProperty(PropertyId::Left, LEFT, "auto", false, false)
  256. .AddParser("keyword", "auto")
  257. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  258. RegisterProperty(PropertyId::Float, FLOAT, "none", false, true).AddParser("keyword", "none, left, right");
  259. RegisterProperty(PropertyId::Clear, CLEAR, "none", false, true).AddParser("keyword", "none, left, right, both");
  260. RegisterProperty(PropertyId::ZIndex, Z_INDEX, "auto", false, false)
  261. .AddParser("keyword", "auto")
  262. .AddParser("number");
  263. RegisterProperty(PropertyId::Width, WIDTH, "auto", false, true)
  264. .AddParser("keyword", "auto")
  265. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  266. RegisterProperty(PropertyId::MinWidth, MIN_WIDTH, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  267. RegisterProperty(PropertyId::MaxWidth, MAX_WIDTH, "-1px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
  268. RegisterProperty(PropertyId::Height, HEIGHT, "auto", false, true)
  269. .AddParser("keyword", "auto")
  270. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
  271. RegisterProperty(PropertyId::MinHeight, MIN_HEIGHT, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
  272. RegisterProperty(PropertyId::MaxHeight, MAX_HEIGHT, "-1px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
  273. RegisterProperty(PropertyId::LineHeight, LINE_HEIGHT, "1.2", true, true).AddParser("number_length_percent").SetRelativeTarget(RelativeTarget::FontSize);
  274. RegisterProperty(PropertyId::VerticalAlign, VERTICAL_ALIGN, "baseline", false, true)
  275. .AddParser("keyword", "baseline, middle, sub, super, text-top, text-bottom, top, bottom")
  276. .AddParser("length_percent").SetRelativeTarget(RelativeTarget::LineHeight);
  277. RegisterProperty(PropertyId::OverflowX, OVERFLOW_X, "visible", false, true).AddParser("keyword", "visible, hidden, auto, scroll");
  278. RegisterProperty(PropertyId::OverflowY, OVERFLOW_Y, "visible", false, true).AddParser("keyword", "visible, hidden, auto, scroll");
  279. RegisterShorthand(ShorthandId::Overflow, "overflow", "overflow-x, overflow-y", ShorthandType::Replicate);
  280. RegisterProperty(PropertyId::Clip, CLIP, "auto", true, false).AddParser("keyword", "auto, none").AddParser("number");
  281. RegisterProperty(PropertyId::Visibility, VISIBILITY, "visible", false, false).AddParser("keyword", "visible, hidden");
  282. // Need some work on this if we are to include images.
  283. RegisterProperty(PropertyId::BackgroundColor, BACKGROUND_COLOR, "transparent", false, false).AddParser(COLOR);
  284. RegisterShorthand(ShorthandId::Background, BACKGROUND, BACKGROUND_COLOR, ShorthandType::FallThrough);
  285. RegisterProperty(PropertyId::Color, COLOR, "white", true, false).AddParser(COLOR);
  286. RegisterProperty(PropertyId::ImageColor, IMAGE_COLOR, "white", false, false).AddParser(COLOR);
  287. RegisterProperty(PropertyId::Opacity, OPACITY, "1", true, false).AddParser("number");
  288. RegisterProperty(PropertyId::FontFamily, FONT_FAMILY, "", true, true).AddParser("string");
  289. RegisterProperty(PropertyId::FontCharset, FONT_CHARSET, "U+0020-007E", true, false).AddParser("string");
  290. RegisterProperty(PropertyId::FontStyle, FONT_STYLE, "normal", true, true).AddParser("keyword", "normal, italic");
  291. RegisterProperty(PropertyId::FontWeight, FONT_WEIGHT, "normal", true, true).AddParser("keyword", "normal, bold");
  292. RegisterProperty(PropertyId::FontSize, FONT_SIZE, "12px", true, true).AddParser("length").AddParser("length_percent").SetRelativeTarget(RelativeTarget::ParentFontSize);
  293. RegisterShorthand(ShorthandId::Font, FONT, "font-style, font-weight, font-size, font-family, font-charset", ShorthandType::FallThrough);
  294. RegisterProperty(PropertyId::TextAlign, TEXT_ALIGN, LEFT, true, true).AddParser("keyword", "left, right, center, justify");
  295. RegisterProperty(PropertyId::TextDecoration, TEXT_DECORATION, "none", true, false).AddParser("keyword", "none, underline"/*"none, underline, overline, line-through"*/);
  296. RegisterProperty(PropertyId::TextTransform, TEXT_TRANSFORM, "none", true, true).AddParser("keyword", "none, capitalize, uppercase, lowercase");
  297. RegisterProperty(PropertyId::WhiteSpace, WHITE_SPACE, "normal", true, true).AddParser("keyword", "normal, pre, nowrap, pre-wrap, pre-line");
  298. RegisterProperty(PropertyId::Cursor, CURSOR, "", true, false).AddParser("string");
  299. // Functional property specifications.
  300. RegisterProperty(PropertyId::Drag, DRAG, "none", false, false).AddParser("keyword", "none, drag, drag-drop, block, clone");
  301. RegisterProperty(PropertyId::TabIndex, TAB_INDEX, "none", false, false).AddParser("keyword", "none, auto");
  302. RegisterProperty(PropertyId::Focus, FOCUS, "auto", true, false).AddParser("keyword", "none, auto");
  303. RegisterProperty(PropertyId::ScrollbarMargin, SCROLLBAR_MARGIN, "0", false, false).AddParser("length");
  304. RegisterProperty(PropertyId::PointerEvents, POINTER_EVENTS, "auto", true, false).AddParser("keyword", "none, auto");
  305. // Perspective and Transform specifications
  306. RegisterProperty(PropertyId::Perspective, PERSPECTIVE, "none", false, false).AddParser("keyword", "none").AddParser("length");
  307. RegisterProperty(PropertyId::PerspectiveOriginX, PERSPECTIVE_ORIGIN_X, "50%", false, false).AddParser("keyword", "left, center, right").AddParser("length_percent");
  308. RegisterProperty(PropertyId::PerspectiveOriginY, PERSPECTIVE_ORIGIN_Y, "50%", false, false).AddParser("keyword", "top, center, bottom").AddParser("length_percent");
  309. RegisterShorthand(ShorthandId::PerspectiveOrigin, PERSPECTIVE_ORIGIN, "perspective-origin-x, perspective-origin-y", ShorthandType::FallThrough);
  310. RegisterProperty(PropertyId::Transform, TRANSFORM, "none", false, false).AddParser(TRANSFORM);
  311. RegisterProperty(PropertyId::TransformOriginX, TRANSFORM_ORIGIN_X, "50%", false, false).AddParser("keyword", "left, center, right").AddParser("length_percent");
  312. RegisterProperty(PropertyId::TransformOriginY, TRANSFORM_ORIGIN_Y, "50%", false, false).AddParser("keyword", "top, center, bottom").AddParser("length_percent");
  313. RegisterProperty(PropertyId::TransformOriginZ, TRANSFORM_ORIGIN_Z, "0", false, false).AddParser("length");
  314. RegisterShorthand(ShorthandId::TransformOrigin, TRANSFORM_ORIGIN, "transform-origin-x, transform-origin-y, transform-origin-z", ShorthandType::FallThrough);
  315. RegisterProperty(PropertyId::Transition, TRANSITION, "none", false, false).AddParser(TRANSITION);
  316. RegisterProperty(PropertyId::Animation, ANIMATION, "none", false, false).AddParser(ANIMATION);
  317. RegisterProperty(PropertyId::Decorator, "decorator", "", false, false).AddParser("string");
  318. RegisterProperty(PropertyId::FontEffect, "font-effect", "", false, false).AddParser("string");
  319. instance->properties.property_map.AssertAllInserted(PropertyId::NumDefinedIds);
  320. instance->properties.shorthand_map.AssertAllInserted(ShorthandId::NumDefinedIds);
  321. }
  322. }
  323. }