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

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

Issue 2609933005: Implements CSSPropertyAPI for the webkit-text-emphasis-style property. (Closed)
Patch Set: fixed dependencies, changed year Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698