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

Side by Side Diff: Source/core/svg/SVGLengthContext.cpp

Issue 1095053002: Avoid assert for isLegacyIntrinsic too (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 float SVGLengthContext::valueForLength(const Length& length, const ComputedStyle & style, float dimension) 171 float SVGLengthContext::valueForLength(const Length& length, const ComputedStyle & style, float dimension)
172 { 172 {
173 return valueForLength(length, style.effectiveZoom(), dimension); 173 return valueForLength(length, style.effectiveZoom(), dimension);
174 } 174 }
175 175
176 float SVGLengthContext::valueForLength(const Length& length, float zoom, float d imension) 176 float SVGLengthContext::valueForLength(const Length& length, float zoom, float d imension)
177 { 177 {
178 ASSERT(zoom != 0); 178 ASSERT(zoom != 0);
179 // isIntrinsic can occur for 'width' and 'height', but has no 179 // isIntrinsic can occur for 'width' and 'height', but has no
180 // real meaning for svg. 180 // real meaning for svg.
181 if (length.isIntrinsic()) 181 if (length.isIntrinsic() || length.isLegacyIntrinsic())
182 return 0; 182 return 0;
183 return floatValueForLength(length, dimension * zoom) / zoom; 183 return floatValueForLength(length, dimension * zoom) / zoom;
184 } 184 }
185 185
186 float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode, SVGLengthType fromUnit) const 186 float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode, SVGLengthType fromUnit) const
187 { 187 {
188 float userUnits = value; 188 float userUnits = value;
189 switch (fromUnit) { 189 switch (fromUnit) {
190 case LengthTypeUnknown: 190 case LengthTypeUnknown:
191 return 0; 191 return 0;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 const SVGSVGElement& svg = toSVGSVGElement(*viewportElement); 346 const SVGSVGElement& svg = toSVGSVGElement(*viewportElement);
347 viewportSize = svg.currentViewBoxRect().size(); 347 viewportSize = svg.currentViewBoxRect().size();
348 if (viewportSize.isEmpty()) 348 if (viewportSize.isEmpty())
349 viewportSize = svg.currentViewportSize(); 349 viewportSize = svg.currentViewportSize();
350 350
351 return true; 351 return true;
352 } 352 }
353 353
354 } 354 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698