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

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

Issue 2882603002: Implemented remaining non-grouped longhand property APIs (Closed)
Patch Set: rebased onto final utils Created 3 years, 6 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/properties/CSSPropertyAPITransitionProperty.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/CSSPropertyAPIWebkitBoxReflect.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitBoxReflect.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitBoxReflect.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..70f5771babb3de897cd2f757bb63acd2aeb462d9
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAPIWebkitBoxReflect.cpp
@@ -0,0 +1,54 @@
+// 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/CSSPropertyAPIWebkitBoxReflect.h"
+
+#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSReflectValue.h"
+#include "core/css/parser/CSSParserContext.h"
+#include "core/css/parser/CSSPropertyParserHelpers.h"
+#include "core/css/properties/CSSPropertyBorderImageUtils.h"
+
+namespace blink {
+
+namespace {
+
+static CSSValue* ConsumeReflect(CSSParserTokenRange& range,
+ const CSSParserContext* context) {
+ CSSIdentifierValue* direction = CSSPropertyParserHelpers::ConsumeIdent<
+ CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range);
+ if (!direction)
+ return nullptr;
+
+ CSSPrimitiveValue* offset = nullptr;
+ if (range.AtEnd()) {
+ offset = CSSPrimitiveValue::Create(0, CSSPrimitiveValue::UnitType::kPixels);
+ } else {
+ offset = ConsumeLengthOrPercent(
+ range, context->Mode(), kValueRangeAll,
+ CSSPropertyParserHelpers::UnitlessQuirk::kForbid);
+ if (!offset)
+ return nullptr;
+ }
+
+ CSSValue* mask = nullptr;
+ if (!range.AtEnd()) {
+ mask =
+ CSSPropertyBorderImageUtils::ConsumeWebkitBorderImage(range, context);
+ if (!mask)
+ return nullptr;
+ }
+ return CSSReflectValue::Create(direction, offset, mask);
+}
+
+} // namespace
+
+const CSSValue* CSSPropertyAPIWebkitBoxReflect::parseSingleValue(
+ CSSParserTokenRange& range,
+ const CSSParserContext& context,
+ const CSSParserLocalContext&) {
+ return ConsumeReflect(range, &context);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/properties/CSSPropertyAPITransitionProperty.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698