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, 2008, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2014 Google, Inc. | 5 * Copyright (C) 2014 Google, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "core/svg/SVGViewSpec.h" | 54 #include "core/svg/SVGViewSpec.h" |
55 #include "core/svg/animation/SMILTimeContainer.h" | 55 #include "core/svg/animation/SMILTimeContainer.h" |
56 #include "platform/FloatConversion.h" | 56 #include "platform/FloatConversion.h" |
57 #include "platform/LengthFunctions.h" | 57 #include "platform/LengthFunctions.h" |
58 #include "platform/geometry/FloatRect.h" | 58 #include "platform/geometry/FloatRect.h" |
59 #include "platform/transforms/AffineTransform.h" | 59 #include "platform/transforms/AffineTransform.h" |
60 #include "wtf/StdLibExtras.h" | 60 #include "wtf/StdLibExtras.h" |
61 | 61 |
62 namespace WebCore { | 62 namespace WebCore { |
63 | 63 |
64 SVGSVGElement::SVGSVGElement(Document& doc) | 64 inline SVGSVGElement::SVGSVGElement(Document& doc) |
65 : SVGGraphicsElement(SVGNames::svgTag, doc) | 65 : SVGGraphicsElement(SVGNames::svgTag, doc) |
66 , SVGFitToViewBox(this) | 66 , SVGFitToViewBox(this) |
67 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 67 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
68 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) | 68 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
69 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) | 69 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
70 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 70 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
71 , m_useCurrentView(false) | 71 , m_useCurrentView(false) |
72 , m_timeContainer(SMILTimeContainer::create(*this)) | 72 , m_timeContainer(SMILTimeContainer::create(*this)) |
73 , m_translation(SVGPoint::create()) | 73 , m_translation(SVGPoint::create()) |
74 { | 74 { |
75 ScriptWrappable::init(this); | 75 ScriptWrappable::init(this); |
76 | 76 |
77 m_width->setDefaultValueAsString("100%"); | 77 m_width->setDefaultValueAsString("100%"); |
78 m_height->setDefaultValueAsString("100%"); | 78 m_height->setDefaultValueAsString("100%"); |
79 | 79 |
80 addToPropertyMap(m_x); | 80 addToPropertyMap(m_x); |
81 addToPropertyMap(m_y); | 81 addToPropertyMap(m_y); |
82 addToPropertyMap(m_width); | 82 addToPropertyMap(m_width); |
83 addToPropertyMap(m_height); | 83 addToPropertyMap(m_height); |
84 | 84 |
85 UseCounter::count(doc, UseCounter::SVGSVGElement); | 85 UseCounter::count(doc, UseCounter::SVGSVGElement); |
86 } | 86 } |
87 | 87 |
| 88 DEFINE_NODE_FACTORY(SVGSVGElement) |
| 89 |
88 SVGSVGElement::~SVGSVGElement() | 90 SVGSVGElement::~SVGSVGElement() |
89 { | 91 { |
90 #if !ENABLE(OILPAN) | 92 #if !ENABLE(OILPAN) |
91 if (m_viewSpec) | 93 if (m_viewSpec) |
92 m_viewSpec->detachContextElement(); | 94 m_viewSpec->detachContextElement(); |
93 | 95 |
94 // There are cases where removedFromDocument() is not called. | 96 // There are cases where removedFromDocument() is not called. |
95 // see ContainerNode::removeAllChildren, called by its destructor. | 97 // see ContainerNode::removeAllChildren, called by its destructor. |
96 // With Oilpan, either removedFrom is called or the document | 98 // With Oilpan, either removedFrom is called or the document |
97 // is dead as well and there is no reason to clear the extensions. | 99 // is dead as well and there is no reason to clear the extensions. |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 } | 781 } |
780 | 782 |
781 void SVGSVGElement::trace(Visitor* visitor) | 783 void SVGSVGElement::trace(Visitor* visitor) |
782 { | 784 { |
783 visitor->trace(m_timeContainer); | 785 visitor->trace(m_timeContainer); |
784 visitor->trace(m_viewSpec); | 786 visitor->trace(m_viewSpec); |
785 SVGGraphicsElement::trace(visitor); | 787 SVGGraphicsElement::trace(visitor); |
786 } | 788 } |
787 | 789 |
788 } | 790 } |
OLD | NEW |