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

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

Issue 2774753004: Add SVGFitToViewBox::hasValidViewBox helper (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
3 * <zimmermann@kde.org> 3 * <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 if (!attributes.hasY() && element->y()->isSpecified()) 156 if (!attributes.hasY() && element->y()->isSpecified())
157 attributes.setY(element->y()->currentValue()); 157 attributes.setY(element->y()->currentValue());
158 158
159 if (!attributes.hasWidth() && element->width()->isSpecified()) 159 if (!attributes.hasWidth() && element->width()->isSpecified())
160 attributes.setWidth(element->width()->currentValue()); 160 attributes.setWidth(element->width()->currentValue());
161 161
162 if (!attributes.hasHeight() && element->height()->isSpecified()) 162 if (!attributes.hasHeight() && element->height()->isSpecified())
163 attributes.setHeight(element->height()->currentValue()); 163 attributes.setHeight(element->height()->currentValue());
164 164
165 if (!attributes.hasViewBox() && element->viewBox()->isSpecified() && 165 if (!attributes.hasViewBox() && element->hasValidViewBox())
166 element->viewBox()->currentValue()->isValid())
167 attributes.setViewBox(element->viewBox()->currentValue()->value()); 166 attributes.setViewBox(element->viewBox()->currentValue()->value());
168 167
169 if (!attributes.hasPreserveAspectRatio() && 168 if (!attributes.hasPreserveAspectRatio() &&
170 element->preserveAspectRatio()->isSpecified()) 169 element->preserveAspectRatio()->isSpecified())
171 attributes.setPreserveAspectRatio( 170 attributes.setPreserveAspectRatio(
172 element->preserveAspectRatio()->currentValue()); 171 element->preserveAspectRatio()->currentValue());
173 172
174 if (!attributes.hasPatternUnits() && element->patternUnits()->isSpecified()) 173 if (!attributes.hasPatternUnits() && element->patternUnits()->isSpecified())
175 attributes.setPatternUnits( 174 attributes.setPatternUnits(
176 element->patternUnits()->currentValue()->enumValue()); 175 element->patternUnits()->currentValue()->enumValue());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 220 }
222 221
223 bool SVGPatternElement::selfHasRelativeLengths() const { 222 bool SVGPatternElement::selfHasRelativeLengths() const {
224 return m_x->currentValue()->isRelative() || 223 return m_x->currentValue()->isRelative() ||
225 m_y->currentValue()->isRelative() || 224 m_y->currentValue()->isRelative() ||
226 m_width->currentValue()->isRelative() || 225 m_width->currentValue()->isRelative() ||
227 m_height->currentValue()->isRelative(); 226 m_height->currentValue()->isRelative();
228 } 227 }
229 228
230 } // namespace blink 229 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp ('k') | third_party/WebKit/Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698