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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGViewSpec.h

Issue 2774753004: Add SVGFitToViewBox::hasValidViewBox helper (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/core/svg/SVGSVGElement.cpp ('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) 2007 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007 Rob Buis <buis@kde.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void setViewBox(const FloatRect&); 58 void setViewBox(const FloatRect&);
59 void setPreserveAspectRatio(const SVGPreserveAspectRatio&); 59 void setPreserveAspectRatio(const SVGPreserveAspectRatio&);
60 60
61 Member<SVGRect> m_viewBox; 61 Member<SVGRect> m_viewBox;
62 Member<SVGPreserveAspectRatio> m_preserveAspectRatio; 62 Member<SVGPreserveAspectRatio> m_preserveAspectRatio;
63 Member<SVGTransformList> m_transform; 63 Member<SVGTransformList> m_transform;
64 }; 64 };
65 65
66 template <typename T> 66 template <typename T>
67 void SVGViewSpec::inheritViewAttributesFromElement(T& inheritFromElement) { 67 void SVGViewSpec::inheritViewAttributesFromElement(T& inheritFromElement) {
68 if (inheritFromElement.viewBox()->currentValue()->isValid()) 68 if (inheritFromElement.hasValidViewBox())
69 setViewBox(inheritFromElement.viewBox()->currentValue()->value()); 69 setViewBox(inheritFromElement.viewBox()->currentValue()->value());
70 70
71 if (inheritFromElement.preserveAspectRatio()->isSpecified()) { 71 if (inheritFromElement.preserveAspectRatio()->isSpecified()) {
72 setPreserveAspectRatio( 72 setPreserveAspectRatio(
73 *inheritFromElement.preserveAspectRatio()->currentValue()); 73 *inheritFromElement.preserveAspectRatio()->currentValue());
74 } 74 }
75 75
76 if (inheritFromElement.hasAttribute(SVGNames::zoomAndPanAttr)) 76 if (inheritFromElement.hasAttribute(SVGNames::zoomAndPanAttr))
77 setZoomAndPan(inheritFromElement.zoomAndPan()); 77 setZoomAndPan(inheritFromElement.zoomAndPan());
78 } 78 }
79 79
80 } // namespace blink 80 } // namespace blink
81 81
82 #endif // SVGViewSpec_h 82 #endif // SVGViewSpec_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGSVGElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698