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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGRectElement.cpp

Issue 2019993003: Set "auto" as default for rx and ry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added CSS Parsing Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/style/SVGComputedStyle.h ('k') | 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 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 * 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (!width && !height) 74 if (!width && !height)
75 return path; 75 return path;
76 76
77 float x = lengthContext.valueForLength(svgStyle.x(), style, SVGLengthMode::W idth); 77 float x = lengthContext.valueForLength(svgStyle.x(), style, SVGLengthMode::W idth);
78 float y = lengthContext.valueForLength(svgStyle.y(), style, SVGLengthMode::H eight); 78 float y = lengthContext.valueForLength(svgStyle.y(), style, SVGLengthMode::H eight);
79 float rx = lengthContext.valueForLength(svgStyle.rx(), style, SVGLengthMode: :Width); 79 float rx = lengthContext.valueForLength(svgStyle.rx(), style, SVGLengthMode: :Width);
80 float ry = lengthContext.valueForLength(svgStyle.ry(), style, SVGLengthMode: :Height); 80 float ry = lengthContext.valueForLength(svgStyle.ry(), style, SVGLengthMode: :Height);
81 bool hasRx = rx > 0; 81 bool hasRx = rx > 0;
82 bool hasRy = ry > 0; 82 bool hasRy = ry > 0;
83 if (hasRx || hasRy) { 83 if (hasRx || hasRy) {
84 if (!hasRx) 84 if (svgStyle.rx().isAuto())
85 rx = ry; 85 rx = ry;
86 else if (!hasRy) 86 else if (svgStyle.ry().isAuto())
87 ry = rx; 87 ry = rx;
88 88
89 path.addRoundedRect(FloatRect(x, y, width, height), FloatSize(rx, ry)); 89 path.addRoundedRect(FloatRect(x, y, width, height), FloatSize(rx, ry));
90 return path; 90 return path;
91 } 91 }
92 92
93 path.addRect(FloatRect(x, y, width, height)); 93 path.addRect(FloatRect(x, y, width, height));
94 return path; 94 return path;
95 } 95 }
96 96
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 || m_rx->currentValue()->isRelative() 165 || m_rx->currentValue()->isRelative()
166 || m_ry->currentValue()->isRelative(); 166 || m_ry->currentValue()->isRelative();
167 } 167 }
168 168
169 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&) 169 LayoutObject* SVGRectElement::createLayoutObject(const ComputedStyle&)
170 { 170 {
171 return new LayoutSVGRect(this); 171 return new LayoutSVGRect(this);
172 } 172 }
173 173
174 } // namespace blink 174 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/SVGComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698