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

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: rebase 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/CSSPropertyParserHelpers.h"
10
11 namespace blink {
12
13 const CSSValue* CSSPropertyAPIWebkitTextEmphasisStyle::parseSingleValue(
14 CSSParserTokenRange& range,
15 const CSSParserContext* context) {
16 CSSValueID id = range.peek().id();
17 if (id == CSSValueNone)
18 return CSSPropertyParserHelpers::consumeIdent(range);
19
20 if (CSSValue* textEmphasisStyle =
21 CSSPropertyParserHelpers::consumeString(range))
22 return textEmphasisStyle;
23
24 CSSIdentifierValue* fill =
25 CSSPropertyParserHelpers::consumeIdent<CSSValueFilled, CSSValueOpen>(
26 range);
27 CSSIdentifierValue* shape =
28 CSSPropertyParserHelpers::consumeIdent<CSSValueDot, CSSValueCircle,
29 CSSValueDoubleCircle,
30 CSSValueTriangle, CSSValueSesame>(
31 range);
32 if (!fill) {
33 fill = CSSPropertyParserHelpers::consumeIdent<CSSValueFilled, CSSValueOpen>(
34 range);
35 }
36 if (fill && shape) {
37 CSSValueList* parsedValues = CSSValueList::createSpaceSeparated();
38 parsedValues->append(*fill);
39 parsedValues->append(*shape);
40 return parsedValues;
41 }
42 if (fill)
43 return fill;
44 if (shape)
45 return shape;
46 return nullptr;
47 }
48
49 } // 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