OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 { | 1880 { |
1881 if (compareEqual(visual->m_zoom, f)) | 1881 if (compareEqual(visual->m_zoom, f)) |
1882 return false; | 1882 return false; |
1883 visual.access()->m_zoom = f; | 1883 visual.access()->m_zoom = f; |
1884 setEffectiveZoom(effectiveZoom() * zoom()); | 1884 setEffectiveZoom(effectiveZoom() * zoom()); |
1885 return true; | 1885 return true; |
1886 } | 1886 } |
1887 | 1887 |
1888 inline bool ComputedStyle::setEffectiveZoom(float f) | 1888 inline bool ComputedStyle::setEffectiveZoom(float f) |
1889 { | 1889 { |
1890 if (compareEqual(rareInheritedData->m_effectiveZoom, f)) | 1890 // Clamp the effective zoom value to a smaller (but hopeful still large |
| 1891 // enough) range, to avoid overflow in derived computations. |
| 1892 float clampedEffectiveZoom = clampTo<float>(f, 1e-6, 1e6); |
| 1893 if (compareEqual(rareInheritedData->m_effectiveZoom, clampedEffectiveZoom)) |
1891 return false; | 1894 return false; |
1892 rareInheritedData.access()->m_effectiveZoom = f; | 1895 rareInheritedData.access()->m_effectiveZoom = clampedEffectiveZoom; |
1893 return true; | 1896 return true; |
1894 } | 1897 } |
1895 | 1898 |
1896 inline bool ComputedStyle::isSharable() const | 1899 inline bool ComputedStyle::isSharable() const |
1897 { | 1900 { |
1898 if (unique()) | 1901 if (unique()) |
1899 return false; | 1902 return false; |
1900 if (hasUniquePseudoStyle()) | 1903 if (hasUniquePseudoStyle()) |
1901 return false; | 1904 return false; |
1902 return true; | 1905 return true; |
(...skipping 28 matching lines...) Expand all Loading... |
1931 } | 1934 } |
1932 | 1935 |
1933 inline bool ComputedStyle::hasPseudoElementStyle() const | 1936 inline bool ComputedStyle::hasPseudoElementStyle() const |
1934 { | 1937 { |
1935 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; | 1938 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; |
1936 } | 1939 } |
1937 | 1940 |
1938 } // namespace blink | 1941 } // namespace blink |
1939 | 1942 |
1940 #endif // ComputedStyle_h | 1943 #endif // ComputedStyle_h |
OLD | NEW |