| 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 computedValue = getDoubleValue(); | 533 computedValue = getDoubleValue(); |
| 534 | 534 |
| 535 // We do not apply the zoom factor when we are computing the value of the fo
nt-size property. The zooming | 535 // We do not apply the zoom factor when we are computing the value of the fo
nt-size property. The zooming |
| 536 // for font sizes is much more complicated, since we have to worry about enf
orcing the minimum font size preference | 536 // for font sizes is much more complicated, since we have to worry about enf
orcing the minimum font size preference |
| 537 // as well as enforcing the implicit "smart minimum." In addition the CSS pr
operty text-size-adjust is used to | 537 // as well as enforcing the implicit "smart minimum." In addition the CSS pr
operty text-size-adjust is used to |
| 538 // prevent text from zooming at all. Therefore we will not apply the zoom he
re if we are computing font-size. | 538 // prevent text from zooming at all. Therefore we will not apply the zoom he
re if we are computing font-size. |
| 539 double result = computedValue * factor; | 539 double result = computedValue * factor; |
| 540 if (computingFontSize || isFontRelativeLength()) | 540 if (computingFontSize || isFontRelativeLength()) |
| 541 return result; | 541 return result; |
| 542 | 542 |
| 543 // Any original result that was >= 1 should not be allowed to fall below 1.
This keeps border lines from | 543 return result * multiplier; |
| 544 // vanishing. | |
| 545 double zoomedResult = result * multiplier; | |
| 546 if (zoomedResult < 1.0 && result >= 1.0) | |
| 547 return 1.0; | |
| 548 return zoomedResult; | |
| 549 } | 544 } |
| 550 | 545 |
| 551 void CSSPrimitiveValue::setFloatValue(unsigned short, double, ExceptionCode& ec) | 546 void CSSPrimitiveValue::setFloatValue(unsigned short, double, ExceptionCode& ec) |
| 552 { | 547 { |
| 553 // Keeping values immutable makes optimizations easier and allows sharing of
the primitive value objects. | 548 // Keeping values immutable makes optimizations easier and allows sharing of
the primitive value objects. |
| 554 // No other engine supports mutating style through this API. Computed style
is always read-only anyway. | 549 // No other engine supports mutating style through this API. Computed style
is always read-only anyway. |
| 555 // Supporting setter would require making primitive value copy-on-write and
taking care of style invalidation. | 550 // Supporting setter would require making primitive value copy-on-write and
taking care of style invalidation. |
| 556 ec = NO_MODIFICATION_ALLOWED_ERR; | 551 ec = NO_MODIFICATION_ALLOWED_ERR; |
| 557 } | 552 } |
| 558 | 553 |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 ASSERT_NOT_REACHED(); | 1229 ASSERT_NOT_REACHED(); |
| 1235 break; | 1230 break; |
| 1236 } | 1231 } |
| 1237 if (result) | 1232 if (result) |
| 1238 result->setCSSOMSafe(); | 1233 result->setCSSOMSafe(); |
| 1239 | 1234 |
| 1240 return result; | 1235 return result; |
| 1241 } | 1236 } |
| 1242 | 1237 |
| 1243 } // namespace WebCore | 1238 } // namespace WebCore |
| OLD | NEW |