Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 void setZoomAndPan(unsigned short, ExceptionState&); | 63 void setZoomAndPan(unsigned short, ExceptionState&); |
| 64 void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZ oomAndPan::parseFromNumber(zoomAndPan); } | 64 void setZoomAndPanBaseValue(unsigned short zoomAndPan) { m_zoomAndPan = SVGZ oomAndPan::parseFromNumber(zoomAndPan); } |
| 65 | 65 |
| 66 SVGElement* contextElement() const { return m_contextElement.get(); } | 66 SVGElement* contextElement() const { return m_contextElement.get(); } |
| 67 | 67 |
| 68 // Custom non-animated 'transform' property. | 68 // Custom non-animated 'transform' property. |
| 69 SVGTransformListPropertyTearOff* transform(); | 69 SVGTransformListPropertyTearOff* transform(); |
| 70 SVGTransformList transformBaseValue() const { return m_transform; } | 70 SVGTransformList transformBaseValue() const { return m_transform; } |
| 71 | 71 |
| 72 // Custom animated 'viewBox' property. | 72 // Custom animated 'viewBox' property. |
| 73 PassRefPtr<SVGAnimatedRect> viewBox(); | 73 SVGAnimatedRect* viewBox() { return m_contextElement ? m_viewBox.get() : 0; } |
|
haraken
2014/01/16 04:56:43
Isn't it a bit dangerous to allow m_viewBox to hol
kouhei (in TOK)
2014/01/16 05:12:37
Ack. I'll try that.
kouhei (in TOK)
2014/01/16 06:07:59
Chatted offline. WeakPtr do not provide "on-clear"
| |
| 74 SVGRect& viewBoxCurrentValue() { return m_viewBox; } | |
| 75 SVGRect viewBoxBaseValue() const { return m_viewBox; } | |
| 76 void setViewBoxBaseValue(const SVGRect& viewBox) { m_viewBox = viewBox; } | |
| 77 | 74 |
| 78 // Custom animated 'preserveAspectRatio' property. | 75 // Custom animated 'preserveAspectRatio' property. |
| 79 PassRefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatio(); | 76 PassRefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatio(); |
| 80 SVGPreserveAspectRatio& preserveAspectRatioCurrentValue() { return m_preserv eAspectRatio; } | 77 SVGPreserveAspectRatio& preserveAspectRatioCurrentValue() { return m_preserv eAspectRatio; } |
| 81 SVGPreserveAspectRatio preserveAspectRatioBaseValue() const { return m_prese rveAspectRatio; } | 78 SVGPreserveAspectRatio preserveAspectRatioBaseValue() const { return m_prese rveAspectRatio; } |
| 82 void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio& preserveA spectRatio) { m_preserveAspectRatio = preserveAspectRatio; } | 79 void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio& preserveA spectRatio) { m_preserveAspectRatio = preserveAspectRatio; } |
| 83 | 80 |
| 84 private: | 81 private: |
| 85 explicit SVGViewSpec(WeakPtr<SVGSVGElement>); | 82 explicit SVGViewSpec(WeakPtr<SVGSVGElement>); |
| 86 | 83 |
| 87 static const SVGPropertyInfo* transformPropertyInfo(); | 84 static const SVGPropertyInfo* transformPropertyInfo(); |
| 88 static const SVGPropertyInfo* viewBoxPropertyInfo(); | |
| 89 static const SVGPropertyInfo* preserveAspectRatioPropertyInfo(); | 85 static const SVGPropertyInfo* preserveAspectRatioPropertyInfo(); |
| 90 | 86 |
| 91 static const AtomicString& transformIdentifier(); | 87 static const AtomicString& transformIdentifier(); |
| 92 static const AtomicString& viewBoxIdentifier(); | |
| 93 static const AtomicString& preserveAspectRatioIdentifier(); | 88 static const AtomicString& preserveAspectRatioIdentifier(); |
| 94 | 89 |
| 95 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTransformWrapper(SVGVie wSpec* contextElement); | 90 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateTransformWrapper(SVGVie wSpec* contextElement); |
| 96 static PassRefPtr<SVGAnimatedProperty> lookupOrCreateViewBoxWrapper(SVGViewS pec* contextElement); | |
| 97 static PassRefPtr<SVGAnimatedProperty> lookupOrCreatePreserveAspectRatioWrap per(SVGViewSpec* contextElement); | 91 static PassRefPtr<SVGAnimatedProperty> lookupOrCreatePreserveAspectRatioWrap per(SVGViewSpec* contextElement); |
| 98 | 92 |
| 99 template<typename CharType> | 93 template<typename CharType> |
| 100 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); | 94 bool parseViewSpecInternal(const CharType* ptr, const CharType* end); |
| 101 | 95 |
| 102 WeakPtr<SVGSVGElement> m_contextElement; | 96 WeakPtr<SVGSVGElement> m_contextElement; |
| 103 | 97 |
| 104 SVGZoomAndPanType m_zoomAndPan; | 98 SVGZoomAndPanType m_zoomAndPan; |
| 105 SVGTransformList m_transform; | 99 SVGTransformList m_transform; |
| 106 SVGRect m_viewBox; | 100 RefPtr<SVGAnimatedRect> m_viewBox; |
| 107 SVGPreserveAspectRatio m_preserveAspectRatio; | 101 SVGPreserveAspectRatio m_preserveAspectRatio; |
| 108 String m_viewTargetString; | 102 String m_viewTargetString; |
| 109 }; | 103 }; |
| 110 | 104 |
| 111 } // namespace WebCore | 105 } // namespace WebCore |
| 112 | 106 |
| 113 #endif | 107 #endif |
| OLD | NEW |