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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/css/properties/CSSPropertyAPIWebkitBoxReflect.h"
6
7 #include "core/css/CSSPrimitiveValue.h"
8 #include "core/css/CSSReflectValue.h"
9 #include "core/css/parser/CSSParserContext.h"
10 #include "core/css/parser/CSSPropertyParserHelpers.h"
11 #include "core/css/properties/CSSPropertyBorderImageUtils.h"
12
13 namespace blink {
14
15 namespace {
16
17 static CSSValue* ConsumeReflect(CSSParserTokenRange& range,
18 const CSSParserContext* context) {
19 CSSIdentifierValue* direction = CSSPropertyParserHelpers::ConsumeIdent<
20 CSSValueAbove, CSSValueBelow, CSSValueLeft, CSSValueRight>(range);
21 if (!direction)
22 return nullptr;
23
24 CSSPrimitiveValue* offset = nullptr;
25 if (range.AtEnd()) {
26 offset = CSSPrimitiveValue::Create(0, CSSPrimitiveValue::UnitType::kPixels);
27 } else {
28 offset = ConsumeLengthOrPercent(
29 range, context->Mode(), kValueRangeAll,
30 CSSPropertyParserHelpers::UnitlessQuirk::kForbid);
31 if (!offset)
32 return nullptr;
33 }
34
35 CSSValue* mask = nullptr;
36 if (!range.AtEnd()) {
37 mask =
38 CSSPropertyBorderImageUtils::ConsumeWebkitBorderImage(range, context);
39 if (!mask)
40 return nullptr;
41 }
42 return CSSReflectValue::Create(direction, offset, mask);
43 }
44
45 } // namespace
46
47 const CSSValue* CSSPropertyAPIWebkitBoxReflect::parseSingleValue(
48 CSSParserTokenRange& range,
49 const CSSParserContext& context,
50 const CSSParserLocalContext&) {
51 return ConsumeReflect(range, &context);
52 }
53
54 } // namespace blink
OLDNEW
« 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