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 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 } | 4747 } |
4748 ASSERT_NOT_REACHED(); | 4748 ASSERT_NOT_REACHED(); |
4749 return OverflowAlignmentTrue; | 4749 return OverflowAlignmentTrue; |
4750 } | 4750 } |
4751 | 4751 |
4752 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollBehavior behavior) | 4752 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollBehavior behavior) |
4753 : CSSValue(PrimitiveClass) | 4753 : CSSValue(PrimitiveClass) |
4754 { | 4754 { |
4755 m_primitiveUnitType = CSS_VALUE_ID; | 4755 m_primitiveUnitType = CSS_VALUE_ID; |
4756 switch (behavior) { | 4756 switch (behavior) { |
4757 case ScrollBehaviorInstant: | 4757 case ScrollBehaviorAuto: |
4758 m_value.valueID = CSSValueInstant; | 4758 m_value.valueID = CSSValueAuto; |
4759 break; | 4759 break; |
4760 case ScrollBehaviorSmooth: | 4760 case ScrollBehaviorSmooth: |
4761 m_value.valueID = CSSValueSmooth; | 4761 m_value.valueID = CSSValueSmooth; |
4762 break; | 4762 break; |
4763 case ScrollBehaviorAuto: | 4763 case ScrollBehaviorInstant: |
4764 // Behavior 'auto' is only allowed in ScrollOptions arguments passed to | 4764 // Behavior 'instant' is only allowed in ScrollOptions arguments passed
to |
4765 // CSSOM scroll APIs. | 4765 // CSSOM scroll APIs. |
4766 ASSERT_NOT_REACHED(); | 4766 ASSERT_NOT_REACHED(); |
4767 } | 4767 } |
4768 } | 4768 } |
4769 | 4769 |
4770 template<> inline CSSPrimitiveValue::operator ScrollBehavior() const | 4770 template<> inline CSSPrimitiveValue::operator ScrollBehavior() const |
4771 { | 4771 { |
4772 switch (getValueID()) { | 4772 switch (getValueID()) { |
4773 case CSSValueInstant: | 4773 case CSSValueAuto: |
4774 return ScrollBehaviorInstant; | 4774 return ScrollBehaviorAuto; |
4775 case CSSValueSmooth: | 4775 case CSSValueSmooth: |
4776 return ScrollBehaviorSmooth; | 4776 return ScrollBehaviorSmooth; |
4777 default: | 4777 default: |
4778 break; | 4778 break; |
4779 } | 4779 } |
4780 ASSERT_NOT_REACHED(); | 4780 ASSERT_NOT_REACHED(); |
4781 return ScrollBehaviorInstant; | 4781 return ScrollBehaviorAuto; |
4782 } | 4782 } |
4783 | 4783 |
4784 } | 4784 } |
4785 | 4785 |
4786 #endif | 4786 #endif |
OLD | NEW |