Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitTextEmphasisStyle.cpp |
| diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitTextEmphasisStyle.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitTextEmphasisStyle.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..771fbc73418e730efd03369d1cecab26295c71c0 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitTextEmphasisStyle.cpp |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/css/properties/CSSPropertyAPIWebkitTextEmphasisStyle.h" |
| + |
| +#include "core/css/CSSStringValue.h" |
|
sashab
2017/01/06 05:30:27
Ohh I just saw your comment to bugsnash@, otherwis
|
| +#include "core/css/CSSValueList.h" |
|
sashab
2017/01/06 05:30:27
+CSSIdentifierValue
|
| +#include "core/css/parser/CSSPropertyParserHelpers.h" |
| + |
| +namespace blink { |
| + |
| +const CSSValue* CSSPropertyAPIWebkitTextEmphasisStyle::parseSingleValue( |
| + CSSParserTokenRange& range, |
| + const CSSParserContext& context) { |
| + CSSValueID id = range.peek().id(); |
| + if (id == CSSValueNone) |
| + return CSSPropertyParserHelpers::consumeIdent(range); |
| + |
| + if (CSSValue* textEmphasisStyle = |
| + CSSPropertyParserHelpers::consumeString(range)) |
| + return textEmphasisStyle; |
| + |
| + CSSIdentifierValue* fill = |
| + CSSPropertyParserHelpers::consumeIdent<CSSValueFilled, CSSValueOpen>( |
| + range); |
| + CSSIdentifierValue* shape = |
| + CSSPropertyParserHelpers::consumeIdent<CSSValueDot, CSSValueCircle, |
| + CSSValueDoubleCircle, |
| + CSSValueTriangle, CSSValueSesame>( |
| + range); |
| + if (!fill) { |
| + fill = CSSPropertyParserHelpers::consumeIdent<CSSValueFilled, CSSValueOpen>( |
| + range); |
| + } |
| + if (fill && shape) { |
| + CSSValueList* parsedValues = CSSValueList::createSpaceSeparated(); |
| + parsedValues->append(*fill); |
| + parsedValues->append(*shape); |
| + return parsedValues; |
| + } |
| + if (fill) |
| + return fill; |
| + if (shape) |
| + return shape; |
| + return nullptr; |
| +} |
| + |
| +} // namespace blink |