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

Side by Side Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAPITranslate.cpp

Issue 2808383008: Added unresolved property argument to ParseSingleValue method (Closed)
Patch Set: Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/properties/CSSPropertyAPITranslate.h" 5 #include "core/css/properties/CSSPropertyAPITranslate.h"
6 6
7 #include "core/css/CSSValueList.h" 7 #include "core/css/CSSValueList.h"
8 #include "core/css/parser/CSSParserTokenRange.h" 8 #include "core/css/parser/CSSParserTokenRange.h"
9 #include "core/css/parser/CSSPropertyParser.h" 9 #include "core/css/parser/CSSPropertyParser.h"
10 #include "core/css/parser/CSSPropertyParserHelpers.h" 10 #include "core/css/parser/CSSPropertyParserHelpers.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 const CSSValue* CSSPropertyAPITranslate::parseSingleValue( 14 const CSSValue* CSSPropertyAPITranslate::parseSingleValue(
15 CSSParserTokenRange& range, 15 CSSParserTokenRange& range,
16 const CSSParserContext& context) { 16 const CSSParserContext& context,
17 CSSPropertyID) {
17 DCHECK(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); 18 DCHECK(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
18 CSSValueID id = range.Peek().Id(); 19 CSSValueID id = range.Peek().Id();
19 if (id == CSSValueNone) 20 if (id == CSSValueNone)
20 return CSSPropertyParserHelpers::ConsumeIdent(range); 21 return CSSPropertyParserHelpers::ConsumeIdent(range);
21 22
22 CSSValue* translate = CSSPropertyParserHelpers::ConsumeLengthOrPercent( 23 CSSValue* translate = CSSPropertyParserHelpers::ConsumeLengthOrPercent(
23 range, context.Mode(), kValueRangeAll); 24 range, context.Mode(), kValueRangeAll);
24 if (!translate) 25 if (!translate)
25 return nullptr; 26 return nullptr;
26 CSSValueList* list = CSSValueList::CreateSpaceSeparated(); 27 CSSValueList* list = CSSValueList::CreateSpaceSeparated();
27 list->Append(*translate); 28 list->Append(*translate);
28 translate = CSSPropertyParserHelpers::ConsumeLengthOrPercent( 29 translate = CSSPropertyParserHelpers::ConsumeLengthOrPercent(
29 range, context.Mode(), kValueRangeAll); 30 range, context.Mode(), kValueRangeAll);
30 if (translate) { 31 if (translate) {
31 list->Append(*translate); 32 list->Append(*translate);
32 translate = CSSPropertyParserHelpers::ConsumeLength(range, context.Mode(), 33 translate = CSSPropertyParserHelpers::ConsumeLength(range, context.Mode(),
33 kValueRangeAll); 34 kValueRangeAll);
34 if (translate) 35 if (translate)
35 list->Append(*translate); 36 list->Append(*translate);
36 } 37 }
37 38
38 return list; 39 return list;
39 } 40 }
40 41
41 } // namespace blink 42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698