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" |
+#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 |