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 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 462 } |
463 | 463 |
464 template<> unsigned CSSPrimitiveValue::computeLength(RenderStyle* style, RenderS
tyle* rootStyle, float multiplier, bool computingFontSize) | 464 template<> unsigned CSSPrimitiveValue::computeLength(RenderStyle* style, RenderS
tyle* rootStyle, float multiplier, bool computingFontSize) |
465 { | 465 { |
466 return roundForImpreciseConversion<unsigned>(computeLengthDouble(style, root
Style, multiplier, computingFontSize)); | 466 return roundForImpreciseConversion<unsigned>(computeLengthDouble(style, root
Style, multiplier, computingFontSize)); |
467 } | 467 } |
468 | 468 |
469 template<> Length CSSPrimitiveValue::computeLength(RenderStyle* style, RenderSty
le* rootStyle, float multiplier, bool computingFontSize) | 469 template<> Length CSSPrimitiveValue::computeLength(RenderStyle* style, RenderSty
le* rootStyle, float multiplier, bool computingFontSize) |
470 { | 470 { |
471 #if ENABLE(SUBPIXEL_LAYOUT) | 471 #if ENABLE(SUBPIXEL_LAYOUT) |
472 return Length(static_cast<float>(computeLengthDouble(style, rootStyle, multi
plier, computingFontSize)), Fixed); | 472 double value = computeLengthDouble(style, rootStyle, multiplier, computingFo
ntSize); |
| 473 return Length(static_cast<float>(value > intMaxForLayoutUnit || value < intM
inForLayoutUnit ? 0.0 : value), Fixed); |
473 #else | 474 #else |
474 return Length(roundForImpreciseConversion<float>(computeLengthDouble(style,
rootStyle, multiplier, computingFontSize)), Fixed); | 475 return Length(roundForImpreciseConversion<float>(computeLengthDouble(style,
rootStyle, multiplier, computingFontSize)), Fixed); |
475 #endif | 476 #endif |
476 } | 477 } |
477 | 478 |
478 template<> short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyl
e* rootStyle, float multiplier, bool computingFontSize) | 479 template<> short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyl
e* rootStyle, float multiplier, bool computingFontSize) |
479 { | 480 { |
480 return roundForImpreciseConversion<short>(computeLengthDouble(style, rootSty
le, multiplier, computingFontSize)); | 481 return roundForImpreciseConversion<short>(computeLengthDouble(style, rootSty
le, multiplier, computingFontSize)); |
481 } | 482 } |
482 | 483 |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 break; | 1298 break; |
1298 case CSS_CALC: | 1299 case CSS_CALC: |
1299 info.addMember(m_value.calc); | 1300 info.addMember(m_value.calc); |
1300 break; | 1301 break; |
1301 default: | 1302 default: |
1302 break; | 1303 break; |
1303 } | 1304 } |
1304 } | 1305 } |
1305 | 1306 |
1306 } // namespace WebCore | 1307 } // namespace WebCore |
OLD | NEW |