OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) | 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) |
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 | 6 |
7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 int intValue() const | 154 int intValue() const |
155 { | 155 { |
156 if (isCalculated()) { | 156 if (isCalculated()) { |
157 ASSERT_NOT_REACHED(); | 157 ASSERT_NOT_REACHED(); |
158 return 0; | 158 return 0; |
159 } | 159 } |
160 return getIntValue(); | 160 return getIntValue(); |
161 } | 161 } |
162 | 162 |
| 163 float pixels() const |
| 164 { |
| 165 ASSERT(type() == Fixed); |
| 166 return getFloatValue(); |
| 167 } |
| 168 |
163 float percent() const | 169 float percent() const |
164 { | 170 { |
165 ASSERT(type() == Percent); | 171 ASSERT(type() == Percent); |
166 return getFloatValue(); | 172 return getFloatValue(); |
167 } | 173 } |
| 174 |
168 PixelsAndPercent pixelsAndPercent() const; | 175 PixelsAndPercent pixelsAndPercent() const; |
169 | 176 |
170 CalculationValue& calculationValue() const; | 177 CalculationValue& calculationValue() const; |
171 | 178 |
172 LengthType type() const { return static_cast<LengthType>(m_type); } | 179 LengthType type() const { return static_cast<LengthType>(m_type); } |
173 bool quirk() const { return m_quirk; } | 180 bool quirk() const { return m_quirk; } |
174 | 181 |
175 void setQuirk(bool quirk) | 182 void setQuirk(bool quirk) |
176 { | 183 { |
177 m_quirk = quirk; | 184 m_quirk = quirk; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 float m_floatValue; | 326 float m_floatValue; |
320 }; | 327 }; |
321 bool m_quirk; | 328 bool m_quirk; |
322 unsigned char m_type; | 329 unsigned char m_type; |
323 bool m_isFloat; | 330 bool m_isFloat; |
324 }; | 331 }; |
325 | 332 |
326 } // namespace blink | 333 } // namespace blink |
327 | 334 |
328 #endif // Length_h | 335 #endif // Length_h |
OLD | NEW |