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

Side by Side Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 1148873005: Parsing CSS properties for scroll snap points (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix comment Created 5 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 | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 4701 matching lines...) Expand 10 before | Expand all | Expand 10 after
4712 return ScrollBehaviorAuto; 4712 return ScrollBehaviorAuto;
4713 case CSSValueSmooth: 4713 case CSSValueSmooth:
4714 return ScrollBehaviorSmooth; 4714 return ScrollBehaviorSmooth;
4715 default: 4715 default:
4716 break; 4716 break;
4717 } 4717 }
4718 ASSERT_NOT_REACHED(); 4718 ASSERT_NOT_REACHED();
4719 return ScrollBehaviorAuto; 4719 return ScrollBehaviorAuto;
4720 } 4720 }
4721 4721
4722 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollSnapType snapType)
4723 : CSSValue(PrimitiveClass)
4724 {
4725 m_primitiveUnitType = CSS_VALUE_ID;
4726 switch (snapType) {
4727 case ScrollSnapTypeNone:
4728 m_value.valueID = CSSValueNone;
4729 break;
4730 case ScrollSnapTypeMandatory:
4731 m_value.valueID = CSSValueMandatory;
4732 break;
4733 case ScrollSnapTypeProximity:
4734 m_value.valueID = CSSValueProximity;
4735 break;
4736 }
4737 }
4738
4739 template<> inline CSSPrimitiveValue::operator ScrollSnapType() const
4740 {
4741 switch (getValueID()) {
4742 case CSSValueNone:
4743 return ScrollSnapTypeNone;
4744 case CSSValueMandatory:
4745 return ScrollSnapTypeMandatory;
4746 case CSSValueProximity:
4747 return ScrollSnapTypeProximity;
4748 default:
4749 break;
4750 }
4751 ASSERT_NOT_REACHED();
4752 return ScrollSnapTypeNone;
4753 }
4754
4722 } // namespace blink 4755 } // namespace blink
4723 4756
4724 #endif 4757 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698