Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: Source/core/css/CSSToLengthConversionData.h

Issue 1193203003: Keep effectiveZoom finite (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reduced clamp range; Remove clamp in CSSToLength... Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/zoom/large-zoom-crash-expected.txt ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 float exFontSize() const { return m_fontSizes.ex(); } 85 float exFontSize() const { return m_fontSizes.ex(); }
86 float chFontSize() const { return m_fontSizes.ch(); } 86 float chFontSize() const { return m_fontSizes.ch(); }
87 87
88 // Accessing these marks the style as having viewport units 88 // Accessing these marks the style as having viewport units
89 double viewportWidthPercent() const; 89 double viewportWidthPercent() const;
90 double viewportHeightPercent() const; 90 double viewportHeightPercent() const;
91 double viewportMinPercent() const; 91 double viewportMinPercent() const;
92 double viewportMaxPercent() const; 92 double viewportMaxPercent() const;
93 93
94 void setFontSizes(const FontSizes& fontSizes) { m_fontSizes = fontSizes; } 94 void setFontSizes(const FontSizes& fontSizes) { m_fontSizes = fontSizes; }
95 void setZoom(float zoom) { m_zoom = clampTo<float>(zoom, std::numeric_limits <float>::denorm_min()); } 95 void setZoom(float zoom)
96 {
97 ASSERT(std::isfinite(zoom) && zoom > 0);
98 m_zoom = zoom;
99 }
96 100
97 CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const 101 CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const
98 { 102 {
99 return CSSToLengthConversionData(m_style, m_fontSizes, m_viewportSize, n ewZoom); 103 return CSSToLengthConversionData(m_style, m_fontSizes, m_viewportSize, n ewZoom);
100 } 104 }
101 105
102 private: 106 private:
103 const ComputedStyle* m_style; 107 const ComputedStyle* m_style;
104 FontSizes m_fontSizes; 108 FontSizes m_fontSizes;
105 ViewportSize m_viewportSize; 109 ViewportSize m_viewportSize;
106 float m_zoom; 110 float m_zoom;
107 }; 111 };
108 112
109 } // namespace blink 113 } // namespace blink
110 114
111 #endif 115 #endif
OLDNEW
« no previous file with comments | « LayoutTests/svg/zoom/large-zoom-crash-expected.txt ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698