Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIStrokeDasharray.cpp |
| diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIStrokeDasharray.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIStrokeDasharray.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ccfe5c789e51cc10d73400bd1fbd247a95fbf578 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIStrokeDasharray.cpp |
| @@ -0,0 +1,32 @@ |
| +// 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/CSSPropertyAPIStrokeDasharray.h" |
| + |
| +#include "core/css/CSSValueList.h" |
|
sashab
2017/01/06 05:26:07
Add CSSPrimitiveValue please :)
|
| +#include "core/css/parser/CSSPropertyParserHelpers.h" |
| + |
| +namespace blink { |
| + |
| +const CSSValue* CSSPropertyAPIStrokeDasharray::parseSingleValue( |
| + CSSParserTokenRange& range, |
| + const CSSParserContext& context) { |
| + CSSValueID id = range.peek().id(); |
| + if (id == CSSValueNone) |
| + return CSSPropertyParserHelpers::consumeIdent(range); |
| + |
| + CSSValueList* dashes = CSSValueList::createCommaSeparated(); |
| + do { |
| + CSSPrimitiveValue* dash = CSSPropertyParserHelpers::consumeLengthOrPercent( |
| + range, SVGAttributeMode, ValueRangeNonNegative); |
| + if (!dash || |
| + (CSSPropertyParserHelpers::consumeCommaIncludingWhitespace(range) && |
| + range.atEnd())) |
| + return nullptr; |
| + dashes->append(*dash); |
| + } while (!range.atEnd()); |
| + return dashes; |
| +} |
| + |
| +} // namespace blink |