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

Side by Side Diff: Source/core/svg/SVGFitToViewBox.h

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return true; 65 return true;
66 } 66 }
67 if (name == SVGNames::preserveAspectRatioAttr) { 67 if (name == SVGNames::preserveAspectRatioAttr) {
68 m_preserveAspectRatio->setBaseValueAsString(value, parseError); 68 m_preserveAspectRatio->setBaseValueAsString(value, parseError);
69 return true; 69 return true;
70 } 70 }
71 return false; 71 return false;
72 } 72 }
73 73
74 // SVGFitToViewBox JS API. 74 // SVGFitToViewBox JS API.
75 static SVGAnimatedRect* viewBox(SVGFitToViewBox* object) { return object->vi ewBox(); } 75 static SVGAnimatedRect* viewBox(SVGFitToViewBox& object) { return object.vie wBox(); }
76 static SVGAnimatedPreserveAspectRatio* preserveAspectRatio(SVGFitToViewBox* object) { return object->preserveAspectRatio(); } 76 static SVGAnimatedPreserveAspectRatio* preserveAspectRatio(SVGFitToViewBox& object) { return object.preserveAspectRatio(); }
77 77
78 SVGAnimatedRect* viewBox() const { return m_viewBox.get(); } 78 SVGAnimatedRect* viewBox() const { return m_viewBox.get(); }
79 bool hasEmptyViewBox() const { return m_viewBox->currentValue()->isValid() & & m_viewBox->currentValue()->value().isEmpty(); } 79 bool hasEmptyViewBox() const { return m_viewBox->currentValue()->isValid() & & m_viewBox->currentValue()->value().isEmpty(); }
80 SVGAnimatedPreserveAspectRatio* preserveAspectRatio() const { return m_prese rveAspectRatio.get(); } 80 SVGAnimatedPreserveAspectRatio* preserveAspectRatio() const { return m_prese rveAspectRatio.get(); }
81 81
82 protected: 82 protected:
83 explicit SVGFitToViewBox(SVGElement*, PropertyMapPolicy = PropertyMapPolicyA dd); 83 explicit SVGFitToViewBox(SVGElement*, PropertyMapPolicy = PropertyMapPolicyA dd);
84 void updateViewBox(const FloatRect&); 84 void updateViewBox(const FloatRect&);
85 void clearViewBox() { m_viewBox = 0; } 85 void clearViewBox() { m_viewBox = 0; }
86 void clearPreserveAspectRatio() { m_preserveAspectRatio = 0; } 86 void clearPreserveAspectRatio() { m_preserveAspectRatio = 0; }
87 87
88 private: 88 private:
89 RefPtr<SVGAnimatedRect> m_viewBox; 89 RefPtr<SVGAnimatedRect> m_viewBox;
90 RefPtr<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; 90 RefPtr<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio;
91 }; 91 };
92 92
93 } // namespace WebCore 93 } // namespace WebCore
94 94
95 #endif // SVGFitToViewBox_h 95 #endif // SVGFitToViewBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698