| Index: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b163f5bc43849afa45418272718f884bb09b4a59
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIRotate.cpp
|
| @@ -0,0 +1,38 @@
|
| +// 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/CSSPropertyAPIRotate.h"
|
| +
|
| +#include "core/css/CSSValueList.h"
|
| +#include "core/css/parser/CSSPropertyParserHelpers.h"
|
| +#include "platform/RuntimeEnabledFeatures.h"
|
| +
|
| +namespace blink {
|
| +
|
| +const CSSValue* CSSPropertyAPIRotate::parseSingleValue(
|
| + CSSParserTokenRange& range,
|
| + const CSSParserContext& context) {
|
| + DCHECK(RuntimeEnabledFeatures::cssIndependentTransformPropertiesEnabled());
|
| + CSSValueList* list = CSSValueList::createSpaceSeparated();
|
| +
|
| + for (unsigned i = 0; i < 3; i++) { // 3 dimensions of rotation
|
| + CSSValue* dimension =
|
| + CSSPropertyParserHelpers::consumeNumber(range, ValueRangeAll);
|
| + if (!dimension) {
|
| + if (i == 0)
|
| + break;
|
| + return nullptr;
|
| + }
|
| + list->append(*dimension);
|
| + }
|
| +
|
| + CSSValue* rotation = CSSPropertyParserHelpers::consumeAngle(range);
|
| + if (!rotation)
|
| + return nullptr;
|
| + list->append(*rotation);
|
| +
|
| + return list;
|
| +}
|
| +
|
| +} // namespace blink
|
|
|