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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #ifndef SVGViewSpec_h | 20 #ifndef SVGViewSpec_h |
21 #define SVGViewSpec_h | 21 #define SVGViewSpec_h |
22 | 22 |
23 #include "bindings/core/v8/ScriptWrappable.h" | |
24 #include "core/svg/SVGFitToViewBox.h" | 23 #include "core/svg/SVGFitToViewBox.h" |
25 #include "core/svg/SVGSVGElement.h" | 24 #include "core/svg/SVGSVGElement.h" |
26 #include "core/svg/SVGZoomAndPan.h" | 25 #include "core/svg/SVGZoomAndPan.h" |
27 #include "platform/heap/Handle.h" | 26 #include "platform/heap/Handle.h" |
28 | 27 |
29 namespace blink { | 28 namespace blink { |
30 | 29 |
31 class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>, public ScriptWrappable, public SVGZoomAndPan, public SVGFitToViewBox { | 30 class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>, public SVGZoomAndPan, public SVGFitToViewBox { |
32 DEFINE_WRAPPERTYPEINFO(); | |
33 USING_GARBAGE_COLLECTED_MIXIN(SVGViewSpec); | 31 USING_GARBAGE_COLLECTED_MIXIN(SVGViewSpec); |
34 public: | 32 public: |
35 static SVGViewSpec* create(SVGSVGElement* contextElement) | 33 static SVGViewSpec* create(SVGSVGElement* contextElement) |
36 { | 34 { |
37 return new SVGViewSpec(contextElement); | 35 return new SVGViewSpec(contextElement); |
38 } | 36 } |
39 | 37 |
40 bool parseViewSpec(const String&); | 38 bool parseViewSpec(const String&); |
41 void reset(); | 39 void reset(); |
42 void detachContextElement(); | |
43 template<typename T> void inheritViewAttributesFromElement(T*); | 40 template<typename T> void inheritViewAttributesFromElement(T*); |
44 | 41 |
45 // JS API | 42 // JS API |
fs
2016/07/26 16:10:10
Nit: Drop this comment
| |
46 SVGTransformList* transform() { return m_transform ? m_transform->baseValue( ) : 0; } | 43 SVGTransformList* transform() { return m_transform ? m_transform->baseValue( ) : 0; } |
47 SVGTransformListTearOff* transformFromJavascript() { return m_transform ? m_ transform->baseVal() : 0; } | |
48 SVGElement* viewTarget() const; | |
49 String viewBoxString() const; | |
50 String preserveAspectRatioString() const; | |
51 String transformString() const; | |
52 String viewTargetString() const { return m_viewTargetString; } | |
53 // override SVGZoomAndPan.setZoomAndPan so can throw exception on write | 44 // override SVGZoomAndPan.setZoomAndPan so can throw exception on write |
54 void setZoomAndPan(unsigned short value) { } // read only | 45 void setZoomAndPan(unsigned short value) { } // read only |
55 void setZoomAndPan(unsigned short value, ExceptionState&); | 46 void setZoomAndPan(unsigned short value, ExceptionState&); |
56 | 47 |
57 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
58 | 49 |
59 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 50 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
60 | 51 |
61 SVGSVGElement* contextElement() { return m_contextElement.get(); } | 52 SVGSVGElement* contextElement() { return m_contextElement.get(); } |
62 | 53 |
(...skipping 19 matching lines...) Expand all Loading... | |
82 preserveAspectRatio()->baseValue()->setMeetOrSlice(inheritFromElement->p reserveAspectRatio()->currentValue()->meetOrSlice()); | 73 preserveAspectRatio()->baseValue()->setMeetOrSlice(inheritFromElement->p reserveAspectRatio()->currentValue()->meetOrSlice()); |
83 } | 74 } |
84 | 75 |
85 if (inheritFromElement->hasAttribute(SVGNames::zoomAndPanAttr)) | 76 if (inheritFromElement->hasAttribute(SVGNames::zoomAndPanAttr)) |
86 setZoomAndPan(inheritFromElement->zoomAndPan()); | 77 setZoomAndPan(inheritFromElement->zoomAndPan()); |
87 } | 78 } |
88 | 79 |
89 } // namespace blink | 80 } // namespace blink |
90 | 81 |
91 #endif // SVGViewSpec_h | 82 #endif // SVGViewSpec_h |
OLD | NEW |