Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp

Issue 2007823002: Fix whitespace handling in parseSimpleTransformList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: only transform tests for now. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698