| 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..ca27b4b174232a580258ad14067cfba005a27020
|
| --- /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"
|
| +#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
|
|
|