Ver código fonte

Remove the StringCache. See #96.

Michael Ragazzon 5 anos atrás
pai
commit
45a6868ff6

+ 0 - 2
CMake/FileList.cmake

@@ -56,7 +56,6 @@ set(Core_HDR_FILES
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyParserTransform.h
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyParserTransform.h
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyShorthandDefinition.h
     ${PROJECT_SOURCE_DIR}/Source/Core/PropertyShorthandDefinition.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.h
-    ${PROJECT_SOURCE_DIR}/Source/Core/StringCache.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNode.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNode.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNodeSelector.h
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetNodeSelector.h
@@ -270,7 +269,6 @@ set(Core_SRC_FILES
     ${PROJECT_SOURCE_DIR}/Source/Core/Stream.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/Stream.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamFile.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamMemory.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StreamMemory.cpp
-    ${PROJECT_SOURCE_DIR}/Source/Core/StringCache.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StringUtilities.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StringUtilities.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheet.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheet.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/StyleSheetFactory.cpp

+ 2 - 3
Source/Core/Element.cpp

@@ -58,7 +58,6 @@
 #include "PropertiesIterator.h"
 #include "PropertiesIterator.h"
 #include "Pool.h"
 #include "Pool.h"
 #include "StyleSheetParser.h"
 #include "StyleSheetParser.h"
-#include "StringCache.h"
 #include "XMLParseTools.h"
 #include "XMLParseTools.h"
 #include <algorithm>
 #include <algorithm>
 #include <cmath>
 #include <cmath>
@@ -1855,10 +1854,10 @@ void Element::ProcessDefaultAction(Event& event)
 			SetPseudoClass("hover", false);
 			SetPseudoClass("hover", false);
 			break;
 			break;
 		case EventId::Focus:
 		case EventId::Focus:
-			SetPseudoClass(FOCUS, true);
+			SetPseudoClass("focus", true);
 			break;
 			break;
 		case EventId::Blur:
 		case EventId::Blur:
-			SetPseudoClass(FOCUS, false);
+			SetPseudoClass("focus", false);
 			break;
 			break;
 		default:
 		default:
 			break;
 			break;

+ 1 - 2
Source/Core/PropertyParserTransform.cpp

@@ -29,7 +29,6 @@
 #include "PropertyParserTransform.h"
 #include "PropertyParserTransform.h"
 #include "../../Include/RmlUi/Core/TransformPrimitive.h"
 #include "../../Include/RmlUi/Core/TransformPrimitive.h"
 #include "../../Include/RmlUi/Core/Transform.h"
 #include "../../Include/RmlUi/Core/Transform.h"
-#include "StringCache.h"
 #include <string.h>
 #include <string.h>
 
 
 namespace Rml {
 namespace Rml {
@@ -49,7 +48,7 @@ PropertyParserTransform::~PropertyParserTransform()
 // Called to parse a RCSS transform declaration.
 // Called to parse a RCSS transform declaration.
 bool PropertyParserTransform::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
 bool PropertyParserTransform::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
 {
 {
-	if(value == NONE)
+	if(value == "none")
 	{
 	{
 		property.value = Variant(TransformPtr());
 		property.value = Variant(TransformPtr());
 		property.unit = Property::TRANSFORM;
 		property.unit = Property::TRANSFORM;

+ 0 - 140
Source/Core/StringCache.cpp

@@ -1,140 +0,0 @@
-/*
- * This source file is part of RmlUi, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://github.com/mikke89/RmlUi
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- * Copyright (c) 2019 The RmlUi Team, and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-#include "../../Include/RmlUi/Core/Types.h"
-#include "StringCache.h"
-
-namespace Rml {
-namespace Core {
-
-const String MARGIN_TOP = "margin-top";
-const String MARGIN_RIGHT = "margin-right";
-const String MARGIN_BOTTOM = "margin-bottom";
-const String MARGIN_LEFT = "margin-left";
-const String MARGIN = "margin";
-const String PADDING_TOP = "padding-top";
-const String PADDING_RIGHT = "padding-right";
-const String PADDING_BOTTOM = "padding-bottom";
-const String PADDING_LEFT = "padding-left";
-const String PADDING = "padding";
-const String BORDER_TOP_WIDTH = "border-top-width";
-const String BORDER_RIGHT_WIDTH = "border-right-width";
-const String BORDER_BOTTOM_WIDTH = "border-bottom-width";
-const String BORDER_LEFT_WIDTH = "border-left-width";
-const String BORDER_WIDTH = "border-width";
-const String BORDER_TOP_COLOR = "border-top-color";
-const String BORDER_RIGHT_COLOR = "border-right-color";
-const String BORDER_BOTTOM_COLOR = "border-bottom-color";
-const String BORDER_LEFT_COLOR = "border-left-color";
-const String BORDER_COLOR = "border-color";
-const String BORDER_TOP = "border-top";
-const String BORDER_RIGHT = "border-right";
-const String BORDER_BOTTOM = "border-bottom";
-const String BORDER_LEFT = "border-left";
-const String BORDER = "border";
-const String DISPLAY = "display";
-const String POSITION = "position";
-const String TOP = "top";
-const String RIGHT = "right";
-const String BOTTOM = "bottom";
-const String LEFT = "left";
-const String FLOAT = "float";
-const String CLEAR = "clear";
-const String Z_INDEX = "z-index";
-const String WIDTH = "width";
-const String MIN_WIDTH = "min-width";
-const String MAX_WIDTH = "max-width";
-const String HEIGHT = "height";
-const String MIN_HEIGHT = "min-height";
-const String MAX_HEIGHT = "max-height";
-const String LINE_HEIGHT = "line-height";
-const String VERTICAL_ALIGN = "vertical-align";
-const String OVERFLOW_X = "overflow-x";
-const String OVERFLOW_Y = "overflow-y";
-const String CLIP = "clip";
-const String VISIBILITY = "visibility";
-const String BACKGROUND_COLOR = "background-color";
-const String BACKGROUND = "background";
-const String COLOR = "color";
-const String IMAGE_COLOR = "image-color";
-const String FONT_FAMILY = "font-family";
-const String FONT_STYLE = "font-style";
-const String FONT_WEIGHT = "font-weight";
-const String FONT_SIZE = "font-size";
-const String FONT = "font";
-const String TEXT_ALIGN = "text-align";
-const String TEXT_DECORATION = "text-decoration";
-const String TEXT_TRANSFORM = "text-transform";
-const String WHITE_SPACE = "white-space";
-const String CURSOR = "cursor";
-const String DRAG = "drag";
-const String TAB_INDEX = "tab-index";
-const String SCROLLBAR_MARGIN = "scrollbar-margin";
-const String PERSPECTIVE = "perspective";
-const String PERSPECTIVE_ORIGIN = "perspective-origin";
-const String PERSPECTIVE_ORIGIN_X = "perspective-origin-x";
-const String PERSPECTIVE_ORIGIN_Y = "perspective-origin-y";
-const String TRANSFORM = "transform";
-const String TRANSFORM_ORIGIN = "transform-origin";
-const String TRANSFORM_ORIGIN_X = "transform-origin-x";
-const String TRANSFORM_ORIGIN_Y = "transform-origin-y";
-const String TRANSFORM_ORIGIN_Z = "transform-origin-z";
-const String NONE = "none";
-const String TRANSITION = "transition";
-const String ANIMATION = "animation";
-const String KEYFRAMES = "keyframes";
-const String OPACITY = "opacity";
-const String POINTER_EVENTS = "pointer-events";
-const String FILL_IMAGE = "fill-image";
-const String MOUSEDOWN = "mousedown";
-const String MOUSESCROLL = "mousescroll";
-const String MOUSEOVER = "mouseover";
-const String MOUSEOUT = "mouseout";
-const String FOCUS = "focus";
-const String BLUR = "blur";
-const String KEYDOWN = "keydown";
-const String MOUSEUP = "mouseup";
-const String CLICK = "click";
-const String DRAGSTART = "dragstart";
-const String DRAGOVER = "dragover";
-const String LOAD = "load";
-const String UNLOAD = "unload";
-const String KEYUP = "keyup";
-const String TEXTINPUT = "textinput";
-const String MOUSEMOVE = "mousemove";
-const String DRAGMOVE = "dragmove";
-const String DBLCLICK = "dblclick";
-const String DRAGDROP = "dragdrop";
-const String DRAGOUT = "dragout";
-const String DRAGEND = "dragend";
-const String RESIZE = "resize";
-const String ANIMATIONEND = "animationend";
-const String TRANSITIONEND = "transitionend";
-
-}
-}

+ 0 - 150
Source/Core/StringCache.h

@@ -1,150 +0,0 @@
-/*
- * This source file is part of RmlUi, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://github.com/mikke89/RmlUi
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- * Copyright (c) 2019 The RmlUi Team, and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
- 
-#ifndef RMLUICORESTRINGCACHE_H
-#define RMLUICORESTRINGCACHE_H
-
-#include "../../Include/RmlUi/Core/Types.h"
-
-namespace Rml {
-namespace Core {
-
-extern const String MARGIN_TOP;
-extern const String MARGIN_RIGHT;
-extern const String MARGIN_BOTTOM;
-extern const String MARGIN_LEFT;
-extern const String MARGIN;
-extern const String PADDING_TOP;
-extern const String PADDING_RIGHT;
-extern const String PADDING_BOTTOM;
-extern const String PADDING_LEFT;
-extern const String PADDING;
-extern const String BORDER_TOP_WIDTH;
-extern const String BORDER_RIGHT_WIDTH;
-extern const String BORDER_BOTTOM_WIDTH;
-extern const String BORDER_LEFT_WIDTH;
-extern const String BORDER_WIDTH;
-extern const String BORDER_TOP_COLOR;
-extern const String BORDER_RIGHT_COLOR;
-extern const String BORDER_BOTTOM_COLOR;
-extern const String BORDER_LEFT_COLOR;
-extern const String BORDER_COLOR;
-extern const String BORDER_TOP;
-extern const String BORDER_RIGHT;
-extern const String BORDER_BOTTOM;
-extern const String BORDER_LEFT;
-extern const String BORDER;
-extern const String DISPLAY;
-extern const String POSITION;
-extern const String TOP;
-extern const String RIGHT;
-extern const String BOTTOM;
-extern const String LEFT;
-extern const String FLOAT;
-extern const String CLEAR;
-extern const String Z_INDEX;
-extern const String WIDTH;
-extern const String MIN_WIDTH;
-extern const String MAX_WIDTH;
-extern const String HEIGHT;
-extern const String MIN_HEIGHT;
-extern const String MAX_HEIGHT;
-extern const String LINE_HEIGHT;
-extern const String VERTICAL_ALIGN;
-extern const String OVERFLOW_X;
-extern const String OVERFLOW_Y;
-extern const String CLIP;
-extern const String VISIBILITY;
-extern const String BACKGROUND_COLOR;
-extern const String BACKGROUND;
-extern const String COLOR;
-extern const String IMAGE_COLOR;
-extern const String FONT_FAMILY;
-extern const String FONT_CHARSET;
-extern const String FONT_STYLE;
-extern const String FONT_WEIGHT;
-extern const String FONT_SIZE;
-extern const String FONT;
-extern const String TEXT_ALIGN;
-extern const String TEXT_DECORATION;
-extern const String TEXT_TRANSFORM;
-extern const String WHITE_SPACE;
-extern const String CURSOR;
-extern const String DRAG;
-extern const String TAB_INDEX;
-extern const String SCROLLBAR_MARGIN;
-
-extern const String PERSPECTIVE;
-extern const String PERSPECTIVE_ORIGIN;
-extern const String PERSPECTIVE_ORIGIN_X;
-extern const String PERSPECTIVE_ORIGIN_Y;
-extern const String TRANSFORM;
-extern const String TRANSFORM_ORIGIN;
-extern const String TRANSFORM_ORIGIN_X;
-extern const String TRANSFORM_ORIGIN_Y;
-extern const String TRANSFORM_ORIGIN_Z;
-extern const String NONE;
-
-extern const String TRANSITION;
-extern const String ANIMATION;
-extern const String KEYFRAMES;
-
-extern const String OPACITY;
-extern const String POINTER_EVENTS;
-extern const String FILL_IMAGE;
-
-extern const String MOUSEDOWN;
-extern const String MOUSESCROLL;
-extern const String MOUSEOVER;
-extern const String MOUSEOUT;
-extern const String FOCUS;
-extern const String BLUR;
-extern const String KEYDOWN;
-extern const String MOUSEUP;
-extern const String CLICK;
-extern const String DRAGSTART;
-extern const String LOAD;
-extern const String UNLOAD;
-extern const String KEYUP;
-extern const String TEXTINPUT;
-extern const String MOUSEMOVE;
-extern const String DRAGMOVE;
-extern const String DBLCLICK;
-extern const String DRAGDROP;
-extern const String DRAGOUT;
-extern const String DRAGEND;
-extern const String DRAGOVER;
-extern const String RESIZE;
-extern const String ANIMATIONEND;
-extern const String TRANSITIONEND;
-
-}
-}
-
-#endif

+ 2 - 3
Source/Core/StyleSheet.cpp

@@ -28,7 +28,6 @@
 
 
 #include "../../Include/RmlUi/Core/StyleSheet.h"
 #include "../../Include/RmlUi/Core/StyleSheet.h"
 #include "ElementDefinition.h"
 #include "ElementDefinition.h"
-#include "StringCache.h"
 #include "StyleSheetFactory.h"
 #include "StyleSheetFactory.h"
 #include "StyleSheetNode.h"
 #include "StyleSheetNode.h"
 #include "StyleSheetParser.h"
 #include "StyleSheetParser.h"
@@ -149,7 +148,7 @@ DecoratorsPtr StyleSheet::InstanceDecoratorsFromString(const String& decorator_s
 	//   decorator: tiled-box( <shorthand properties> ), ...;
 	//   decorator: tiled-box( <shorthand properties> ), ...;
 	
 	
 	Decorators decorators;
 	Decorators decorators;
-	if (decorator_string_value.empty() || decorator_string_value == NONE)
+	if (decorator_string_value.empty() || decorator_string_value == "none")
 		return nullptr;
 		return nullptr;
 
 
 	const char* source_path = (source ? source->path.c_str() : "");
 	const char* source_path = (source ? source->path.c_str() : "");
@@ -229,7 +228,7 @@ FontEffectsPtr StyleSheet::InstanceFontEffectsFromString(const String& font_effe
 	// Where <font-effect-value> is declared with inline properties, e.g.
 	// Where <font-effect-value> is declared with inline properties, e.g.
 	//   font-effect: outline( 1px black ), ...;
 	//   font-effect: outline( 1px black ), ...;
 
 
-	if (font_effect_string_value.empty() || font_effect_string_value == NONE)
+	if (font_effect_string_value.empty() || font_effect_string_value == "none")
 		return nullptr;
 		return nullptr;
 
 
 	const char* source_path = (source ? source->path.c_str() : "");
 	const char* source_path = (source ? source->path.c_str() : "");

+ 1 - 2
Source/Core/StyleSheetParser.cpp

@@ -28,7 +28,6 @@
 
 
 #include "StyleSheetParser.h"
 #include "StyleSheetParser.h"
 #include "ComputeProperty.h"
 #include "ComputeProperty.h"
-#include "StringCache.h"
 #include "StyleSheetFactory.h"
 #include "StyleSheetFactory.h"
 #include "StyleSheetNode.h"
 #include "StyleSheetNode.h"
 #include "../../Include/RmlUi/Core/DecoratorInstancer.h"
 #include "../../Include/RmlUi/Core/DecoratorInstancer.h"
@@ -393,7 +392,7 @@ int StyleSheetParser::Parse(StyleSheetNode* node, Stream* _stream, const StyleSh
 					String at_rule_identifier = pre_token_str.substr(0, pre_token_str.find(' '));
 					String at_rule_identifier = pre_token_str.substr(0, pre_token_str.find(' '));
 					at_rule_name = StringUtilities::StripWhitespace(pre_token_str.substr(at_rule_identifier.size()));
 					at_rule_name = StringUtilities::StripWhitespace(pre_token_str.substr(at_rule_identifier.size()));
 
 
-					if (at_rule_identifier == KEYFRAMES)
+					if (at_rule_identifier == "keyframes")
 					{
 					{
 						state = State::KeyframeBlock;
 						state = State::KeyframeBlock;
 					}
 					}

+ 84 - 85
Source/Core/StyleSheetSpecification.cpp

@@ -37,7 +37,6 @@
 #include "PropertyParserTransform.h"
 #include "PropertyParserTransform.h"
 #include "PropertyShorthandDefinition.h"
 #include "PropertyShorthandDefinition.h"
 #include "IdNameMap.h"
 #include "IdNameMap.h"
-#include "StringCache.h"
 
 
 namespace Rml {
 namespace Rml {
 namespace Core {
 namespace Core {
@@ -267,137 +266,137 @@ void StyleSheetSpecification::RegisterDefaultProperties()
 
 
 	*/
 	*/
 
 
-	RegisterProperty(PropertyId::MarginTop, MARGIN_TOP, "0px", false, true)
+	RegisterProperty(PropertyId::MarginTop, "margin-top", "0px", false, true)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::MarginRight, MARGIN_RIGHT, "0px", false, true)
+	RegisterProperty(PropertyId::MarginRight, "margin-right", "0px", false, true)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::MarginBottom, MARGIN_BOTTOM, "0px", false, true)
+	RegisterProperty(PropertyId::MarginBottom, "margin-bottom", "0px", false, true)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::MarginLeft, MARGIN_LEFT, "0px", false, true)
+	RegisterProperty(PropertyId::MarginLeft, "margin-left", "0px", false, true)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterShorthand(ShorthandId::Margin, MARGIN, "margin-top, margin-right, margin-bottom, margin-left", ShorthandType::Box);
-
-	RegisterProperty(PropertyId::PaddingTop, PADDING_TOP, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::PaddingRight, PADDING_RIGHT, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::PaddingBottom, PADDING_BOTTOM, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::PaddingLeft, PADDING_LEFT, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterShorthand(ShorthandId::Padding, PADDING, "padding-top, padding-right, padding-bottom, padding-left", ShorthandType::Box);
-
-	RegisterProperty(PropertyId::BorderTopWidth, BORDER_TOP_WIDTH, "0px", false, true).AddParser("length");
-	RegisterProperty(PropertyId::BorderRightWidth, BORDER_RIGHT_WIDTH, "0px", false, true).AddParser("length");
-	RegisterProperty(PropertyId::BorderBottomWidth, BORDER_BOTTOM_WIDTH, "0px", false, true).AddParser("length");
-	RegisterProperty(PropertyId::BorderLeftWidth, BORDER_LEFT_WIDTH, "0px", false, true).AddParser("length");
-	RegisterShorthand(ShorthandId::BorderWidth, BORDER_WIDTH, "border-top-width, border-right-width, border-bottom-width, border-left-width", ShorthandType::Box);
-
-	RegisterProperty(PropertyId::BorderTopColor, BORDER_TOP_COLOR, "black", false, false).AddParser(COLOR);
-	RegisterProperty(PropertyId::BorderRightColor, BORDER_RIGHT_COLOR, "black", false, false).AddParser(COLOR);
-	RegisterProperty(PropertyId::BorderBottomColor, BORDER_BOTTOM_COLOR, "black", false, false).AddParser(COLOR);
-	RegisterProperty(PropertyId::BorderLeftColor, BORDER_LEFT_COLOR, "black", false, false).AddParser(COLOR);
-	RegisterShorthand(ShorthandId::BorderColor, BORDER_COLOR, "border-top-color, border-right-color, border-bottom-color, border-left-color", ShorthandType::Box);
-
-	RegisterShorthand(ShorthandId::BorderTop, BORDER_TOP, "border-top-width, border-top-color", ShorthandType::FallThrough);
-	RegisterShorthand(ShorthandId::BorderRight, BORDER_RIGHT, "border-right-width, border-right-color", ShorthandType::FallThrough);
-	RegisterShorthand(ShorthandId::BorderBottom, BORDER_BOTTOM, "border-bottom-width, border-bottom-color", ShorthandType::FallThrough);
-	RegisterShorthand(ShorthandId::BorderLeft, BORDER_LEFT, "border-left-width, border-left-color", ShorthandType::FallThrough);
-	RegisterShorthand(ShorthandId::Border, BORDER, "border-top, border-right, border-bottom, border-left", ShorthandType::RecursiveRepeat);
-
-	RegisterProperty(PropertyId::Display, DISPLAY, "inline", false, true).AddParser("keyword", "none, block, inline, inline-block");
-	RegisterProperty(PropertyId::Position, POSITION, "static", false, true).AddParser("keyword", "static, relative, absolute, fixed");
-	RegisterProperty(PropertyId::Top, TOP, "auto", false, false)
+	RegisterShorthand(ShorthandId::Margin, "margin", "margin-top, margin-right, margin-bottom, margin-left", ShorthandType::Box);
+
+	RegisterProperty(PropertyId::PaddingTop, "padding-top", "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
+	RegisterProperty(PropertyId::PaddingRight, "padding-right", "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
+	RegisterProperty(PropertyId::PaddingBottom, "padding-bottom", "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
+	RegisterProperty(PropertyId::PaddingLeft, "padding-left", "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
+	RegisterShorthand(ShorthandId::Padding, "padding", "padding-top, padding-right, padding-bottom, padding-left", ShorthandType::Box);
+
+	RegisterProperty(PropertyId::BorderTopWidth, "border-top-width", "0px", false, true).AddParser("length");
+	RegisterProperty(PropertyId::BorderRightWidth, "border-right-width", "0px", false, true).AddParser("length");
+	RegisterProperty(PropertyId::BorderBottomWidth, "border-bottom-width", "0px", false, true).AddParser("length");
+	RegisterProperty(PropertyId::BorderLeftWidth, "border-left-width", "0px", false, true).AddParser("length");
+	RegisterShorthand(ShorthandId::BorderWidth, "border-width", "border-top-width, border-right-width, border-bottom-width, border-left-width", ShorthandType::Box);
+
+	RegisterProperty(PropertyId::BorderTopColor, "border-top-color", "black", false, false).AddParser("color");
+	RegisterProperty(PropertyId::BorderRightColor, "border-right-color", "black", false, false).AddParser("color");
+	RegisterProperty(PropertyId::BorderBottomColor, "border-bottom-color", "black", false, false).AddParser("color");
+	RegisterProperty(PropertyId::BorderLeftColor, "border-left-color", "black", false, false).AddParser("color");
+	RegisterShorthand(ShorthandId::BorderColor, "border-color", "border-top-color, border-right-color, border-bottom-color, border-left-color", ShorthandType::Box);
+
+	RegisterShorthand(ShorthandId::BorderTop, "border-top", "border-top-width, border-top-color", ShorthandType::FallThrough);
+	RegisterShorthand(ShorthandId::BorderRight, "border-right", "border-right-width, border-right-color", ShorthandType::FallThrough);
+	RegisterShorthand(ShorthandId::BorderBottom, "border-bottom", "border-bottom-width, border-bottom-color", ShorthandType::FallThrough);
+	RegisterShorthand(ShorthandId::BorderLeft, "border-left", "border-left-width, border-left-color", ShorthandType::FallThrough);
+	RegisterShorthand(ShorthandId::Border, "border", "border-top, border-right, border-bottom, border-left", ShorthandType::RecursiveRepeat);
+
+	RegisterProperty(PropertyId::Display, "display", "inline", false, true).AddParser("keyword", "none, block, inline, inline-block");
+	RegisterProperty(PropertyId::Position, "position", "static", false, true).AddParser("keyword", "static, relative, absolute, fixed");
+	RegisterProperty(PropertyId::Top, "top", "auto", false, false)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
-	RegisterProperty(PropertyId::Right, RIGHT, "auto", false, false)
+	RegisterProperty(PropertyId::Right, "right", "auto", false, false)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::Bottom, BOTTOM, "auto", false, false)
+	RegisterProperty(PropertyId::Bottom, "bottom", "auto", false, false)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
-	RegisterProperty(PropertyId::Left, LEFT, "auto", false, false)
+	RegisterProperty(PropertyId::Left, "left", "auto", false, false)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 
 
-	RegisterProperty(PropertyId::Float, FLOAT, "none", false, true).AddParser("keyword", "none, left, right");
-	RegisterProperty(PropertyId::Clear, CLEAR, "none", false, true).AddParser("keyword", "none, left, right, both");
+	RegisterProperty(PropertyId::Float, "float", "none", false, true).AddParser("keyword", "none, left, right");
+	RegisterProperty(PropertyId::Clear, "clear", "none", false, true).AddParser("keyword", "none, left, right, both");
 
 
-	RegisterProperty(PropertyId::ZIndex, Z_INDEX, "auto", false, false)
+	RegisterProperty(PropertyId::ZIndex, "z-index", "auto", false, false)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("number");
 		.AddParser("number");
 
 
-	RegisterProperty(PropertyId::Width, WIDTH, "auto", false, true)
+	RegisterProperty(PropertyId::Width, "width", "auto", false, true)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::MinWidth, MIN_WIDTH, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
-	RegisterProperty(PropertyId::MaxWidth, MAX_WIDTH, "-1px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
+	RegisterProperty(PropertyId::MinWidth, "min-width", "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
+	RegisterProperty(PropertyId::MaxWidth, "max-width", "-1px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockWidth);
 
 
-	RegisterProperty(PropertyId::Height, HEIGHT, "auto", false, true)
+	RegisterProperty(PropertyId::Height, "height", "auto", false, true)
 		.AddParser("keyword", "auto")
 		.AddParser("keyword", "auto")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
-	RegisterProperty(PropertyId::MinHeight, MIN_HEIGHT, "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
-	RegisterProperty(PropertyId::MaxHeight, MAX_HEIGHT, "-1px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
+	RegisterProperty(PropertyId::MinHeight, "min-height", "0px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
+	RegisterProperty(PropertyId::MaxHeight, "max-height", "-1px", false, true).AddParser("length_percent").SetRelativeTarget(RelativeTarget::ContainingBlockHeight);
 
 
-	RegisterProperty(PropertyId::LineHeight, LINE_HEIGHT, "1.2", true, true).AddParser("number_length_percent").SetRelativeTarget(RelativeTarget::FontSize);
-	RegisterProperty(PropertyId::VerticalAlign, VERTICAL_ALIGN, "baseline", false, true)
+	RegisterProperty(PropertyId::LineHeight, "line-height", "1.2", true, true).AddParser("number_length_percent").SetRelativeTarget(RelativeTarget::FontSize);
+	RegisterProperty(PropertyId::VerticalAlign, "vertical-align", "baseline", false, true)
 		.AddParser("keyword", "baseline, middle, sub, super, text-top, text-bottom, top, bottom")
 		.AddParser("keyword", "baseline, middle, sub, super, text-top, text-bottom, top, bottom")
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::LineHeight);
 		.AddParser("length_percent").SetRelativeTarget(RelativeTarget::LineHeight);
 
 
-	RegisterProperty(PropertyId::OverflowX, OVERFLOW_X, "visible", false, true).AddParser("keyword", "visible, hidden, auto, scroll");
-	RegisterProperty(PropertyId::OverflowY, OVERFLOW_Y, "visible", false, true).AddParser("keyword", "visible, hidden, auto, scroll");
+	RegisterProperty(PropertyId::OverflowX, "overflow-x", "visible", false, true).AddParser("keyword", "visible, hidden, auto, scroll");
+	RegisterProperty(PropertyId::OverflowY, "overflow-y", "visible", false, true).AddParser("keyword", "visible, hidden, auto, scroll");
 	RegisterShorthand(ShorthandId::Overflow, "overflow", "overflow-x, overflow-y", ShorthandType::Replicate);
 	RegisterShorthand(ShorthandId::Overflow, "overflow", "overflow-x, overflow-y", ShorthandType::Replicate);
-	RegisterProperty(PropertyId::Clip, CLIP, "auto", true, false).AddParser("keyword", "auto, none").AddParser("number");
-	RegisterProperty(PropertyId::Visibility, VISIBILITY, "visible", false, false).AddParser("keyword", "visible, hidden");
+	RegisterProperty(PropertyId::Clip, "clip", "auto", true, false).AddParser("keyword", "auto, none").AddParser("number");
+	RegisterProperty(PropertyId::Visibility, "visibility", "visible", false, false).AddParser("keyword", "visible, hidden");
 
 
 	// Need some work on this if we are to include images.
 	// Need some work on this if we are to include images.
-	RegisterProperty(PropertyId::BackgroundColor, BACKGROUND_COLOR, "transparent", false, false).AddParser(COLOR);
-	RegisterShorthand(ShorthandId::Background, BACKGROUND, BACKGROUND_COLOR, ShorthandType::FallThrough);
+	RegisterProperty(PropertyId::BackgroundColor, "background-color", "transparent", false, false).AddParser("color");
+	RegisterShorthand(ShorthandId::Background, "background", "background-color", ShorthandType::FallThrough);
 
 
-	RegisterProperty(PropertyId::Color, COLOR, "white", true, false).AddParser(COLOR);
+	RegisterProperty(PropertyId::Color, "color", "white", true, false).AddParser("color");
 
 
-	RegisterProperty(PropertyId::ImageColor, IMAGE_COLOR, "white", false, false).AddParser(COLOR);
-	RegisterProperty(PropertyId::Opacity, OPACITY, "1", true, false).AddParser("number");
+	RegisterProperty(PropertyId::ImageColor, "image-color", "white", false, false).AddParser("color");
+	RegisterProperty(PropertyId::Opacity, "opacity", "1", true, false).AddParser("number");
 
 
-	RegisterProperty(PropertyId::FontFamily, FONT_FAMILY, "", true, true).AddParser("string");
-	RegisterProperty(PropertyId::FontStyle, FONT_STYLE, "normal", true, true).AddParser("keyword", "normal, italic");
-	RegisterProperty(PropertyId::FontWeight, FONT_WEIGHT, "normal", true, true).AddParser("keyword", "normal, bold");
-	RegisterProperty(PropertyId::FontSize, FONT_SIZE, "12px", true, true).AddParser("length").AddParser("length_percent").SetRelativeTarget(RelativeTarget::ParentFontSize);
-	RegisterShorthand(ShorthandId::Font, FONT, "font-style, font-weight, font-size, font-family", ShorthandType::FallThrough);
+	RegisterProperty(PropertyId::FontFamily, "font-family", "", true, true).AddParser("string");
+	RegisterProperty(PropertyId::FontStyle, "font-style", "normal", true, true).AddParser("keyword", "normal, italic");
+	RegisterProperty(PropertyId::FontWeight, "font-weight", "normal", true, true).AddParser("keyword", "normal, bold");
+	RegisterProperty(PropertyId::FontSize, "font-size", "12px", true, true).AddParser("length").AddParser("length_percent").SetRelativeTarget(RelativeTarget::ParentFontSize);
+	RegisterShorthand(ShorthandId::Font, "font", "font-style, font-weight, font-size, font-family", ShorthandType::FallThrough);
 
 
-	RegisterProperty(PropertyId::TextAlign, TEXT_ALIGN, LEFT, true, true).AddParser("keyword", "left, right, center, justify");
-	RegisterProperty(PropertyId::TextDecoration, TEXT_DECORATION, "none", true, false).AddParser("keyword", "none, underline, overline, line-through");
-	RegisterProperty(PropertyId::TextTransform, TEXT_TRANSFORM, "none", true, true).AddParser("keyword", "none, capitalize, uppercase, lowercase");
-	RegisterProperty(PropertyId::WhiteSpace, WHITE_SPACE, "normal", true, true).AddParser("keyword", "normal, pre, nowrap, pre-wrap, pre-line");
+	RegisterProperty(PropertyId::TextAlign, "text-align", "left", true, true).AddParser("keyword", "left, right, center, justify");
+	RegisterProperty(PropertyId::TextDecoration, "text-decoration", "none", true, false).AddParser("keyword", "none, underline, overline, line-through");
+	RegisterProperty(PropertyId::TextTransform, "text-transform", "none", true, true).AddParser("keyword", "none, capitalize, uppercase, lowercase");
+	RegisterProperty(PropertyId::WhiteSpace, "white-space", "normal", true, true).AddParser("keyword", "normal, pre, nowrap, pre-wrap, pre-line");
 
 
-	RegisterProperty(PropertyId::Cursor, CURSOR, "", true, false).AddParser("string");
+	RegisterProperty(PropertyId::Cursor, "cursor", "", true, false).AddParser("string");
 
 
 	// Functional property specifications.
 	// Functional property specifications.
-	RegisterProperty(PropertyId::Drag, DRAG, "none", false, false).AddParser("keyword", "none, drag, drag-drop, block, clone");
-	RegisterProperty(PropertyId::TabIndex, TAB_INDEX, "none", false, false).AddParser("keyword", "none, auto");
-	RegisterProperty(PropertyId::Focus, FOCUS, "auto", true, false).AddParser("keyword", "none, auto");
-	RegisterProperty(PropertyId::ScrollbarMargin, SCROLLBAR_MARGIN, "0", false, false).AddParser("length");
-	RegisterProperty(PropertyId::PointerEvents, POINTER_EVENTS, "auto", true, false).AddParser("keyword", "none, auto");
+	RegisterProperty(PropertyId::Drag, "drag", "none", false, false).AddParser("keyword", "none, drag, drag-drop, block, clone");
+	RegisterProperty(PropertyId::TabIndex, "tab-index", "none", false, false).AddParser("keyword", "none, auto");
+	RegisterProperty(PropertyId::Focus, "focus", "auto", true, false).AddParser("keyword", "none, auto");
+	RegisterProperty(PropertyId::ScrollbarMargin, "scrollbar-margin", "0", false, false).AddParser("length");
+	RegisterProperty(PropertyId::PointerEvents, "pointer-events", "auto", true, false).AddParser("keyword", "none, auto");
 
 
 	// Perspective and Transform specifications
 	// Perspective and Transform specifications
-	RegisterProperty(PropertyId::Perspective, PERSPECTIVE, "none", false, false).AddParser("keyword", "none").AddParser("length");
-	RegisterProperty(PropertyId::PerspectiveOriginX, PERSPECTIVE_ORIGIN_X, "50%", false, false).AddParser("keyword", "left, center, right").AddParser("length_percent");
-	RegisterProperty(PropertyId::PerspectiveOriginY, PERSPECTIVE_ORIGIN_Y, "50%", false, false).AddParser("keyword", "top, center, bottom").AddParser("length_percent");
-	RegisterShorthand(ShorthandId::PerspectiveOrigin, PERSPECTIVE_ORIGIN, "perspective-origin-x, perspective-origin-y", ShorthandType::FallThrough);
-	RegisterProperty(PropertyId::Transform, TRANSFORM, "none", false, false).AddParser(TRANSFORM);
-	RegisterProperty(PropertyId::TransformOriginX, TRANSFORM_ORIGIN_X, "50%", false, false).AddParser("keyword", "left, center, right").AddParser("length_percent");
-	RegisterProperty(PropertyId::TransformOriginY, TRANSFORM_ORIGIN_Y, "50%", false, false).AddParser("keyword", "top, center, bottom").AddParser("length_percent");
-	RegisterProperty(PropertyId::TransformOriginZ, TRANSFORM_ORIGIN_Z, "0", false, false).AddParser("length");
-	RegisterShorthand(ShorthandId::TransformOrigin, TRANSFORM_ORIGIN, "transform-origin-x, transform-origin-y, transform-origin-z", ShorthandType::FallThrough);
-
-	RegisterProperty(PropertyId::Transition, TRANSITION, "none", false, false).AddParser(TRANSITION);
-	RegisterProperty(PropertyId::Animation, ANIMATION, "none", false, false).AddParser(ANIMATION);
+	RegisterProperty(PropertyId::Perspective, "perspective", "none", false, false).AddParser("keyword", "none").AddParser("length");
+	RegisterProperty(PropertyId::PerspectiveOriginX, "perspective-origin-x", "50%", false, false).AddParser("keyword", "left, center, right").AddParser("length_percent");
+	RegisterProperty(PropertyId::PerspectiveOriginY, "perspective-origin-y", "50%", false, false).AddParser("keyword", "top, center, bottom").AddParser("length_percent");
+	RegisterShorthand(ShorthandId::PerspectiveOrigin, "perspective-origin", "perspective-origin-x, perspective-origin-y", ShorthandType::FallThrough);
+	RegisterProperty(PropertyId::Transform, "transform", "none", false, false).AddParser("transform");
+	RegisterProperty(PropertyId::TransformOriginX, "transform-origin-x", "50%", false, false).AddParser("keyword", "left, center, right").AddParser("length_percent");
+	RegisterProperty(PropertyId::TransformOriginY, "transform-origin-y", "50%", false, false).AddParser("keyword", "top, center, bottom").AddParser("length_percent");
+	RegisterProperty(PropertyId::TransformOriginZ, "transform-origin-z", "0", false, false).AddParser("length");
+	RegisterShorthand(ShorthandId::TransformOrigin, "transform-origin", "transform-origin-x, transform-origin-y, transform-origin-z", ShorthandType::FallThrough);
+
+	RegisterProperty(PropertyId::Transition, "transition", "none", false, false).AddParser("transition");
+	RegisterProperty(PropertyId::Animation, "animation", "none", false, false).AddParser("animation");
 
 
 	RegisterProperty(PropertyId::Decorator, "decorator", "", false, false).AddParser("string");
 	RegisterProperty(PropertyId::Decorator, "decorator", "", false, false).AddParser("string");
 	RegisterProperty(PropertyId::FontEffect, "font-effect", "", true, false).AddParser("string");
 	RegisterProperty(PropertyId::FontEffect, "font-effect", "", true, false).AddParser("string");
 
 
 	// Rare properties (not added to computed values)
 	// Rare properties (not added to computed values)
-	RegisterProperty(PropertyId::FillImage, FILL_IMAGE, "", false, false).AddParser("string");
+	RegisterProperty(PropertyId::FillImage, "fill-image", "", false, false).AddParser("string");
 
 
 	instance->properties.property_map->AssertAllInserted(PropertyId::NumDefinedIds);
 	instance->properties.property_map->AssertAllInserted(PropertyId::NumDefinedIds);
 	instance->properties.shorthand_map->AssertAllInserted(ShorthandId::NumDefinedIds);
 	instance->properties.shorthand_map->AssertAllInserted(ShorthandId::NumDefinedIds);

+ 1 - 2
Source/Core/Transform.cpp

@@ -26,7 +26,6 @@
  *
  *
  */
  */
 
 
-#include "StringCache.h"
 #include "../../Include/RmlUi/Core/StyleSheetSpecification.h"
 #include "../../Include/RmlUi/Core/StyleSheetSpecification.h"
 #include "../../Include/RmlUi/Core/TransformPrimitive.h"
 #include "../../Include/RmlUi/Core/TransformPrimitive.h"
 #include "../../Include/RmlUi/Core/Property.h"
 #include "../../Include/RmlUi/Core/Property.h"
@@ -49,7 +48,7 @@ Transform::Transform(std::vector<Transforms::Primitive> primitives)
 Property Transform::MakeProperty(std::vector<Transforms::Primitive> primitives)
 Property Transform::MakeProperty(std::vector<Transforms::Primitive> primitives)
 {
 {
 	Property p{ TransformPtr{new Transform{primitives}}, Property::TRANSFORM };
 	Property p{ TransformPtr{new Transform{primitives}}, Property::TRANSFORM };
-	p.definition = StyleSheetSpecification::GetProperty(TRANSFORM);
+	p.definition = StyleSheetSpecification::GetProperty(PropertyId::Transform);
 	return p;
 	return p;
 }
 }
 
 

+ 0 - 1
Source/Core/precompiled.h

@@ -30,6 +30,5 @@
 #define RMLUICOREPRECOMPILED_H
 #define RMLUICOREPRECOMPILED_H
 
 
 #include "../../Include/RmlUi/Core.h"
 #include "../../Include/RmlUi/Core.h"
-#include "StringCache.h"
 
 
 #endif
 #endif