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

Side by Side Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAPIScrollSnapType.cpp

Issue 2932593004: Update the snap points css properties (Closed)
Patch Set: Fix nits 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
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/CSSPropertyAPIScrollSnapType.h"
6
7 #include "core/css/CSSValuePair.h"
8 #include "core/css/parser/CSSPropertyParserHelpers.h"
9
10 namespace blink {
11
12 const CSSValue* CSSPropertyAPIScrollSnapType::parseSingleValue(
13 CSSParserTokenRange& range,
14 const CSSParserContext& context,
15 const CSSParserLocalContext&) {
16 CSSValueID axis_id = range.Peek().Id();
17 if (axis_id != CSSValueNone && axis_id != CSSValueX && axis_id != CSSValueY &&
18 axis_id != CSSValueBlock && axis_id != CSSValueInline &&
19 axis_id != CSSValueBoth)
20 return nullptr;
21 CSSValue* axis_value = CSSPropertyParserHelpers::ConsumeIdent(range);
22 if (range.AtEnd() || axis_id == CSSValueNone)
23 return axis_value;
24
25 CSSValueID strictness_id = range.Peek().Id();
26 if (strictness_id != CSSValueProximity && strictness_id != CSSValueMandatory)
27 return axis_value;
28 CSSValue* strictness_value = CSSPropertyParserHelpers::ConsumeIdent(range);
29 CSSValuePair* pair = CSSValuePair::Create(axis_value, strictness_value,
30 CSSValuePair::kDropIdenticalValues);
31 return pair;
32 }
33
34 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698