Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp |
| diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..74f2eb7aba753c5f9e5a477e42c9a9416c4010f2 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp |
| @@ -0,0 +1,29 @@ |
| +// 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/CSSPropertyAPIOffsetPosition.h" |
| + |
| +#include "core/css/CSSValuePair.h" |
|
sashab
2017/01/09 05:19:35
Is this needed?
sashab
2017/01/09 05:19:35
Is this needed?
aazzam
2017/01/10 06:22:15
yeah it's needed to assign a CSSValueList* from co
|
| +#include "core/css/parser/CSSParserContext.h" |
| +#include "core/css/parser/CSSPropertyParserHelpers.h" |
| +#include "core/frame/UseCounter.h" |
| + |
| +namespace blink { |
| + |
| +const CSSValue* CSSPropertyAPIOffsetPosition::parseSingleValue( |
| + CSSParserTokenRange& range, |
| + const CSSParserContext& context) { |
| + CSSValueID id = range.peek().id(); |
| + if (id == CSSValueAuto) |
| + return CSSPropertyParserHelpers::consumeIdent(range); |
| + CSSValue* value = CSSPropertyParserHelpers::consumePosition( |
| + range, context.mode(), CSSPropertyParserHelpers::UnitlessQuirk::Forbid); |
| + |
| + // Count when we receive a valid position other than 'auto'. |
| + if (context.useCounter() && value && value->isValuePair()) |
| + context.useCounter()->count(UseCounter::CSSOffsetInEffect); |
| + return value; |
| +} |
| + |
| +} // namespace blink |