OLD | NEW |
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 Loading... |
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 |
OLD | NEW |