| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/parser/CSSParserFastPaths.h" | 5 #include "core/css/parser/CSSParserFastPaths.h" |
| 6 | 6 |
| 7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
| 8 #include "core/css/CSSFunctionValue.h" | 8 #include "core/css/CSSFunctionValue.h" |
| 9 #include "core/css/CSSValuePool.h" | 9 #include "core/css/CSSValuePool.h" |
| 10 #include "core/css/parser/CSSParserIdioms.h" | 10 #include "core/css/parser/CSSParserIdioms.h" |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 return nullptr; | 986 return nullptr; |
| 987 } | 987 } |
| 988 | 988 |
| 989 template <typename CharType> | 989 template <typename CharType> |
| 990 static CSSValueList* parseSimpleTransformList(CharType*& pos, CharType* end) | 990 static CSSValueList* parseSimpleTransformList(CharType*& pos, CharType* end) |
| 991 { | 991 { |
| 992 CSSValueList* transformList = nullptr; | 992 CSSValueList* transformList = nullptr; |
| 993 while (pos < end) { | 993 while (pos < end) { |
| 994 while (pos < end && isCSSSpace(*pos)) | 994 while (pos < end && isCSSSpace(*pos)) |
| 995 ++pos; | 995 ++pos; |
| 996 if (pos >= end) |
| 997 break; |
| 996 CSSFunctionValue* transformValue = parseSimpleTransformValue(pos, end); | 998 CSSFunctionValue* transformValue = parseSimpleTransformValue(pos, end); |
| 997 if (!transformValue) | 999 if (!transformValue) |
| 998 return nullptr; | 1000 return nullptr; |
| 999 if (!transformList) | 1001 if (!transformList) |
| 1000 transformList = CSSValueList::createSpaceSeparated(); | 1002 transformList = CSSValueList::createSpaceSeparated(); |
| 1001 transformList->append(transformValue); | 1003 transformList->append(transformValue); |
| 1002 if (pos < end) { | |
| 1003 if (isCSSSpace(*pos)) | |
| 1004 return nullptr; | |
| 1005 } | |
| 1006 } | 1004 } |
| 1007 return transformList; | 1005 return transformList; |
| 1008 } | 1006 } |
| 1009 | 1007 |
| 1010 static CSSValue* parseSimpleTransform(CSSPropertyID propertyID, const String& st
ring) | 1008 static CSSValue* parseSimpleTransform(CSSPropertyID propertyID, const String& st
ring) |
| 1011 { | 1009 { |
| 1012 ASSERT(!string.isEmpty()); | 1010 ASSERT(!string.isEmpty()); |
| 1013 | 1011 |
| 1014 if (propertyID != CSSPropertyTransform) | 1012 if (propertyID != CSSPropertyTransform) |
| 1015 return nullptr; | 1013 return nullptr; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1030 if (isColorPropertyID(propertyID)) | 1028 if (isColorPropertyID(propertyID)) |
| 1031 return parseColor(string, parserMode); | 1029 return parseColor(string, parserMode); |
| 1032 if (CSSValue* keyword = parseKeywordValue(propertyID, string, parserMode)) | 1030 if (CSSValue* keyword = parseKeywordValue(propertyID, string, parserMode)) |
| 1033 return keyword; | 1031 return keyword; |
| 1034 if (CSSValue* transform = parseSimpleTransform(propertyID, string)) | 1032 if (CSSValue* transform = parseSimpleTransform(propertyID, string)) |
| 1035 return transform; | 1033 return transform; |
| 1036 return nullptr; | 1034 return nullptr; |
| 1037 } | 1035 } |
| 1038 | 1036 |
| 1039 } // namespace blink | 1037 } // namespace blink |
| OLD | NEW |