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/CSSPropertyAPIShapeOutside.h" | 5 #include "core/css/properties/CSSPropertyAPIShapeOutside.h" |
6 | 6 |
7 #include "core/css/CSSValueList.h" | 7 #include "core/css/CSSValueList.h" |
8 #include "core/css/parser/CSSParserContext.h" | 8 #include "core/css/parser/CSSParserContext.h" |
9 #include "core/css/parser/CSSPropertyParserHelpers.h" | 9 #include "core/css/parser/CSSPropertyParserHelpers.h" |
10 #include "core/css/properties/CSSPropertyShapeUtils.h" | 10 #include "core/css/properties/CSSPropertyShapeUtils.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 using namespace CSSPropertyParserHelpers; | 14 using namespace CSSPropertyParserHelpers; |
15 | 15 |
16 const CSSValue* CSSPropertyAPIShapeOutside::parseSingleValue( | 16 const CSSValue* CSSPropertyAPIShapeOutside::parseSingleValue( |
17 CSSParserTokenRange& range, | 17 CSSParserTokenRange& range, |
18 const CSSParserContext* context) { | 18 const CSSParserContext& context) { |
19 if (CSSValue* imageValue = consumeImageOrNone(range, context)) | 19 if (CSSValue* imageValue = consumeImageOrNone(range, &context)) |
20 return imageValue; | 20 return imageValue; |
21 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 21 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
22 if (CSSValue* boxValue = consumeShapeBox(range)) | 22 if (CSSValue* boxValue = consumeShapeBox(range)) |
23 list->append(*boxValue); | 23 list->append(*boxValue); |
24 if (CSSValue* shapeValue = | 24 if (CSSValue* shapeValue = |
25 CSSPropertyShapeUtils::consumeBasicShape(range, context)) { | 25 CSSPropertyShapeUtils::consumeBasicShape(range, &context)) { |
26 list->append(*shapeValue); | 26 list->append(*shapeValue); |
27 if (list->length() < 2) { | 27 if (list->length() < 2) { |
28 if (CSSValue* boxValue = consumeShapeBox(range)) | 28 if (CSSValue* boxValue = consumeShapeBox(range)) |
29 list->append(*boxValue); | 29 list->append(*boxValue); |
30 } | 30 } |
31 } | 31 } |
32 if (!list->length()) | 32 if (!list->length()) |
33 return nullptr; | 33 return nullptr; |
34 return list; | 34 return list; |
35 } | 35 } |
36 | 36 |
37 } // namespace blink | 37 } // namespace blink |
OLD | NEW |