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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 int intValue() const | 153 int intValue() const |
154 { | 154 { |
155 if (isCalculated()) { | 155 if (isCalculated()) { |
156 ASSERT_NOT_REACHED(); | 156 ASSERT_NOT_REACHED(); |
157 return 0; | 157 return 0; |
158 } | 158 } |
159 return getIntValue(); | 159 return getIntValue(); |
160 } | 160 } |
161 | 161 |
| 162 float pixels() const |
| 163 { |
| 164 ASSERT(type() == Fixed); |
| 165 return getFloatValue(); |
| 166 } |
| 167 |
162 float percent() const | 168 float percent() const |
163 { | 169 { |
164 ASSERT(type() == Percent); | 170 ASSERT(type() == Percent); |
165 return getFloatValue(); | 171 return getFloatValue(); |
166 } | 172 } |
| 173 |
167 PixelsAndPercent pixelsAndPercent() const; | 174 PixelsAndPercent pixelsAndPercent() const; |
168 | 175 |
169 CalculationValue& calculationValue() const; | 176 CalculationValue& calculationValue() const; |
170 | 177 |
171 LengthType type() const { return static_cast<LengthType>(m_type); } | 178 LengthType type() const { return static_cast<LengthType>(m_type); } |
172 bool quirk() const { return m_quirk; } | 179 bool quirk() const { return m_quirk; } |
173 | 180 |
174 void setQuirk(bool quirk) | 181 void setQuirk(bool quirk) |
175 { | 182 { |
176 m_quirk = quirk; | 183 m_quirk = quirk; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 bool m_quirk; | 327 bool m_quirk; |
321 unsigned char m_type; | 328 unsigned char m_type; |
322 bool m_isFloat; | 329 bool m_isFloat; |
323 }; | 330 }; |
324 | 331 |
325 PLATFORM_EXPORT Vector<Length> parseHTMLAreaElementCoords(const String&); | 332 PLATFORM_EXPORT Vector<Length> parseHTMLAreaElementCoords(const String&); |
326 | 333 |
327 } // namespace blink | 334 } // namespace blink |
328 | 335 |
329 #endif // Length_h | 336 #endif // Length_h |
OLD | NEW |