OLD | NEW |
---|---|
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 } | 145 } |
146 | 146 |
147 StringToUnitTable& unitTable() | 147 StringToUnitTable& unitTable() |
148 { | 148 { |
149 DEFINE_STATIC_LOCAL(StringToUnitTable, unitTable, (createStringToUnitTable() )); | 149 DEFINE_STATIC_LOCAL(StringToUnitTable, unitTable, (createStringToUnitTable() )); |
150 return unitTable; | 150 return unitTable; |
151 } | 151 } |
152 | 152 |
153 } // namespace | 153 } // namespace |
154 | 154 |
155 float CSSPrimitiveValue::clampToCSSLengthRange(float value) | |
fs
2015/03/12 14:28:48
Reuse this in computeLength too. Should probably t
Erik Dahlström (inactive)
2015/03/12 16:14:56
Done.
| |
156 { | |
157 return clampTo<float>(value, minValueForCssLength, maxValueForCssLength); | |
158 } | |
159 | |
155 void CSSPrimitiveValue::initUnitTable() | 160 void CSSPrimitiveValue::initUnitTable() |
156 { | 161 { |
157 // Make sure we initialize this during blink initialization | 162 // Make sure we initialize this during blink initialization |
158 // to avoid racy static local initialization. | 163 // to avoid racy static local initialization. |
159 unitTable(); | 164 unitTable(); |
160 } | 165 } |
161 | 166 |
162 CSSPrimitiveValue::UnitType CSSPrimitiveValue::fromName(const String& unit) | 167 CSSPrimitiveValue::UnitType CSSPrimitiveValue::fromName(const String& unit) |
163 { | 168 { |
164 return unitTable().get(unit.lower()); | 169 return unitTable().get(unit.lower()); |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1256 visitor->trace(m_value.shape); | 1261 visitor->trace(m_value.shape); |
1257 break; | 1262 break; |
1258 default: | 1263 default: |
1259 break; | 1264 break; |
1260 } | 1265 } |
1261 #endif | 1266 #endif |
1262 CSSValue::traceAfterDispatch(visitor); | 1267 CSSValue::traceAfterDispatch(visitor); |
1263 } | 1268 } |
1264 | 1269 |
1265 } // namespace blink | 1270 } // namespace blink |
OLD | NEW |