OLD | NEW |
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 4148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4159 case CSSValueNone: | 4159 case CSSValueNone: |
4160 return WrapThroughNone; | 4160 return WrapThroughNone; |
4161 default: | 4161 default: |
4162 break; | 4162 break; |
4163 } | 4163 } |
4164 | 4164 |
4165 ASSERT_NOT_REACHED(); | 4165 ASSERT_NOT_REACHED(); |
4166 return WrapThroughWrap; | 4166 return WrapThroughWrap; |
4167 } | 4167 } |
4168 | 4168 |
4169 template<> inline CSSPrimitiveValue::operator GridAutoFlow() const | |
4170 { | |
4171 ASSERT(isValueID()); | |
4172 switch (m_value.valueID) { | |
4173 case CSSValueNone: | |
4174 return AutoFlowNone; | |
4175 case CSSValueColumn: | |
4176 return AutoFlowColumn; | |
4177 case CSSValueRow: | |
4178 return AutoFlowRow; | |
4179 default: | |
4180 break; | |
4181 } | |
4182 | |
4183 ASSERT_NOT_REACHED(); | |
4184 return AutoFlowNone; | |
4185 | |
4186 } | |
4187 | |
4188 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(GridAutoFlow flow) | |
4189 : CSSValue(PrimitiveClass) | |
4190 { | |
4191 m_primitiveUnitType = CSS_VALUE_ID; | |
4192 switch (flow) { | |
4193 case AutoFlowNone: | |
4194 m_value.valueID = CSSValueNone; | |
4195 break; | |
4196 case AutoFlowColumn: | |
4197 m_value.valueID = CSSValueColumn; | |
4198 break; | |
4199 case AutoFlowRow: | |
4200 m_value.valueID = CSSValueRow; | |
4201 break; | |
4202 } | |
4203 } | |
4204 | |
4205 enum LengthConversion { | 4169 enum LengthConversion { |
4206 AnyConversion = ~0, | 4170 AnyConversion = ~0, |
4207 FixedConversion = 1 << 0, | 4171 FixedConversion = 1 << 0, |
4208 AutoConversion = 1 << 1, | 4172 AutoConversion = 1 << 1, |
4209 PercentConversion = 1 << 2, | 4173 PercentConversion = 1 << 2, |
4210 }; | 4174 }; |
4211 | 4175 |
4212 template<int supported> Length CSSPrimitiveValue::convertToLength(const CSSToLen
gthConversionData& conversionData) | 4176 template<int supported> Length CSSPrimitiveValue::convertToLength(const CSSToLen
gthConversionData& conversionData) |
4213 { | 4177 { |
4214 if ((supported & FixedConversion) && isLength()) | 4178 if ((supported & FixedConversion) && isLength()) |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4891 default: | 4855 default: |
4892 break; | 4856 break; |
4893 } | 4857 } |
4894 ASSERT_NOT_REACHED(); | 4858 ASSERT_NOT_REACHED(); |
4895 return ScrollBehaviorInstant; | 4859 return ScrollBehaviorInstant; |
4896 } | 4860 } |
4897 | 4861 |
4898 } | 4862 } |
4899 | 4863 |
4900 #endif | 4864 #endif |
OLD | NEW |