| Index: Source/core/css/CSSParser-in.cpp
|
| diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp
|
| index ab2aea348938621f9d980ae5c2d7468010563aa0..482a427e7f225d9ca0e1b7a74ab25af10abcf7e0 100644
|
| --- a/Source/core/css/CSSParser-in.cpp
|
| +++ b/Source/core/css/CSSParser-in.cpp
|
| @@ -79,6 +79,7 @@
|
| #include "core/html/parser/HTMLParserIdioms.h"
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| #include "core/page/PageConsole.h"
|
| +#include "core/page/RuntimeCSSEnabled.h"
|
| #include "core/page/Settings.h"
|
| #include "core/rendering/RenderTheme.h"
|
| #include "core/svg/SVGParserUtilities.h"
|
| @@ -10219,6 +10220,31 @@ CSSPropertyID cssPropertyID(const CSSParserString& string)
|
| return string.is8Bit() ? cssPropertyID(string.characters8(), length) : cssPropertyID(string.characters16(), length);
|
| }
|
|
|
| +CSSPropertyID camelCaseCSSPropertyNameToID(StringImpl* propertyName)
|
| +{
|
| + typedef HashMap<StringImpl*, CSSPropertyID> CSSPropertyIDMap;
|
| + DEFINE_STATIC_LOCAL(CSSPropertyIDMap, map, ());
|
| +
|
| + CSSPropertyID id = map.get(propertyName);
|
| +
|
| + if (!id) {
|
| + StringBuilder builder;
|
| + size_t position = 0;
|
| + size_t end;
|
| + while ((end = propertyName->find(isASCIIUpper, position)) != kNotFound) {
|
| + builder.append(propertyName->substring(position, end) + "-" + toASCIILower((*propertyName)[end]));
|
| + position = end + 1;
|
| + }
|
| + builder.append(propertyName->substring(position));
|
| + // Doesn't handle prefixed properties.
|
| + id = cssPropertyID(builder.toString());
|
| + if (id != CSSPropertyInvalid && RuntimeCSSEnabled::isCSSPropertyEnabled(id))
|
| + map.add(propertyName, id);
|
| + }
|
| +
|
| + return id;
|
| +}
|
| +
|
| template <typename CharacterType>
|
| static CSSValueID cssValueKeywordID(const CharacterType* valueKeyword, unsigned length)
|
| {
|
|
|