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

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

Issue 1386733003: Do not accept CSS-wide keywords for descriptors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V7 Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/CSSPropertyParser.h" 5 #include "core/css/parser/CSSPropertyParser.h"
6 6
7 #include "core/StylePropertyShorthand.h" 7 #include "core/StylePropertyShorthand.h"
8 #include "core/css/CSSBasicShapeValues.h" 8 #include "core/css/CSSBasicShapeValues.h"
9 #include "core/css/CSSBorderImage.h" 9 #include "core/css/CSSBorderImage.h"
10 #include "core/css/CSSContentDistributionValue.h" 10 #include "core/css/CSSContentDistributionValue.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 value = cssValuePool().createExplicitInitialValue(); 298 value = cssValuePool().createExplicitInitialValue();
299 else if (id == CSSValueInherit) 299 else if (id == CSSValueInherit)
300 value = cssValuePool().createInheritedValue(); 300 value = cssValuePool().createInheritedValue();
301 else if (id == CSSValueUnset) 301 else if (id == CSSValueUnset)
302 value = cssValuePool().createUnsetValue(); 302 value = cssValuePool().createUnsetValue();
303 else 303 else
304 return false; 304 return false;
305 305
306 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); 306 CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
307 const StylePropertyShorthand& shorthand = shorthandForProperty(property); 307 const StylePropertyShorthand& shorthand = shorthandForProperty(property);
308 if (!shorthand.length()) 308 if (!shorthand.length()) {
309 if (CSSPropertyMetadata::isDescriptor(property))
Timothy Loh 2016/05/19 05:44:42 I think it's better to be at the very top of parse
rwlbuis 2016/05/20 00:51:11 Same as before, done for efficiency, can move if y
310 return false;
309 addProperty(property, CSSPropertyInvalid, value, important); 311 addProperty(property, CSSPropertyInvalid, value, important);
310 else 312 } else {
311 addExpandedPropertyForValue(property, value, important); 313 addExpandedPropertyForValue(property, value, important);
314 }
312 m_range = rangeCopy; 315 m_range = rangeCopy;
313 return true; 316 return true;
314 } 317 }
315 318
316 static CSSValueList* consumeTransformOrigin(CSSParserTokenRange& range, CSSParse rMode cssParserMode, UnitlessQuirk unitless) 319 static CSSValueList* consumeTransformOrigin(CSSParserTokenRange& range, CSSParse rMode cssParserMode, UnitlessQuirk unitless)
317 { 320 {
318 CSSValue* resultX = nullptr; 321 CSSValue* resultX = nullptr;
319 CSSValue* resultY = nullptr; 322 CSSValue* resultY = nullptr;
320 if (consumeOneOrTwoValuedPosition(range, cssParserMode, unitless, resultX, r esultY)) { 323 if (consumeOneOrTwoValuedPosition(range, cssParserMode, unitless, resultX, r esultY)) {
321 CSSValueList* list = CSSValueList::createSpaceSeparated(); 324 CSSValueList* list = CSSValueList::createSpaceSeparated();
(...skipping 4709 matching lines...) Expand 10 before | Expand all | Expand 10 after
5031 case CSSPropertyGridTemplate: 5034 case CSSPropertyGridTemplate:
5032 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); 5035 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
5033 case CSSPropertyGrid: 5036 case CSSPropertyGrid:
5034 return consumeGridShorthand(important); 5037 return consumeGridShorthand(important);
5035 default: 5038 default:
5036 return false; 5039 return false;
5037 } 5040 }
5038 } 5041 }
5039 5042
5040 } // namespace blink 5043 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698