| 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 23 matching lines...) Expand all Loading... |
| 34 #include "core/css/CSSCalculationValue.h" | 34 #include "core/css/CSSCalculationValue.h" |
| 35 #include "core/css/CSSPrimitiveValue.h" | 35 #include "core/css/CSSPrimitiveValue.h" |
| 36 #include "core/css/CSSReflectionDirection.h" | 36 #include "core/css/CSSReflectionDirection.h" |
| 37 #include "core/platform/graphics/FontDescription.h" | 37 #include "core/platform/graphics/FontDescription.h" |
| 38 #include "core/platform/graphics/FontSmoothingMode.h" | 38 #include "core/platform/graphics/FontSmoothingMode.h" |
| 39 #include "core/platform/graphics/GraphicsTypes.h" | 39 #include "core/platform/graphics/GraphicsTypes.h" |
| 40 #include "core/platform/Length.h" | 40 #include "core/platform/Length.h" |
| 41 #include "core/platform/ThemeTypes.h" | 41 #include "core/platform/ThemeTypes.h" |
| 42 #include "core/platform/graphics/Path.h" | 42 #include "core/platform/graphics/Path.h" |
| 43 #include "core/platform/graphics/TextRenderingMode.h" | 43 #include "core/platform/graphics/TextRenderingMode.h" |
| 44 #include "core/rendering/style/LineClampValue.h" | |
| 45 #include "core/rendering/style/RenderStyleConstants.h" | 44 #include "core/rendering/style/RenderStyleConstants.h" |
| 46 #include "core/rendering/style/SVGRenderStyleDefs.h" | 45 #include "core/rendering/style/SVGRenderStyleDefs.h" |
| 47 #include "platform/text/TextDirection.h" | 46 #include "platform/text/TextDirection.h" |
| 48 #include "platform/text/UnicodeBidi.h" | 47 #include "platform/text/UnicodeBidi.h" |
| 49 #include "platform/text/WritingMode.h" | 48 #include "platform/text/WritingMode.h" |
| 50 #include "wtf/MathExtras.h" | 49 #include "wtf/MathExtras.h" |
| 51 | 50 |
| 52 namespace WebCore { | 51 namespace WebCore { |
| 53 | 52 |
| 54 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(short i) | 53 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(short i) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 110 |
| 112 template<> inline CSSPrimitiveValue::operator float() const | 111 template<> inline CSSPrimitiveValue::operator float() const |
| 113 { | 112 { |
| 114 if (m_primitiveUnitType == CSS_NUMBER) | 113 if (m_primitiveUnitType == CSS_NUMBER) |
| 115 return clampTo<float>(m_value.num); | 114 return clampTo<float>(m_value.num); |
| 116 | 115 |
| 117 ASSERT_NOT_REACHED(); | 116 ASSERT_NOT_REACHED(); |
| 118 return 0.0f; | 117 return 0.0f; |
| 119 } | 118 } |
| 120 | 119 |
| 121 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineClampValue i) | |
| 122 : CSSValue(PrimitiveClass) | |
| 123 { | |
| 124 m_primitiveUnitType = i.isPercentage() ? CSS_PERCENTAGE : CSS_NUMBER; | |
| 125 m_value.num = static_cast<double>(i.value()); | |
| 126 } | |
| 127 | |
| 128 template<> inline CSSPrimitiveValue::operator LineClampValue() const | |
| 129 { | |
| 130 if (m_primitiveUnitType == CSS_NUMBER) | |
| 131 return LineClampValue(clampTo<int>(m_value.num), LineClampLineCount); | |
| 132 | |
| 133 if (m_primitiveUnitType == CSS_PERCENTAGE) | |
| 134 return LineClampValue(clampTo<int>(m_value.num), LineClampPercentage); | |
| 135 | |
| 136 ASSERT_NOT_REACHED(); | |
| 137 return LineClampValue(); | |
| 138 } | |
| 139 | |
| 140 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSReflectionDirection e) | 120 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSReflectionDirection e) |
| 141 : CSSValue(PrimitiveClass) | 121 : CSSValue(PrimitiveClass) |
| 142 { | 122 { |
| 143 m_primitiveUnitType = CSS_VALUE_ID; | 123 m_primitiveUnitType = CSS_VALUE_ID; |
| 144 switch (e) { | 124 switch (e) { |
| 145 case ReflectionAbove: | 125 case ReflectionAbove: |
| 146 m_value.valueID = CSSValueAbove; | 126 m_value.valueID = CSSValueAbove; |
| 147 break; | 127 break; |
| 148 case ReflectionBelow: | 128 case ReflectionBelow: |
| 149 m_value.valueID = CSSValueBelow; | 129 m_value.valueID = CSSValueBelow; |
| (...skipping 4702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4852 break; | 4832 break; |
| 4853 } | 4833 } |
| 4854 | 4834 |
| 4855 ASSERT_NOT_REACHED(); | 4835 ASSERT_NOT_REACHED(); |
| 4856 return IsolationAuto; | 4836 return IsolationAuto; |
| 4857 } | 4837 } |
| 4858 | 4838 |
| 4859 } | 4839 } |
| 4860 | 4840 |
| 4861 #endif | 4841 #endif |
| OLD | NEW |