| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 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 Google, Inc. | 4 * Copyright (C) 2014 Google, Inc. |
| 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 11 matching lines...) Expand all Loading... |
| 22 #ifndef SVGSVGElement_h | 22 #ifndef SVGSVGElement_h |
| 23 #define SVGSVGElement_h | 23 #define SVGSVGElement_h |
| 24 | 24 |
| 25 #include "core/svg/SVGAnimatedBoolean.h" | 25 #include "core/svg/SVGAnimatedBoolean.h" |
| 26 #include "core/svg/SVGAnimatedLength.h" | 26 #include "core/svg/SVGAnimatedLength.h" |
| 27 #include "core/svg/SVGFitToViewBox.h" | 27 #include "core/svg/SVGFitToViewBox.h" |
| 28 #include "core/svg/SVGGraphicsElement.h" | 28 #include "core/svg/SVGGraphicsElement.h" |
| 29 #include "core/svg/SVGLengthTearOff.h" | 29 #include "core/svg/SVGLengthTearOff.h" |
| 30 #include "core/svg/SVGPointTearOff.h" | 30 #include "core/svg/SVGPointTearOff.h" |
| 31 #include "core/svg/SVGZoomAndPan.h" | 31 #include "core/svg/SVGZoomAndPan.h" |
| 32 #include "platform/heap/Handle.h" |
| 32 | 33 |
| 33 namespace blink { | 34 namespace blink { |
| 34 | 35 |
| 35 class SVGMatrixTearOff; | 36 class SVGMatrixTearOff; |
| 36 class SVGAngleTearOff; | 37 class SVGAngleTearOff; |
| 37 class SVGNumberTearOff; | 38 class SVGNumberTearOff; |
| 38 class SVGTransformTearOff; | 39 class SVGTransformTearOff; |
| 39 class SVGViewSpec; | 40 class SVGViewSpec; |
| 40 class SVGViewElement; | 41 class SVGViewElement; |
| 41 class SMILTimeContainer; | 42 class SMILTimeContainer; |
| 42 | 43 |
| 43 class SVGSVGElement final : public SVGGraphicsElement, | 44 class SVGSVGElement final : public SVGGraphicsElement, |
| 44 public SVGFitToViewBox, | 45 public SVGFitToViewBox, |
| 45 public SVGZoomAndPan { | 46 public SVGZoomAndPan { |
| 46 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SVGSVGElement); |
| 47 public: | 49 public: |
| 48 DECLARE_NODE_FACTORY(SVGSVGElement); | 50 DECLARE_NODE_FACTORY(SVGSVGElement); |
| 49 | 51 |
| 50 #if !ENABLE(OILPAN) | 52 #if !ENABLE(OILPAN) |
| 51 using SVGGraphicsElement::ref; | 53 using SVGGraphicsElement::ref; |
| 52 using SVGGraphicsElement::deref; | 54 using SVGGraphicsElement::deref; |
| 53 #endif | 55 #endif |
| 54 | 56 |
| 55 // 'SVGSVGElement' functions | 57 // 'SVGSVGElement' functions |
| 56 PassRefPtr<SVGRectTearOff> viewport() const; | 58 PassRefPtrWillBeRawPtr<SVGRectTearOff> viewport() const; |
| 57 | 59 |
| 58 float pixelUnitToMillimeterX() const; | 60 float pixelUnitToMillimeterX() const; |
| 59 float pixelUnitToMillimeterY() const; | 61 float pixelUnitToMillimeterY() const; |
| 60 float screenPixelToMillimeterX() const; | 62 float screenPixelToMillimeterX() const; |
| 61 float screenPixelToMillimeterY() const; | 63 float screenPixelToMillimeterY() const; |
| 62 | 64 |
| 63 bool useCurrentView() const { return m_useCurrentView; } | 65 bool useCurrentView() const { return m_useCurrentView; } |
| 64 SVGViewSpec* currentView(); | 66 SVGViewSpec* currentView(); |
| 65 | 67 |
| 66 Length intrinsicWidth() const; | 68 Length intrinsicWidth() const; |
| 67 Length intrinsicHeight() const; | 69 Length intrinsicHeight() const; |
| 68 FloatSize currentViewportSize() const; | 70 FloatSize currentViewportSize() const; |
| 69 FloatRect currentViewBoxRect() const; | 71 FloatRect currentViewBoxRect() const; |
| 70 | 72 |
| 71 float currentScale() const; | 73 float currentScale() const; |
| 72 void setCurrentScale(float scale); | 74 void setCurrentScale(float scale); |
| 73 | 75 |
| 74 FloatPoint currentTranslate() { return m_translation->value(); } | 76 FloatPoint currentTranslate() { return m_translation->value(); } |
| 75 void setCurrentTranslate(const FloatPoint&); | 77 void setCurrentTranslate(const FloatPoint&); |
| 76 PassRefPtr<SVGPointTearOff> currentTranslateFromJavascript(); | 78 PassRefPtrWillBeRawPtr<SVGPointTearOff> currentTranslateFromJavascript(); |
| 77 | 79 |
| 78 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } | 80 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } |
| 79 | 81 |
| 80 void pauseAnimations(); | 82 void pauseAnimations(); |
| 81 void unpauseAnimations(); | 83 void unpauseAnimations(); |
| 82 bool animationsPaused() const; | 84 bool animationsPaused() const; |
| 83 | 85 |
| 84 float getCurrentTime() const; | 86 float getCurrentTime() const; |
| 85 void setCurrentTime(float seconds); | 87 void setCurrentTime(float seconds); |
| 86 | 88 |
| 87 // Stubs for the deprecated 'redraw' interface. | 89 // Stubs for the deprecated 'redraw' interface. |
| 88 unsigned suspendRedraw(unsigned) { return 1; } | 90 unsigned suspendRedraw(unsigned) { return 1; } |
| 89 void unsuspendRedraw(unsigned) { } | 91 void unsuspendRedraw(unsigned) { } |
| 90 void unsuspendRedrawAll() { } | 92 void unsuspendRedrawAll() { } |
| 91 void forceRedraw() { } | 93 void forceRedraw() { } |
| 92 | 94 |
| 93 PassRefPtrWillBeRawPtr<StaticNodeList> getIntersectionList(PassRefPtr<SVGRec
tTearOff>, SVGElement* referenceElement) const; | 95 PassRefPtrWillBeRawPtr<StaticNodeList> getIntersectionList(PassRefPtrWillBeR
awPtr<SVGRectTearOff>, SVGElement* referenceElement) const; |
| 94 PassRefPtrWillBeRawPtr<StaticNodeList> getEnclosureList(PassRefPtr<SVGRectTe
arOff>, SVGElement* referenceElement) const; | 96 PassRefPtrWillBeRawPtr<StaticNodeList> getEnclosureList(PassRefPtrWillBeRawP
tr<SVGRectTearOff>, SVGElement* referenceElement) const; |
| 95 bool checkIntersection(SVGElement*, PassRefPtr<SVGRectTearOff>) const; | 97 bool checkIntersection(SVGElement*, PassRefPtrWillBeRawPtr<SVGRectTearOff>)
const; |
| 96 bool checkEnclosure(SVGElement*, PassRefPtr<SVGRectTearOff>) const; | 98 bool checkEnclosure(SVGElement*, PassRefPtrWillBeRawPtr<SVGRectTearOff>) con
st; |
| 97 void deselectAll(); | 99 void deselectAll(); |
| 98 | 100 |
| 99 static PassRefPtr<SVGNumberTearOff> createSVGNumber(); | 101 static PassRefPtrWillBeRawPtr<SVGNumberTearOff> createSVGNumber(); |
| 100 static PassRefPtr<SVGLengthTearOff> createSVGLength(); | 102 static PassRefPtrWillBeRawPtr<SVGLengthTearOff> createSVGLength(); |
| 101 static PassRefPtr<SVGAngleTearOff> createSVGAngle(); | 103 static PassRefPtrWillBeRawPtr<SVGAngleTearOff> createSVGAngle(); |
| 102 static PassRefPtr<SVGPointTearOff> createSVGPoint(); | 104 static PassRefPtrWillBeRawPtr<SVGPointTearOff> createSVGPoint(); |
| 103 static PassRefPtr<SVGMatrixTearOff> createSVGMatrix(); | 105 static PassRefPtrWillBeRawPtr<SVGMatrixTearOff> createSVGMatrix(); |
| 104 static PassRefPtr<SVGRectTearOff> createSVGRect(); | 106 static PassRefPtrWillBeRawPtr<SVGRectTearOff> createSVGRect(); |
| 105 static PassRefPtr<SVGTransformTearOff> createSVGTransform(); | 107 static PassRefPtrWillBeRawPtr<SVGTransformTearOff> createSVGTransform(); |
| 106 static PassRefPtr<SVGTransformTearOff> createSVGTransformFromMatrix(PassRefP
tr<SVGMatrixTearOff>); | 108 static PassRefPtrWillBeRawPtr<SVGTransformTearOff> createSVGTransformFromMat
rix(PassRefPtrWillBeRawPtr<SVGMatrixTearOff>); |
| 107 | 109 |
| 108 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) co
nst; | 110 AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) co
nst; |
| 109 | 111 |
| 110 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
; | 112 void setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
; |
| 111 | 113 |
| 112 bool hasIntrinsicWidth() const; | 114 bool hasIntrinsicWidth() const; |
| 113 bool hasIntrinsicHeight() const; | 115 bool hasIntrinsicHeight() const; |
| 114 | 116 |
| 115 SVGAnimatedLength* x() const { return m_x.get(); } | 117 SVGAnimatedLength* x() const { return m_x.get(); } |
| 116 SVGAnimatedLength* y() const { return m_y.get(); } | 118 SVGAnimatedLength* y() const { return m_y.get(); } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 144 virtual void finishParsingChildren() override; | 146 virtual void finishParsingChildren() override; |
| 145 | 147 |
| 146 enum CheckIntersectionOrEnclosure { | 148 enum CheckIntersectionOrEnclosure { |
| 147 CheckIntersection, | 149 CheckIntersection, |
| 148 CheckEnclosure | 150 CheckEnclosure |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 bool checkIntersectionOrEnclosure(const SVGElement&, const FloatRect&, Check
IntersectionOrEnclosure) const; | 153 bool checkIntersectionOrEnclosure(const SVGElement&, const FloatRect&, Check
IntersectionOrEnclosure) const; |
| 152 PassRefPtrWillBeRawPtr<StaticNodeList> collectIntersectionOrEnclosureList(co
nst FloatRect&, SVGElement*, CheckIntersectionOrEnclosure) const; | 154 PassRefPtrWillBeRawPtr<StaticNodeList> collectIntersectionOrEnclosureList(co
nst FloatRect&, SVGElement*, CheckIntersectionOrEnclosure) const; |
| 153 | 155 |
| 154 RefPtr<SVGAnimatedLength> m_x; | 156 RefPtrWillBeMember<SVGAnimatedLength> m_x; |
| 155 RefPtr<SVGAnimatedLength> m_y; | 157 RefPtrWillBeMember<SVGAnimatedLength> m_y; |
| 156 RefPtr<SVGAnimatedLength> m_width; | 158 RefPtrWillBeMember<SVGAnimatedLength> m_width; |
| 157 RefPtr<SVGAnimatedLength> m_height; | 159 RefPtrWillBeMember<SVGAnimatedLength> m_height; |
| 158 | 160 |
| 159 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const override; | 161 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope)
const override; |
| 160 | 162 |
| 161 bool m_useCurrentView; | 163 bool m_useCurrentView; |
| 162 RefPtrWillBeMember<SMILTimeContainer> m_timeContainer; | 164 RefPtrWillBeMember<SMILTimeContainer> m_timeContainer; |
| 163 RefPtr<SVGPoint> m_translation; | 165 RefPtrWillBeMember<SVGPoint> m_translation; |
| 164 RefPtrWillBeMember<SVGViewSpec> m_viewSpec; | 166 RefPtrWillBeMember<SVGViewSpec> m_viewSpec; |
| 165 | 167 |
| 166 friend class SVGCurrentTranslateTearOff; | 168 friend class SVGCurrentTranslateTearOff; |
| 167 }; | 169 }; |
| 168 | 170 |
| 169 } // namespace blink | 171 } // namespace blink |
| 170 | 172 |
| 171 #endif // SVGSVGElement_h | 173 #endif // SVGSVGElement_h |
| OLD | NEW |