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

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

Issue 1920583002: NOT FOR LANDING: Hack up CSSParser for speed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing consts. Created 4 years, 8 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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 if (pos < end) { 1000 if (pos < end) {
1001 if (isCSSSpace(*pos)) 1001 if (isCSSSpace(*pos))
1002 return nullptr; 1002 return nullptr;
1003 } 1003 }
1004 } 1004 }
1005 return transformList; 1005 return transformList;
1006 } 1006 }
1007 1007
1008 static CSSValue* parseSimpleTransform(CSSPropertyID propertyID, const String& st ring) 1008 static CSSValue* parseSimpleTransform(CSSPropertyID propertyID, const String& st ring)
1009 { 1009 {
1010 // XXX
1011 return nullptr;
1010 ASSERT(!string.isEmpty()); 1012 ASSERT(!string.isEmpty());
1011
1012 if (propertyID != CSSPropertyTransform) 1013 if (propertyID != CSSPropertyTransform)
1013 return nullptr; 1014 return nullptr;
1014 if (string.is8Bit()) { 1015 if (string.is8Bit()) {
1015 const LChar* pos = string.characters8(); 1016 const LChar* pos = string.characters8();
1016 const LChar* end = pos + string.length(); 1017 const LChar* end = pos + string.length();
1017 return parseSimpleTransformList(pos, end); 1018 return parseSimpleTransformList(pos, end);
1018 } 1019 }
1019 const UChar* pos = string.characters16(); 1020 const UChar* pos = string.characters16();
1020 const UChar* end = pos + string.length(); 1021 const UChar* end = pos + string.length();
1021 return parseSimpleTransformList(pos, end); 1022 return parseSimpleTransformList(pos, end);
1022 } 1023 }
1023 1024
1024 CSSValue* CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const St ring& string, CSSParserMode parserMode) 1025 CSSValue* CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const St ring& string, CSSParserMode parserMode)
1025 { 1026 {
1026 if (CSSValue* length = parseSimpleLengthValue(propertyID, string, parserMode )) 1027 if (CSSValue* length = parseSimpleLengthValue(propertyID, string, parserMode ))
1027 return length; 1028 return length;
1028 if (isColorPropertyID(propertyID)) 1029 if (isColorPropertyID(propertyID))
1029 return parseColor(string, parserMode); 1030 return parseColor(string, parserMode);
1030 if (CSSValue* keyword = parseKeywordValue(propertyID, string, parserMode)) 1031 if (CSSValue* keyword = parseKeywordValue(propertyID, string, parserMode))
1031 return keyword; 1032 return keyword;
1032 if (CSSValue* transform = parseSimpleTransform(propertyID, string)) 1033 if (CSSValue* transform = parseSimpleTransform(propertyID, string))
1033 return transform; 1034 return transform;
1034 return nullptr; 1035 return nullptr;
1035 } 1036 }
1036 1037
1037 } // namespace blink 1038 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698