OLD | NEW |
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 DCHECK(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); | 17 DCHECK(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled()); |
18 CSSValue* translate = CSSPropertyParserHelpers::consumeLengthOrPercent( | 18 CSSValue* translate = CSSPropertyParserHelpers::consumeLengthOrPercent( |
19 range, context.mode(), ValueRangeAll); | 19 range, context->mode(), ValueRangeAll); |
20 if (!translate) | 20 if (!translate) |
21 return nullptr; | 21 return nullptr; |
22 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 22 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
23 list->append(*translate); | 23 list->append(*translate); |
24 translate = CSSPropertyParserHelpers::consumeLengthOrPercent( | 24 translate = CSSPropertyParserHelpers::consumeLengthOrPercent( |
25 range, context.mode(), ValueRangeAll); | 25 range, context->mode(), ValueRangeAll); |
26 if (translate) { | 26 if (translate) { |
27 list->append(*translate); | 27 list->append(*translate); |
28 translate = CSSPropertyParserHelpers::consumeLength(range, context.mode(), | 28 translate = CSSPropertyParserHelpers::consumeLength(range, context->mode(), |
29 ValueRangeAll); | 29 ValueRangeAll); |
30 if (translate) | 30 if (translate) |
31 list->append(*translate); | 31 list->append(*translate); |
32 } | 32 } |
33 | 33 |
34 return list; | 34 return list; |
35 } | 35 } |
36 | 36 |
37 } // namespace blink | 37 } // namespace blink |
OLD | NEW |