| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SKY_ENGINE_CORE_ANIMATION_ANIMATIONHELPERS_H_ | |
| 6 #define SKY_ENGINE_CORE_ANIMATION_ANIMATIONHELPERS_H_ | |
| 7 | |
| 8 #include "sky/engine/core/css/parser/BisonCSSParser.h" | |
| 9 #include "sky/engine/wtf/text/StringBuilder.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 static inline CSSPropertyID camelCaseCSSPropertyNameToID(const String& propertyN
ame) | |
| 14 { | |
| 15 if (propertyName.find('-') != kNotFound) | |
| 16 return CSSPropertyInvalid; | |
| 17 | |
| 18 StringBuilder builder; | |
| 19 size_t position = 0; | |
| 20 size_t end; | |
| 21 while ((end = propertyName.find(isASCIIUpper, position)) != kNotFound) { | |
| 22 builder.append(propertyName.substring(position, end - position) + "-" +
toASCIILower((propertyName)[end])); | |
| 23 position = end + 1; | |
| 24 } | |
| 25 builder.append(propertyName.substring(position)); | |
| 26 // Doesn't handle prefixed properties. | |
| 27 CSSPropertyID id = cssPropertyID(builder.toString()); | |
| 28 return id; | |
| 29 } | |
| 30 | |
| 31 } // namespace blink | |
| 32 | |
| 33 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATIONHELPERS_H_ | |
| OLD | NEW |