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 27 matching lines...) Expand all Loading... |
38 #include "core/rendering/style/LineClampValue.h" | 38 #include "core/rendering/style/LineClampValue.h" |
39 #include "core/rendering/style/RenderStyleConstants.h" | 39 #include "core/rendering/style/RenderStyleConstants.h" |
40 #include "core/rendering/style/SVGRenderStyleDefs.h" | 40 #include "core/rendering/style/SVGRenderStyleDefs.h" |
41 #include "platform/Length.h" | 41 #include "platform/Length.h" |
42 #include "platform/ThemeTypes.h" | 42 #include "platform/ThemeTypes.h" |
43 #include "platform/fonts/FontDescription.h" | 43 #include "platform/fonts/FontDescription.h" |
44 #include "platform/fonts/FontSmoothingMode.h" | 44 #include "platform/fonts/FontSmoothingMode.h" |
45 #include "platform/fonts/TextRenderingMode.h" | 45 #include "platform/fonts/TextRenderingMode.h" |
46 #include "platform/graphics/GraphicsTypes.h" | 46 #include "platform/graphics/GraphicsTypes.h" |
47 #include "platform/graphics/Path.h" | 47 #include "platform/graphics/Path.h" |
| 48 #include "platform/scroll/ScrollableArea.h" |
48 #include "platform/text/TextDirection.h" | 49 #include "platform/text/TextDirection.h" |
49 #include "platform/text/UnicodeBidi.h" | 50 #include "platform/text/UnicodeBidi.h" |
50 #include "platform/text/WritingMode.h" | 51 #include "platform/text/WritingMode.h" |
51 #include "wtf/MathExtras.h" | 52 #include "wtf/MathExtras.h" |
52 | 53 |
53 namespace WebCore { | 54 namespace WebCore { |
54 | 55 |
55 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(short i) | 56 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(short i) |
56 : CSSValue(PrimitiveClass) | 57 : CSSValue(PrimitiveClass) |
57 { | 58 { |
(...skipping 4979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5037 return OverflowAlignmentTrue; | 5038 return OverflowAlignmentTrue; |
5038 case CSSValueSafe: | 5039 case CSSValueSafe: |
5039 return OverflowAlignmentSafe; | 5040 return OverflowAlignmentSafe; |
5040 default: | 5041 default: |
5041 break; | 5042 break; |
5042 } | 5043 } |
5043 ASSERT_NOT_REACHED(); | 5044 ASSERT_NOT_REACHED(); |
5044 return OverflowAlignmentTrue; | 5045 return OverflowAlignmentTrue; |
5045 } | 5046 } |
5046 | 5047 |
| 5048 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollBehavior behavior) |
| 5049 : CSSValue(PrimitiveClass) |
| 5050 { |
| 5051 m_primitiveUnitType = CSS_VALUE_ID; |
| 5052 switch (behavior) { |
| 5053 case ScrollBehaviorInstant: |
| 5054 m_value.valueID = CSSValueInstant; |
| 5055 break; |
| 5056 case ScrollBehaviorSmooth: |
| 5057 m_value.valueID = CSSValueSmooth; |
| 5058 break; |
| 5059 case ScrollBehaviorAuto: |
| 5060 // Behavior 'auto' is only allowed in ScrollOptions arguments passed to |
| 5061 // CSSOM scroll APIs. |
| 5062 ASSERT_NOT_REACHED(); |
| 5063 } |
| 5064 } |
| 5065 |
| 5066 template<> inline CSSPrimitiveValue::operator ScrollBehavior() const |
| 5067 { |
| 5068 switch (getValueID()) { |
| 5069 case CSSValueInstant: |
| 5070 return ScrollBehaviorInstant; |
| 5071 case CSSValueSmooth: |
| 5072 return ScrollBehaviorSmooth; |
| 5073 default: |
| 5074 break; |
| 5075 } |
| 5076 ASSERT_NOT_REACHED(); |
| 5077 return ScrollBehaviorInstant; |
| 5078 } |
| 5079 |
5047 } | 5080 } |
5048 | 5081 |
5049 #endif | 5082 #endif |
OLD | NEW |