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

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

Issue 1636453002: Use ASCII case-insensitive matching for ident-likes in the CSS parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Consistent indentation in test. Created 4 years, 11 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 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "core/css/CSSValuePool.h" 48 #include "core/css/CSSValuePool.h"
49 #include "core/css/CSSVariableReferenceValue.h" 49 #include "core/css/CSSVariableReferenceValue.h"
50 #include "core/css/parser/CSSParserFastPaths.h" 50 #include "core/css/parser/CSSParserFastPaths.h"
51 #include "core/css/parser/CSSParserValues.h" 51 #include "core/css/parser/CSSParserValues.h"
52 #include "core/frame/UseCounter.h" 52 #include "core/frame/UseCounter.h"
53 #include "core/style/GridCoordinate.h" 53 #include "core/style/GridCoordinate.h"
54 #include "platform/RuntimeEnabledFeatures.h" 54 #include "platform/RuntimeEnabledFeatures.h"
55 55
56 namespace blink { 56 namespace blink {
57 57
58 template <unsigned N>
59 static bool equalIgnoringCase(const CSSParserString& a, const char (&b)[N])
60 {
61 unsigned length = N - 1; // Ignore the trailing null character
62 if (a.length() != length)
63 return false;
64
65 return a.is8Bit() ? WTF::equalIgnoringCase(b, a.characters8(), length) : WTF ::equalIgnoringCase(b, a.characters16(), length);
66 }
67
68 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr <CSSValue> value, bool important, bool implicit) 58 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr <CSSValue> value, bool important, bool implicit)
69 { 59 {
70 ASSERT(!isPropertyAlias(propId)); 60 ASSERT(!isPropertyAlias(propId));
71 61
72 int shorthandIndex = 0; 62 int shorthandIndex = 0;
73 bool setFromShorthand = false; 63 bool setFromShorthand = false;
74 64
75 if (m_currentShorthand) { 65 if (m_currentShorthand) {
76 Vector<StylePropertyShorthand, 4> shorthands; 66 Vector<StylePropertyShorthand, 4> shorthands;
77 getMatchingShorthandsForLonghand(propId, &shorthands); 67 getMatchingShorthandsForLonghand(propId, &shorthands);
(...skipping 4137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4215 ASSERT(!m_parsedCalculation); 4205 ASSERT(!m_parsedCalculation);
4216 m_parsedCalculation = CSSCalcValue::create(args, range); 4206 m_parsedCalculation = CSSCalcValue::create(args, range);
4217 4207
4218 if (!m_parsedCalculation) 4208 if (!m_parsedCalculation)
4219 return false; 4209 return false;
4220 4210
4221 return true; 4211 return true;
4222 } 4212 }
4223 4213
4224 } // namespace blink 4214 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698