OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/css/properties/CSSPropertyAPIWebkitTextEmphasisStyle.h" | |
6 | |
7 #include "core/css/CSSStringValue.h" | |
8 #include "core/css/CSSValueList.h" | |
9 #include "core/css/parser/CSSParserTokenRange.h" | |
Bugs Nash
2017/01/05 22:57:59
can be forward declared instead of included
| |
10 #include "core/css/parser/CSSPropertyParserHelpers.h" | |
11 | |
12 namespace blink { | |
13 | |
14 const CSSValue* CSSPropertyAPIWebkitTextEmphasisStyle::parseSingleValue( | |
15 CSSParserTokenRange& range, | |
16 const CSSParserContext& context) { | |
17 CSSValueID id = range.peek().id(); | |
18 if (id == CSSValueNone) | |
19 return CSSPropertyParserHelpers::consumeIdent(range); | |
20 | |
21 if (CSSValue* textEmphasisStyle = | |
22 CSSPropertyParserHelpers::consumeString(range)) | |
23 return textEmphasisStyle; | |
24 | |
25 CSSIdentifierValue* fill = | |
26 CSSPropertyParserHelpers::consumeIdent<CSSValueFilled, CSSValueOpen>( | |
27 range); | |
28 CSSIdentifierValue* shape = | |
29 CSSPropertyParserHelpers::consumeIdent<CSSValueDot, CSSValueCircle, | |
30 CSSValueDoubleCircle, | |
31 CSSValueTriangle, CSSValueSesame>( | |
32 range); | |
33 if (!fill) { | |
34 fill = CSSPropertyParserHelpers::consumeIdent<CSSValueFilled, CSSValueOpen>( | |
35 range); | |
36 } | |
37 if (fill && shape) { | |
38 CSSValueList* parsedValues = CSSValueList::createSpaceSeparated(); | |
39 parsedValues->append(*fill); | |
40 parsedValues->append(*shape); | |
41 return parsedValues; | |
42 } | |
43 if (fill) | |
44 return fill; | |
45 if (shape) | |
46 return shape; | |
47 return nullptr; | |
48 } | |
49 | |
50 } // namespace blink | |
OLD | NEW |