Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIOffsetPosition.cpp

Issue 2613863002: Implements CSSPropertyAPI for the offset-position property. (Closed)
Patch Set: dependencies Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698