| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/CSSPropertyAPIPaintStroke.h" | 5 #include "core/css/properties/CSSPropertyAPIPaintStroke.h" |
| 6 | 6 |
| 7 #include "core/css/CSSURIValue.h" | 7 #include "core/css/CSSURIValue.h" |
| 8 #include "core/css/CSSValue.h" | 8 #include "core/css/CSSValue.h" |
| 9 #include "core/css/CSSValueList.h" | 9 #include "core/css/CSSValueList.h" |
| 10 #include "core/css/parser/CSSParserContext.h" | 10 #include "core/css/parser/CSSParserContext.h" |
| 11 #include "core/css/parser/CSSPropertyParserHelpers.h" | 11 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 const CSSValue* CSSPropertyAPIPaintStroke::parseSingleValue( | 15 const CSSValue* CSSPropertyAPIPaintStroke::parseSingleValue( |
| 16 CSSParserTokenRange& range, | 16 CSSParserTokenRange& range, |
| 17 const CSSParserContext& context) { | 17 const CSSParserContext* context) { |
| 18 if (range.peek().id() == CSSValueNone) | 18 if (range.peek().id() == CSSValueNone) |
| 19 return CSSPropertyParserHelpers::consumeIdent(range); | 19 return CSSPropertyParserHelpers::consumeIdent(range); |
| 20 CSSURIValue* url = CSSPropertyParserHelpers::consumeUrl(range, &context); | 20 CSSURIValue* url = CSSPropertyParserHelpers::consumeUrl(range, context); |
| 21 if (url) { | 21 if (url) { |
| 22 CSSValue* parsedValue = nullptr; | 22 CSSValue* parsedValue = nullptr; |
| 23 if (range.peek().id() == CSSValueNone) { | 23 if (range.peek().id() == CSSValueNone) { |
| 24 parsedValue = CSSPropertyParserHelpers::consumeIdent(range); | 24 parsedValue = CSSPropertyParserHelpers::consumeIdent(range); |
| 25 } else { | 25 } else { |
| 26 parsedValue = | 26 parsedValue = |
| 27 CSSPropertyParserHelpers::consumeColor(range, context.mode()); | 27 CSSPropertyParserHelpers::consumeColor(range, context->mode()); |
| 28 } | 28 } |
| 29 if (parsedValue) { | 29 if (parsedValue) { |
| 30 CSSValueList* values = CSSValueList::createSpaceSeparated(); | 30 CSSValueList* values = CSSValueList::createSpaceSeparated(); |
| 31 values->append(*url); | 31 values->append(*url); |
| 32 values->append(*parsedValue); | 32 values->append(*parsedValue); |
| 33 return values; | 33 return values; |
| 34 } | 34 } |
| 35 return url; | 35 return url; |
| 36 } | 36 } |
| 37 return CSSPropertyParserHelpers::consumeColor(range, context.mode()); | 37 return CSSPropertyParserHelpers::consumeColor(range, context->mode()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace blink | 40 } // namespace blink |
| OLD | NEW |