Browse Source

Allow empty values in decorators and font-effects

Michael Ragazzon 3 years ago
parent
commit
3e0e972ccb

+ 3 - 1
Source/Core/PropertyParserDecorator.cpp

@@ -100,7 +100,9 @@ bool PropertyParserDecorator::ParseValue(Property& property, const String& decor
 			PropertyDictionary properties;
 			if (!specification.ParsePropertyDeclaration(properties, "decorator", shorthand))
 			{
-				return false;
+				// Empty values are allowed in decorators, if the value is not empty we must have encountered a parser error.
+				if (!StringUtilities::StripWhitespace(shorthand).empty())
+					return false;
 			}
 
 			// Set unspecified values to their defaults

+ 6 - 2
Source/Core/PropertyParserFontEffect.cpp

@@ -101,8 +101,12 @@ bool PropertyParserFontEffect::ParseValue(Property& property, const String& font
 			PropertyDictionary properties;
 			if (!specification.ParsePropertyDeclaration(properties, "font-effect", shorthand))
 			{
-				Log::Message(Log::LT_WARNING, "Could not parse font-effect value '%s'.", font_effect_string.c_str());
-				return false;
+				// Empty values are allowed in font-effects, if the value is not empty we must have encountered a parser error.
+				if (!StringUtilities::StripWhitespace(shorthand).empty())
+				{
+					Log::Message(Log::LT_WARNING, "Could not parse font-effect value '%s'.", font_effect_string.c_str());
+					return false;
+				}
 			}
 
 			// Set unspecified values to their defaults