diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch) | |
tree | d49911209b132da58d838efa852daf28d516df21 /WebCore/svg | |
parent | 87eb0cb35bad8784770ebc807e6c982432e47107 (diff) | |
download | external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2 |
Initial Contribution
Diffstat (limited to 'WebCore/svg')
107 files changed, 363 insertions, 511 deletions
diff --git a/WebCore/svg/SVGAngle.cpp b/WebCore/svg/SVGAngle.cpp index 81cf226..4b7efc2 100644 --- a/WebCore/svg/SVGAngle.cpp +++ b/WebCore/svg/SVGAngle.cpp @@ -31,7 +31,7 @@ namespace WebCore { SVGAngle::SVGAngle() - : RefCounted<SVGAngle>(0) + : RefCounted<SVGAngle>() , m_unitType(SVG_ANGLETYPE_UNKNOWN) , m_value(0) , m_valueInSpecifiedUnits(0) diff --git a/WebCore/svg/SVGAnimatedTemplate.h b/WebCore/svg/SVGAnimatedTemplate.h index 9f1b50b..340596d 100644 --- a/WebCore/svg/SVGAnimatedTemplate.h +++ b/WebCore/svg/SVGAnimatedTemplate.h @@ -103,11 +103,11 @@ namespace WebCore { }; template<typename BareType> - class SVGAnimatedTemplate : public RefCounted<SVGAnimatedTemplate<BareType> > { + class SVGAnimatedTemplate : public RefCounted<SVGAnimatedTemplate<BareType> > + { public: SVGAnimatedTemplate(const QualifiedName& attributeName) - : RefCounted<SVGAnimatedTemplate<BareType> >(0) - , m_associatedAttributeName(attributeName) + : m_associatedAttributeName(attributeName) { } diff --git a/WebCore/svg/SVGAnimationElement.cpp b/WebCore/svg/SVGAnimationElement.cpp index 3574306..5ccc17f 100644 --- a/WebCore/svg/SVGAnimationElement.cpp +++ b/WebCore/svg/SVGAnimationElement.cpp @@ -171,7 +171,7 @@ void SVGAnimationElement::parseBeginOrEndValue(double& number, const String& val { // TODO: Don't use SVGStringList for parsing. AtomicString dummy; - RefPtr<SVGStringList> valueList = SVGStringList::create(QualifiedName(dummy, dummy, dummy)); + RefPtr<SVGStringList> valueList = new SVGStringList(QualifiedName(dummy, dummy, dummy)); valueList->parse(value, ';'); ExceptionCode ec = 0; @@ -313,9 +313,9 @@ void SVGAnimationElement::parseMappedAttribute(MappedAttribute* attr) double SVGAnimationElement::parseClockValue(const String& data) { - String parse = data.stripWhiteSpace(); - - if (parse == "indefinite") + DeprecatedString parse = data.deprecatedString().stripWhiteSpace(); + + if (parse == "indefinite") // Saves some time... return DBL_MAX; double result; @@ -324,28 +324,28 @@ double SVGAnimationElement::parseClockValue(const String& data) int doublePointTwo = parse.find(':', doublePointOne + 1); if (doublePointOne != -1 && doublePointTwo != -1) { // Spec: "Full clock values" - unsigned hours = parse.substring(0, 2).toUIntStrict(); - unsigned minutes = parse.substring(3, 2).toUIntStrict(); - unsigned seconds = parse.substring(6, 2).toUIntStrict(); - unsigned milliseconds = 0; + unsigned int hours = parse.mid(0, 2).toUInt(); + unsigned int minutes = parse.mid(3, 2).toUInt(); + unsigned int seconds = parse.mid(6, 2).toUInt(); + unsigned int milliseconds = 0; result = (3600 * hours) + (60 * minutes) + seconds; if (parse.find('.') != -1) { - String temp = parse.substring(9, 2); - milliseconds = temp.toUIntStrict(); + DeprecatedString temp = parse.mid(9, 2); + milliseconds = temp.toUInt(); result += (milliseconds * (1 / pow(10.0, int(temp.length())))); } } else if (doublePointOne != -1 && doublePointTwo == -1) { // Spec: "Partial clock values" - unsigned minutes = parse.substring(0, 2).toUIntStrict(); - unsigned seconds = parse.substring(3, 2).toUIntStrict(); - unsigned milliseconds = 0; + unsigned int minutes = parse.mid(0, 2).toUInt(); + unsigned int seconds = parse.mid(3, 2).toUInt(); + unsigned int milliseconds = 0; result = (60 * minutes) + seconds; if (parse.find('.') != -1) { - String temp = parse.substring(6, 2); - milliseconds = temp.toUIntStrict(); + DeprecatedString temp = parse.mid(6, 2); + milliseconds = temp.toUInt(); result += (milliseconds * (1 / pow(10.0, int(temp.length())))); } } else { // Spec: "Timecount values" @@ -353,35 +353,35 @@ double SVGAnimationElement::parseClockValue(const String& data) if (parse.endsWith("h")) { if (dotPosition == -1) - result = parse.substring(0, parse.length() - 1).toUIntStrict() * 3600; + result = parse.mid(0, parse.length() - 1).toUInt() * 3600; else { - result = parse.substring(0, dotPosition).toUIntStrict() * 3600; - String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 2); - result += (3600.0 * temp.toUIntStrict()) * (1 / pow(10.0, int(temp.length()))); + result = parse.mid(0, dotPosition).toUInt() * 3600; + DeprecatedString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 2); + result += (3600.0 * temp.toUInt()) * (1 / pow(10.0, int(temp.length()))); } } else if (parse.endsWith("min")) { if (dotPosition == -1) - result = parse.substring(0, parse.length() - 3).toUIntStrict() * 60; + result = parse.mid(0, parse.length() - 3).toUInt() * 60; else { - result = parse.substring(0, dotPosition).toUIntStrict() * 60; - String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 4); - result += (60.0 * temp.toUIntStrict()) * (1 / pow(10.0, int(temp.length()))); + result = parse.mid(0, dotPosition).toUInt() * 60; + DeprecatedString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 4); + result += (60.0 * temp.toUInt()) * (1 / pow(10.0, int(temp.length()))); } } else if (parse.endsWith("ms")) { if (dotPosition == -1) - result = parse.substring(0, parse.length() - 2).toUIntStrict() / 1000.0; + result = parse.mid(0, parse.length() - 2).toUInt() / 1000.0; else { - result = parse.substring(0, dotPosition).toUIntStrict() / 1000.0; - String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 3); - result += (temp.toUIntStrict() / 1000.0) * (1 / pow(10.0, int(temp.length()))); + result = parse.mid(0, dotPosition).toUInt() / 1000.0; + DeprecatedString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 3); + result += (temp.toUInt() / 1000.0) * (1 / pow(10.0, int(temp.length()))); } } else if (parse.endsWith("s")) { if (dotPosition == -1) - result = parse.substring(0, parse.length() - 1).toUIntStrict(); + result = parse.mid(0, parse.length() - 1).toUInt(); else { - result = parse.substring(0, dotPosition).toUIntStrict(); - String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 2); - result += temp.toUIntStrict() * (1 / pow(10.0, int(temp.length()))); + result = parse.mid(0, dotPosition).toUInt(); + DeprecatedString temp = parse.mid(dotPosition + 1, parse.length() - dotPosition - 2); + result += temp.toUInt() * (1 / pow(10.0, int(temp.length()))); } } else result = parse.toDouble(); diff --git a/WebCore/svg/SVGClipPathElement.cpp b/WebCore/svg/SVGClipPathElement.cpp index 0e8ddbf..440c568 100644 --- a/WebCore/svg/SVGClipPathElement.cpp +++ b/WebCore/svg/SVGClipPathElement.cpp @@ -81,9 +81,9 @@ void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) m_clipper->invalidate(); } -void SVGClipPathElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGClipPathElement::childrenChanged(bool changedByParser) { - SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGStyledTransformableElement::childrenChanged(changedByParser); if (!m_clipper) return; @@ -94,7 +94,7 @@ void SVGClipPathElement::childrenChanged(bool changedByParser, Node* beforeChang SVGResource* SVGClipPathElement::canvasResource() { if (!m_clipper) - m_clipper = SVGResourceClipper::create(); + m_clipper = new SVGResourceClipper(); else m_clipper->resetClipData(); diff --git a/WebCore/svg/SVGClipPathElement.h b/WebCore/svg/SVGClipPathElement.h index 845aea6..af707f2 100644 --- a/WebCore/svg/SVGClipPathElement.h +++ b/WebCore/svg/SVGClipPathElement.h @@ -46,7 +46,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual SVGResource* canvasResource(); diff --git a/WebCore/svg/SVGCursorElement.cpp b/WebCore/svg/SVGCursorElement.cpp index 7a3e66c..52e2a7c 100644 --- a/WebCore/svg/SVGCursorElement.cpp +++ b/WebCore/svg/SVGCursorElement.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> + Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> This file is part of the KDE project @@ -26,29 +26,36 @@ #include "SVGCursorElement.h" #include "Attr.h" +#include "CachedImage.h" +#include "Document.h" +#include "DocLoader.h" #include "SVGNames.h" #include "SVGLength.h" namespace WebCore { -SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* doc) +SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document *doc) : SVGElement(tagName, doc) , SVGTests() , SVGExternalResourcesRequired() , SVGURIReference() + , CachedResourceClient() , m_x(0, LengthModeWidth) , m_y(0, LengthModeHeight) { + m_cachedImage = 0; } SVGCursorElement::~SVGCursorElement() { + if (m_cachedImage) + m_cachedImage->deref(this); } ANIMATED_PROPERTY_DEFINITIONS(SVGCursorElement, SVGLength, Length, length, X, x, SVGNames::xAttr, m_x) ANIMATED_PROPERTY_DEFINITIONS(SVGCursorElement, SVGLength, Length, length, Y, y, SVGNames::yAttr, m_y) -void SVGCursorElement::parseMappedAttribute(MappedAttribute* attr) +void SVGCursorElement::parseMappedAttribute(MappedAttribute *attr) { if (attr->name() == SVGNames::xAttr) setXBaseValue(SVGLength(0, LengthModeWidth, attr->value())); @@ -59,39 +66,19 @@ void SVGCursorElement::parseMappedAttribute(MappedAttribute* attr) return; if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) return; - if (SVGURIReference::parseMappedAttribute(attr)) + if (SVGURIReference::parseMappedAttribute(attr)) { + if (m_cachedImage) + m_cachedImage->deref(this); + m_cachedImage = ownerDocument()->docLoader()->requestImage(href()); + if (m_cachedImage) + m_cachedImage->ref(this); return; + } SVGElement::parseMappedAttribute(attr); } } -void SVGCursorElement::addClient(SVGElement* element) -{ - m_clients.add(element); -} - -void SVGCursorElement::removeClient(SVGElement* element) -{ - m_clients.remove(element); -} - -void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) -{ - SVGElement::svgAttributeChanged(attrName); - - if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || - SVGTests::isKnownAttribute(attrName) || - SVGExternalResourcesRequired::isKnownAttribute(attrName) || - SVGURIReference::isKnownAttribute(attrName)) { - HashSet<SVGElement*>::const_iterator it = m_clients.begin(); - HashSet<SVGElement*>::const_iterator end = m_clients.end(); - - for (; it != end; ++it) - (*it)->setChanged(); - } -} - } #endif // ENABLE(SVG) diff --git a/WebCore/svg/SVGCursorElement.h b/WebCore/svg/SVGCursorElement.h index 23a5894..2b6181d 100644 --- a/WebCore/svg/SVGCursorElement.h +++ b/WebCore/svg/SVGCursorElement.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> + Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006 Rob Buis <buis@kde.org> This file is part of the KDE project @@ -24,29 +24,34 @@ #define SVGCursorElement_h #if ENABLE(SVG) + +#include "Image.h" + #include "SVGLength.h" #include "SVGElement.h" #include "SVGTests.h" #include "SVGURIReference.h" #include "SVGExternalResourcesRequired.h" +#include "CachedResourceClient.h" -namespace WebCore { - +namespace WebCore +{ class SVGCursorElement : public SVGElement, - public SVGTests, - public SVGExternalResourcesRequired, - public SVGURIReference { + public SVGTests, + public SVGExternalResourcesRequired, + public SVGURIReference, + public CachedResourceClient + { public: SVGCursorElement(const QualifiedName&, Document*); virtual ~SVGCursorElement(); - - void addClient(SVGElement*); - void removeClient(SVGElement*); - + virtual bool isValid() const { return SVGTests::isValid(); } - virtual void parseMappedAttribute(MappedAttribute*); - virtual void svgAttributeChanged(const QualifiedName&); + // 'SVGCursorElement' functions + virtual void parseMappedAttribute(MappedAttribute *attr); + + CachedImage* cachedImage() const { return m_cachedImage; } protected: virtual const SVGElement* contextElement() const { return this; } @@ -58,10 +63,12 @@ namespace WebCore { ANIMATED_PROPERTY_DECLARATIONS(SVGCursorElement, SVGLength, SVGLength, X, x) ANIMATED_PROPERTY_DECLARATIONS(SVGCursorElement, SVGLength, SVGLength, Y, y) - HashSet<SVGElement*> m_clients; + CachedImage *m_cachedImage; }; } // namespace WebCore #endif // ENABLE(SVG) #endif + +// vim:ts=4:noet diff --git a/WebCore/svg/SVGDefinitionSrcElement.cpp b/WebCore/svg/SVGDefinitionSrcElement.cpp index 1419ec0..848ba20 100644 --- a/WebCore/svg/SVGDefinitionSrcElement.cpp +++ b/WebCore/svg/SVGDefinitionSrcElement.cpp @@ -32,9 +32,9 @@ SVGDefinitionSrcElement::SVGDefinitionSrcElement(const QualifiedName& tagName, D { } -void SVGDefinitionSrcElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGDefinitionSrcElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (parentNode() && parentNode()->hasTagName(SVGNames::font_faceTag)) static_cast<SVGFontFaceElement*>(parentNode())->rebuildFontFace(); } diff --git a/WebCore/svg/SVGDefinitionSrcElement.h b/WebCore/svg/SVGDefinitionSrcElement.h index aaefd05..111fd86 100644 --- a/WebCore/svg/SVGDefinitionSrcElement.h +++ b/WebCore/svg/SVGDefinitionSrcElement.h @@ -28,7 +28,7 @@ namespace WebCore { public: SVGDefinitionSrcElement(const QualifiedName&, Document*); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); }; } // namespace WebCore diff --git a/WebCore/svg/SVGDefsElement.cpp b/WebCore/svg/SVGDefsElement.cpp index b084bb2..6e5e541 100644 --- a/WebCore/svg/SVGDefsElement.cpp +++ b/WebCore/svg/SVGDefsElement.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> + Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006 Rob Buis <buis@kde.org> This file is part of the KDE project @@ -21,7 +21,6 @@ */ #include "config.h" - #if ENABLE(SVG) #include "SVGDefsElement.h" @@ -46,11 +45,13 @@ bool SVGDefsElement::isValid() const return SVGTests::isValid(); } -RenderObject* SVGDefsElement::createRenderer(RenderArena* arena, RenderStyle*) +RenderObject* SVGDefsElement::createRenderer(RenderArena* arena, RenderStyle* style) { return new (arena) RenderSVGHiddenContainer(this); } } +// vim:ts=4:noet #endif // ENABLE(SVG) + diff --git a/WebCore/svg/SVGDefsElement.h b/WebCore/svg/SVGDefsElement.h index 8113a99..b594ed3 100644 --- a/WebCore/svg/SVGDefsElement.h +++ b/WebCore/svg/SVGDefsElement.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> + Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005, 2006 Rob Buis <buis@kde.org> This file is part of the KDE project @@ -22,25 +22,26 @@ #ifndef SVGDefsElement_h #define SVGDefsElement_h - #if ENABLE(SVG) + #include "SVGExternalResourcesRequired.h" #include "SVGLangSpace.h" #include "SVGStyledTransformableElement.h" #include "SVGTests.h" -namespace WebCore { - +namespace WebCore +{ class SVGDefsElement : public SVGStyledTransformableElement, public SVGTests, public SVGLangSpace, - public SVGExternalResourcesRequired { + public SVGExternalResourcesRequired + { public: SVGDefsElement(const QualifiedName&, Document*); virtual ~SVGDefsElement(); - + virtual bool isValid() const; - + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); protected: @@ -54,3 +55,5 @@ namespace WebCore { #endif // ENABLE(SVG) #endif + +// vim:ts=4:noet diff --git a/WebCore/svg/SVGDescElement.h b/WebCore/svg/SVGDescElement.h index c8bc501..a2244c6 100644 --- a/WebCore/svg/SVGDescElement.h +++ b/WebCore/svg/SVGDescElement.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> + Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 2004, 2005 Rob Buis <buis@kde.org> This file is part of the KDE project @@ -22,15 +22,16 @@ #ifndef SVGDescElement_h #define SVGDescElement_h - #if ENABLE(SVG) + #include "SVGLangSpace.h" #include "SVGStyledElement.h" -namespace WebCore { - +namespace WebCore +{ class SVGDescElement : public SVGStyledElement, - public SVGLangSpace { + public SVGLangSpace + { public: SVGDescElement(const QualifiedName&, Document*); virtual ~SVGDescElement(); @@ -44,3 +45,5 @@ namespace WebCore { #endif // ENABLE(SVG) #endif + +// vim:ts=4:noet diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp index 41a62c3..ecf9736 100644 --- a/WebCore/svg/SVGElement.cpp +++ b/WebCore/svg/SVGElement.cpp @@ -116,7 +116,7 @@ SVGElement* SVGElement::viewportElement() const void SVGElement::addSVGEventListener(const AtomicString& eventType, const Attribute* attr) { Element::setHTMLEventListener(eventType, document()->accessSVGExtensions()-> - createSVGEventListener(attr->localName().string(), attr->value(), this)); + createSVGEventListener(attr->localName().domString(), attr->value(), this)); } void SVGElement::parseMappedAttribute(MappedAttribute* attr) diff --git a/WebCore/svg/SVGElementInstance.cpp b/WebCore/svg/SVGElementInstance.cpp index a416d9a..766720a 100644 --- a/WebCore/svg/SVGElementInstance.cpp +++ b/WebCore/svg/SVGElementInstance.cpp @@ -77,7 +77,7 @@ SVGElementInstance* SVGElementInstance::parentNode() const PassRefPtr<SVGElementInstanceList> SVGElementInstance::childNodes() { - return SVGElementInstanceList::create(this); + return new SVGElementInstanceList(this); } SVGElementInstance* SVGElementInstance::previousSibling() const diff --git a/WebCore/svg/SVGElementInstanceList.h b/WebCore/svg/SVGElementInstanceList.h index 6fb9412..960340a 100644 --- a/WebCore/svg/SVGElementInstanceList.h +++ b/WebCore/svg/SVGElementInstanceList.h @@ -30,14 +30,13 @@ namespace WebCore { class SVGElementInstanceList : public RefCounted<SVGElementInstanceList> { public: - static PassRefPtr<SVGElementInstanceList> create(PassRefPtr<SVGElementInstance> rootInstance) { return adoptRef(new SVGElementInstanceList(rootInstance)); } + SVGElementInstanceList(PassRefPtr<SVGElementInstance> rootInstance); virtual ~SVGElementInstanceList(); unsigned int length() const; RefPtr<SVGElementInstance> item(unsigned int index); private: - SVGElementInstanceList(PassRefPtr<SVGElementInstance> rootInstance); RefPtr<SVGElementInstance> m_rootInstance; }; } // namespace WebCore diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp index e047e8a..0abc83c 100644 --- a/WebCore/svg/SVGFETurbulenceElement.cpp +++ b/WebCore/svg/SVGFETurbulenceElement.cpp @@ -76,7 +76,7 @@ void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute* attr) } else if (attr->name() == SVGNames::seedAttr) setSeedBaseValue(value.toFloat()); else if (attr->name() == SVGNames::numOctavesAttr) - setNumOctavesBaseValue(value.toUIntStrict()); + setNumOctavesBaseValue(value.deprecatedString().toUInt()); else SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr); } diff --git a/WebCore/svg/SVGFitToViewBox.cpp b/WebCore/svg/SVGFitToViewBox.cpp index 2cf3dd7..aaaf003 100644 --- a/WebCore/svg/SVGFitToViewBox.cpp +++ b/WebCore/svg/SVGFitToViewBox.cpp @@ -37,7 +37,7 @@ namespace WebCore { SVGFitToViewBox::SVGFitToViewBox() : m_viewBox() - , m_preserveAspectRatio(SVGPreserveAspectRatio::create()) + , m_preserveAspectRatio(new SVGPreserveAspectRatio()) { } diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp index 41db763..cdf0b72 100644 --- a/WebCore/svg/SVGFontFaceElement.cpp +++ b/WebCore/svg/SVGFontFaceElement.cpp @@ -25,7 +25,6 @@ #include "CString.h" #include "CSSFontFaceRule.h" #include "CSSFontFaceSrcValue.h" -#include "CSSParser.h" #include "CSSProperty.h" #include "CSSPropertyNames.h" #include "CSSStyleSelector.h" @@ -62,9 +61,17 @@ SVGFontFaceElement::~SVGFontFaceElement() { } -static void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, int>* propertyNameToIdMap, const QualifiedName& attrName) +static inline void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, int>* propertyNameToIdMap, const QualifiedName& attrName, const char* cssPropertyName = 0) { - int propertyId = cssPropertyID(attrName.localName()); + int propertyId = 0; + if (cssPropertyName) + propertyId = getPropertyID(cssPropertyName, strlen(cssPropertyName)); + else { + CString propertyName = attrName.localName().domString().utf8(); + propertyId = getPropertyID(propertyName.data(), propertyName.length()); + } + if (propertyId < 1) + fprintf(stderr, "Failed to find property: %s\n", attrName.localName().deprecatedString().ascii()); ASSERT(propertyId > 0); propertyNameToIdMap->set(attrName.localName().impl(), propertyId); } @@ -352,9 +359,9 @@ void SVGFontFaceElement::insertedIntoDocument() rebuildFontFace(); } -void SVGFontFaceElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGFontFaceElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); rebuildFontFace(); } diff --git a/WebCore/svg/SVGFontFaceElement.h b/WebCore/svg/SVGFontFaceElement.h index 71e517f..2e62ff9 100644 --- a/WebCore/svg/SVGFontFaceElement.h +++ b/WebCore/svg/SVGFontFaceElement.h @@ -37,7 +37,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual void insertedIntoDocument(); unsigned unitsPerEm() const; diff --git a/WebCore/svg/SVGFontFaceFormatElement.cpp b/WebCore/svg/SVGFontFaceFormatElement.cpp index e6dd94b..54f463b 100644 --- a/WebCore/svg/SVGFontFaceFormatElement.cpp +++ b/WebCore/svg/SVGFontFaceFormatElement.cpp @@ -34,9 +34,9 @@ SVGFontFaceFormatElement::SVGFontFaceFormatElement(const QualifiedName& tagName, { } -void SVGFontFaceFormatElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGFontFaceFormatElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (!parentNode() || !parentNode()->hasTagName(font_face_uriTag)) return; diff --git a/WebCore/svg/SVGFontFaceFormatElement.h b/WebCore/svg/SVGFontFaceFormatElement.h index 97828cb..f20a165 100644 --- a/WebCore/svg/SVGFontFaceFormatElement.h +++ b/WebCore/svg/SVGFontFaceFormatElement.h @@ -29,7 +29,7 @@ class SVGFontFaceFormatElement : public SVGElement { public: SVGFontFaceFormatElement(const QualifiedName&, Document*); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFontFaceSrcElement.cpp b/WebCore/svg/SVGFontFaceSrcElement.cpp index 5762cd9..0a2d69f 100644 --- a/WebCore/svg/SVGFontFaceSrcElement.cpp +++ b/WebCore/svg/SVGFontFaceSrcElement.cpp @@ -50,9 +50,9 @@ PassRefPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const return list; } -void SVGFontFaceSrcElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGFontFaceSrcElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (parentNode() && parentNode()->hasTagName(font_faceTag)) static_cast<SVGFontFaceElement*>(parentNode())->rebuildFontFace(); } diff --git a/WebCore/svg/SVGFontFaceSrcElement.h b/WebCore/svg/SVGFontFaceSrcElement.h index b86f689..202ac34 100644 --- a/WebCore/svg/SVGFontFaceSrcElement.h +++ b/WebCore/svg/SVGFontFaceSrcElement.h @@ -31,7 +31,7 @@ namespace WebCore { PassRefPtr<CSSValueList> srcValue() const; - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFontFaceUriElement.cpp b/WebCore/svg/SVGFontFaceUriElement.cpp index 2f4b99f..06781d7 100644 --- a/WebCore/svg/SVGFontFaceUriElement.cpp +++ b/WebCore/svg/SVGFontFaceUriElement.cpp @@ -44,9 +44,9 @@ PassRefPtr<CSSFontFaceSrcValue> SVGFontFaceUriElement::srcValue() const return src.release(); } -void SVGFontFaceUriElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGFontFaceUriElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (!parentNode() || !parentNode()->hasTagName(font_face_srcTag)) return; diff --git a/WebCore/svg/SVGFontFaceUriElement.h b/WebCore/svg/SVGFontFaceUriElement.h index cdeb743..488365f 100644 --- a/WebCore/svg/SVGFontFaceUriElement.h +++ b/WebCore/svg/SVGFontFaceUriElement.h @@ -31,7 +31,7 @@ namespace WebCore { PassRefPtr<CSSFontFaceSrcValue> srcValue() const; - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); }; } // namespace WebCore diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp index 688a916..1d6e2d2 100644 --- a/WebCore/svg/SVGForeignObjectElement.cpp +++ b/WebCore/svg/SVGForeignObjectElement.cpp @@ -1,6 +1,5 @@ /* Copyright (C) 2006 Apple Computer, Inc. - (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> This file is part of the WebKit project @@ -55,18 +54,20 @@ ANIMATED_PROPERTY_DEFINITIONS(SVGForeignObjectElement, SVGLength, Length, length ANIMATED_PROPERTY_DEFINITIONS(SVGForeignObjectElement, SVGLength, Length, length, Width, width, SVGNames::widthAttr, m_width) ANIMATED_PROPERTY_DEFINITIONS(SVGForeignObjectElement, SVGLength, Length, length, Height, height, SVGNames::heightAttr, m_height) -void SVGForeignObjectElement::parseMappedAttribute(MappedAttribute* attr) +void SVGForeignObjectElement::parseMappedAttribute(MappedAttribute *attr) { const AtomicString& value = attr->value(); if (attr->name() == SVGNames::xAttr) setXBaseValue(SVGLength(this, LengthModeWidth, value)); else if (attr->name() == SVGNames::yAttr) setYBaseValue(SVGLength(this, LengthModeHeight, value)); - else if (attr->name() == SVGNames::widthAttr) + else if (attr->name() == SVGNames::widthAttr) { setWidthBaseValue(SVGLength(this, LengthModeWidth, value)); - else if (attr->name() == SVGNames::heightAttr) + addCSSProperty(attr, CSS_PROP_WIDTH, value); + } else if (attr->name() == SVGNames::heightAttr) { setHeightBaseValue(SVGLength(this, LengthModeHeight, value)); - else { + addCSSProperty(attr, CSS_PROP_HEIGHT, value); + } else { if (SVGTests::parseMappedAttribute(attr)) return; if (SVGLangSpace::parseMappedAttribute(attr)) @@ -77,83 +78,6 @@ void SVGForeignObjectElement::parseMappedAttribute(MappedAttribute* attr) } } -// TODO: Move this function in some SVG*Element base class, as SVGSVGElement / SVGImageElement will need the same logic! - -// This function mimics addCSSProperty and StyledElement::attributeChanged. -// In HTML code, you'd always call addCSSProperty from your derived parseMappedAttribute() -// function - though in SVG code we need to move this logic into svgAttributeChanged, in -// order to support SVG DOM changes (which don't use the parseMappedAttribute/attributeChanged). -// If we'd ignore SVG DOM, we could use _exactly_ the same logic as HTML. -static inline void addCSSPropertyAndNotifyAttributeMap(StyledElement* element, const QualifiedName& name, int cssProperty, const String& value) -{ - ASSERT(element); - - if (!element) - return; - - NamedMappedAttrMap* attrs = element->mappedAttributes(); - ASSERT(attrs); - - if (!attrs) - return; - - MappedAttribute* mappedAttr = attrs->getAttributeItem(name); - if (!mappedAttr) - return; - - // This logic is only meant to be used for entries that have to be parsed and are mapped to eNone. Assert that. - MappedAttributeEntry entry; - bool needToParse = element->mapToEntry(mappedAttr->name(), entry); - - ASSERT(needToParse); - ASSERT(entry == eNone); - - if (!needToParse || entry != eNone) - return; - - if (mappedAttr->decl()) { - mappedAttr->setDecl(0); - attrs->declRemoved(); - } - - element->setChanged(); - element->addCSSProperty(mappedAttr, cssProperty, value); - - if (CSSMappedAttributeDeclaration* decl = mappedAttr->decl()) { - // Add the decl to the table in the appropriate spot. - element->setMappedAttributeDecl(entry, mappedAttr, decl); - - decl->setMappedState(entry, mappedAttr->name(), mappedAttr->value()); - decl->setParent(0); - decl->setNode(0); - - attrs->declAdded(); - } -} - -void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) -{ - SVGStyledTransformableElement::svgAttributeChanged(attrName); - - if (attrName == SVGNames::widthAttr) { - addCSSPropertyAndNotifyAttributeMap(this, attrName, CSS_PROP_WIDTH, width().valueAsString()); - return; - } else if (attrName == SVGNames::heightAttr) { - addCSSPropertyAndNotifyAttributeMap(this, attrName, CSS_PROP_HEIGHT, height().valueAsString()); - return; - } - - if (!renderer()) - return; - - if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || - SVGTests::isKnownAttribute(attrName) || - SVGLangSpace::isKnownAttribute(attrName) || - SVGExternalResourcesRequired::isKnownAttribute(attrName) || - SVGStyledTransformableElement::isKnownAttribute(attrName)) - renderer()->setNeedsLayout(true); -} - RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, RenderStyle* style) { return new (arena) RenderForeignObject(this); @@ -168,3 +92,5 @@ bool SVGForeignObjectElement::childShouldCreateRenderer(Node* child) const } // namespace WebCore #endif // ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT) + +// vim:ts=4:noet diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h index f0c9830..c0d4c04 100644 --- a/WebCore/svg/SVGForeignObjectElement.h +++ b/WebCore/svg/SVGForeignObjectElement.h @@ -23,27 +23,30 @@ #define SVGForeignObjectElement_h #if ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT) + #include "SVGTests.h" #include "SVGLangSpace.h" #include "SVGURIReference.h" #include "SVGStyledTransformableElement.h" #include "SVGExternalResourcesRequired.h" -namespace WebCore { +namespace WebCore +{ class SVGLength; + class SVGDocument; class SVGForeignObjectElement : public SVGStyledTransformableElement, - public SVGTests, - public SVGLangSpace, - public SVGExternalResourcesRequired, - public SVGURIReference { + public SVGTests, + public SVGLangSpace, + public SVGExternalResourcesRequired, + public SVGURIReference + { public: SVGForeignObjectElement(const QualifiedName&, Document*); virtual ~SVGForeignObjectElement(); - + virtual bool isValid() const { return SVGTests::isValid(); } virtual void parseMappedAttribute(MappedAttribute*); - virtual void svgAttributeChanged(const QualifiedName&); bool childShouldCreateRenderer(Node*) const; virtual RenderObject* createRenderer(RenderArena* arena, RenderStyle* style); @@ -65,3 +68,5 @@ namespace WebCore { #endif // ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT) #endif + +// vim:ts=4:noet diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp index 2b50d74..08a79e7 100644 --- a/WebCore/svg/SVGGElement.cpp +++ b/WebCore/svg/SVGGElement.cpp @@ -49,7 +49,6 @@ void SVGGElement::parseMappedAttribute(MappedAttribute* attr) return; if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) return; - SVGStyledTransformableElement::parseMappedAttribute(attr); } @@ -60,22 +59,23 @@ void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) if (!renderer()) return; - if (SVGTests::isKnownAttribute(attrName) || + if (attrName == SVGNames::clipPathUnitsAttr || + SVGTests::isKnownAttribute(attrName) || SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName) || SVGStyledTransformableElement::isKnownAttribute(attrName)) renderer()->setNeedsLayout(true); } -void SVGGElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGGElement::childrenChanged(bool changedByParser) { - SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGStyledTransformableElement::childrenChanged(changedByParser); if (renderer()) renderer()->setNeedsLayout(true); } -RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle*) +RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style) { return new (arena) RenderSVGTransformableContainer(this); } diff --git a/WebCore/svg/SVGGElement.h b/WebCore/svg/SVGGElement.h index 9237ef8..25cd712 100644 --- a/WebCore/svg/SVGGElement.h +++ b/WebCore/svg/SVGGElement.h @@ -43,7 +43,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); diff --git a/WebCore/svg/SVGGradientElement.cpp b/WebCore/svg/SVGGradientElement.cpp index 4cd527f..88c2bd9 100644 --- a/WebCore/svg/SVGGradientElement.cpp +++ b/WebCore/svg/SVGGradientElement.cpp @@ -44,7 +44,7 @@ SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* d , SVGExternalResourcesRequired() , m_spreadMethod(0) , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) - , m_gradientTransform(SVGTransformList::create(SVGNames::gradientTransformAttr)) + , m_gradientTransform(new SVGTransformList(SVGNames::gradientTransformAttr)) { } @@ -102,9 +102,9 @@ void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName) m_resource->invalidate(); } -void SVGGradientElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGGradientElement::childrenChanged(bool changedByParser) { - SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGStyledElement::childrenChanged(changedByParser); if (m_resource) m_resource->invalidate(); @@ -119,9 +119,9 @@ SVGResource* SVGGradientElement::canvasResource() { if (!m_resource) { if (gradientType() == LinearGradientPaintServer) - m_resource = SVGPaintServerLinearGradient::create(this); + m_resource = new SVGPaintServerLinearGradient(this); else - m_resource = SVGPaintServerRadialGradient::create(this); + m_resource = new SVGPaintServerRadialGradient(this); } return m_resource.get(); diff --git a/WebCore/svg/SVGGradientElement.h b/WebCore/svg/SVGGradientElement.h index 25579d0..420562f 100644 --- a/WebCore/svg/SVGGradientElement.h +++ b/WebCore/svg/SVGGradientElement.h @@ -51,7 +51,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual SVGResource* canvasResource(); diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp index c17d978..2c6cf33 100644 --- a/WebCore/svg/SVGImageElement.cpp +++ b/WebCore/svg/SVGImageElement.cpp @@ -47,7 +47,7 @@ SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* doc) , m_y(this, LengthModeHeight) , m_width(this, LengthModeWidth) , m_height(this, LengthModeHeight) - , m_preserveAspectRatio(SVGPreserveAspectRatio::create()) + , m_preserveAspectRatio(new SVGPreserveAspectRatio()) , m_imageLoader(this) { } diff --git a/WebCore/svg/SVGImageLoader.cpp b/WebCore/svg/SVGImageLoader.cpp index 6377266..c8ec8ad 100644 --- a/WebCore/svg/SVGImageLoader.cpp +++ b/WebCore/svg/SVGImageLoader.cpp @@ -51,15 +51,15 @@ void SVGImageLoader::updateFromElement() CachedImage *newImage = 0; if (!imageElement->href().isEmpty()) { - KURL uri = imageElement->baseURI(); + DeprecatedString uri = imageElement->baseURI().deprecatedString(); if (!uri.isEmpty()) - uri = KURL(uri, imageElement->href()); + uri = KURL(uri, imageElement->href().deprecatedString()).deprecatedString(); else - uri = KURL(imageElement->href()); - newImage = doc->docLoader()->requestImage(uri.string()); + uri = imageElement->href().deprecatedString(); + newImage = doc->docLoader()->requestImage(uri); } - CachedImage* oldImage = image(); + CachedImage *oldImage = image(); if (newImage != oldImage) { setLoadingImage(newImage); if (newImage) diff --git a/WebCore/svg/SVGLengthList.h b/WebCore/svg/SVGLengthList.h index a2c615d..af365a1 100644 --- a/WebCore/svg/SVGLengthList.h +++ b/WebCore/svg/SVGLengthList.h @@ -31,13 +31,10 @@ namespace WebCore { class SVGLengthList : public SVGPODList<SVGLength> { public: - static PassRefPtr<SVGLengthList> create(const QualifiedName& attributeName) { return adoptRef(new SVGLengthList(attributeName)); } + SVGLengthList(const QualifiedName&); virtual ~SVGLengthList(); void parse(const String& value, const SVGStyledElement* context, SVGLengthMode mode); - - private: - SVGLengthList(const QualifiedName&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGList.h b/WebCore/svg/SVGList.h index d4f7641..92c7068 100644 --- a/WebCore/svg/SVGList.h +++ b/WebCore/svg/SVGList.h @@ -28,7 +28,6 @@ #include "SVGListTraits.h" #include <wtf/RefCounted.h> -#include <wtf/PassRefPtr.h> #include <wtf/Vector.h> namespace WebCore { @@ -49,7 +48,12 @@ namespace WebCore { typedef SVGListTypeOperations<Item> TypeOperations; public: - virtual ~SVGList() { } + SVGList(const QualifiedName& attributeName) + : m_associatedAttributeName(attributeName) + { + } + + virtual ~SVGList() { m_vector.clear(); } const QualifiedName& associatedAttributeName() const { return m_associatedAttributeName; } @@ -129,12 +133,6 @@ namespace WebCore { return newItem; } - protected: - SVGList(const QualifiedName& attributeName) - : m_associatedAttributeName(attributeName) - { - } - private: Vector<Item> m_vector; const QualifiedName& m_associatedAttributeName; @@ -143,8 +141,8 @@ namespace WebCore { template<typename Item> class SVGPODListItem : public RefCounted<SVGPODListItem<Item> > { public: - static PassRefPtr<SVGPODListItem> create() { return adoptRef(new SVGPODListItem); } - static PassRefPtr<SVGPODListItem> copy(const Item& item) { return adoptRef(new SVGPODListItem(item)); } + SVGPODListItem() : m_item() { } + SVGPODListItem(const Item& item) : m_item(item) { } operator Item&() { return m_item; } operator const Item&() const { return m_item; } @@ -154,9 +152,6 @@ namespace WebCore { void setValue(Item newItem) { m_item = newItem; } private: - SVGPODListItem() : m_item() { } - SVGPODListItem(const Item& item) : RefCounted<SVGPODListItem<Item> >(), m_item(item) { } - Item m_item; }; @@ -164,9 +159,11 @@ namespace WebCore { class SVGPODList : public SVGList<RefPtr<SVGPODListItem<Item> > > { public: + SVGPODList(const QualifiedName& attributeName) : SVGList<RefPtr<SVGPODListItem<Item> > >(attributeName) { } + Item initialize(Item newItem, ExceptionCode& ec) { - SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::initialize(SVGPODListItem<Item>::copy(newItem), ec).get()); + SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::initialize(new SVGPODListItem<Item>(newItem), ec).get()); if (!ptr) return Item(); @@ -211,7 +208,7 @@ namespace WebCore { Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode& ec) { - SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::insertItemBefore(SVGPODListItem<Item>::copy(newItem), index, ec).get()); + SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::insertItemBefore(new SVGPODListItem<Item>(newItem), index, ec).get()); if (!ptr) return Item(); @@ -220,7 +217,7 @@ namespace WebCore { Item replaceItem(Item newItem, unsigned int index, ExceptionCode& ec) { - SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::replaceItem(SVGPODListItem<Item>::copy(newItem), index, ec).get()); + SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::replaceItem(new SVGPODListItem<Item>(newItem), index, ec).get()); if (!ptr) return Item(); @@ -238,16 +235,12 @@ namespace WebCore { Item appendItem(Item newItem, ExceptionCode& ec) { - SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::appendItem(SVGPODListItem<Item>::copy(newItem), ec).get()); + SVGPODListItem<Item>* ptr(SVGList<RefPtr<SVGPODListItem<Item> > >::appendItem(new SVGPODListItem<Item>(newItem), ec).get()); if (!ptr) return Item(); return static_cast<const Item&>(*ptr); } - - protected: - SVGPODList(const QualifiedName& attributeName) - : SVGList<RefPtr<SVGPODListItem<Item> > >(attributeName) { } }; } // namespace WebCore diff --git a/WebCore/svg/SVGMarkerElement.cpp b/WebCore/svg/SVGMarkerElement.cpp index 60d6a51..5883bb5 100644 --- a/WebCore/svg/SVGMarkerElement.cpp +++ b/WebCore/svg/SVGMarkerElement.cpp @@ -120,9 +120,9 @@ void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) } } -void SVGMarkerElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGMarkerElement::childrenChanged(bool changedByParser) { - SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGStyledElement::childrenChanged(changedByParser); if (renderer()) renderer()->setNeedsLayout(true); @@ -145,7 +145,7 @@ void SVGMarkerElement::setOrientToAngle(SVGAngle* angle) SVGResource* SVGMarkerElement::canvasResource() { if (!m_marker) - m_marker = SVGResourceMarker::create(); + m_marker = new SVGResourceMarker(); m_marker->setMarker(static_cast<RenderSVGViewportContainer*>(renderer())); diff --git a/WebCore/svg/SVGMarkerElement.h b/WebCore/svg/SVGMarkerElement.h index 3e6cf25..9eaf189 100644 --- a/WebCore/svg/SVGMarkerElement.h +++ b/WebCore/svg/SVGMarkerElement.h @@ -60,7 +60,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual SVGResource* canvasResource(); diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp index 723fefa..9bb2373 100644 --- a/WebCore/svg/SVGMaskElement.cpp +++ b/WebCore/svg/SVGMaskElement.cpp @@ -126,9 +126,9 @@ void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) m_masker->invalidate(); } -void SVGMaskElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGMaskElement::childrenChanged(bool changedByParser) { - SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGStyledElement::childrenChanged(changedByParser); if (!m_masker) return; @@ -217,7 +217,7 @@ RenderObject* SVGMaskElement::createRenderer(RenderArena* arena, RenderStyle*) SVGResource* SVGMaskElement::canvasResource() { if (!m_masker) - m_masker = SVGResourceMasker::create(this); + m_masker = new SVGResourceMasker(this); return m_masker.get(); } diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h index cd44baf..b5580bf 100644 --- a/WebCore/svg/SVGMaskElement.h +++ b/WebCore/svg/SVGMaskElement.h @@ -46,7 +46,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual SVGResource* canvasResource(); diff --git a/WebCore/svg/SVGNumberList.h b/WebCore/svg/SVGNumberList.h index cd5957b..1fae5fe 100644 --- a/WebCore/svg/SVGNumberList.h +++ b/WebCore/svg/SVGNumberList.h @@ -25,7 +25,6 @@ #if ENABLE(SVG) #include "SVGList.h" -#include <wtf/PassRefPtr.h> namespace WebCore { @@ -33,13 +32,10 @@ namespace WebCore { class SVGNumberList : public SVGList<float> { public: - static PassRefPtr<SVGNumberList> create(const QualifiedName& attributeName) { return adoptRef(new SVGNumberList(attributeName)); } + SVGNumberList(const QualifiedName&); virtual ~SVGNumberList(); void parse(const String& value); - - private: - SVGNumberList(const QualifiedName&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp index 2375735..2f36b40 100644 --- a/WebCore/svg/SVGPathElement.cpp +++ b/WebCore/svg/SVGPathElement.cpp @@ -76,99 +76,99 @@ unsigned long SVGPathElement::getPathSegAtLength(float length) return pathSegList()->getPathSegAtLength(length); } -PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath() +SVGPathSegClosePath* SVGPathElement::createSVGPathSegClosePath() { - return SVGPathSegClosePath::create(); + return new SVGPathSegClosePath(); } -PassRefPtr<SVGPathSegMovetoAbs> SVGPathElement::createSVGPathSegMovetoAbs(float x, float y) +SVGPathSegMovetoAbs* SVGPathElement::createSVGPathSegMovetoAbs(float x, float y) { - return SVGPathSegMovetoAbs::create(x, y); + return new SVGPathSegMovetoAbs(x, y); } -PassRefPtr<SVGPathSegMovetoRel> SVGPathElement::createSVGPathSegMovetoRel(float x, float y) +SVGPathSegMovetoRel* SVGPathElement::createSVGPathSegMovetoRel(float x, float y) { - return SVGPathSegMovetoRel::create(x, y); + return new SVGPathSegMovetoRel(x, y); } -PassRefPtr<SVGPathSegLinetoAbs> SVGPathElement::createSVGPathSegLinetoAbs(float x, float y) +SVGPathSegLinetoAbs* SVGPathElement::createSVGPathSegLinetoAbs(float x, float y) { - return SVGPathSegLinetoAbs::create(x, y); + return new SVGPathSegLinetoAbs(x, y); } -PassRefPtr<SVGPathSegLinetoRel> SVGPathElement::createSVGPathSegLinetoRel(float x, float y) +SVGPathSegLinetoRel* SVGPathElement::createSVGPathSegLinetoRel(float x, float y) { - return SVGPathSegLinetoRel::create(x, y); + return new SVGPathSegLinetoRel(x, y); } -PassRefPtr<SVGPathSegCurvetoCubicAbs> SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2) +SVGPathSegCurvetoCubicAbs* SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2) { - return SVGPathSegCurvetoCubicAbs::create(x, y, x1, y1, x2, y2); + return new SVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2); } -PassRefPtr<SVGPathSegCurvetoCubicRel> SVGPathElement::createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2) +SVGPathSegCurvetoCubicRel* SVGPathElement::createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2) { - return SVGPathSegCurvetoCubicRel::create(x, y, x1, y1, x2, y2); + return new SVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2); } -PassRefPtr<SVGPathSegCurvetoQuadraticAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1) +SVGPathSegCurvetoQuadraticAbs* SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1) { - return SVGPathSegCurvetoQuadraticAbs::create(x, y, x1, y1); + return new SVGPathSegCurvetoQuadraticAbs(x, y, x1, y1); } -PassRefPtr<SVGPathSegCurvetoQuadraticRel> SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1) +SVGPathSegCurvetoQuadraticRel* SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1) { - return SVGPathSegCurvetoQuadraticRel::create(x, y, x1, y1); + return new SVGPathSegCurvetoQuadraticRel(x, y, x1, y1); } -PassRefPtr<SVGPathSegArcAbs> SVGPathElement::createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) +SVGPathSegArcAbs* SVGPathElement::createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) { - return SVGPathSegArcAbs::create(x, y, r1, r2, angle, largeArcFlag, sweepFlag); + return new SVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag); } -PassRefPtr<SVGPathSegArcRel> SVGPathElement::createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) +SVGPathSegArcRel* SVGPathElement::createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) { - return SVGPathSegArcRel::create(x, y, r1, r2, angle, largeArcFlag, sweepFlag); + return new SVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag); } -PassRefPtr<SVGPathSegLinetoHorizontalAbs> SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x) +SVGPathSegLinetoHorizontalAbs* SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x) { - return SVGPathSegLinetoHorizontalAbs::create(x); + return new SVGPathSegLinetoHorizontalAbs(x); } -PassRefPtr<SVGPathSegLinetoHorizontalRel> SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x) +SVGPathSegLinetoHorizontalRel* SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x) { - return SVGPathSegLinetoHorizontalRel::create(x); + return new SVGPathSegLinetoHorizontalRel(x); } -PassRefPtr<SVGPathSegLinetoVerticalAbs> SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y) +SVGPathSegLinetoVerticalAbs* SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y) { - return SVGPathSegLinetoVerticalAbs::create(y); + return new SVGPathSegLinetoVerticalAbs(y); } -PassRefPtr<SVGPathSegLinetoVerticalRel> SVGPathElement::createSVGPathSegLinetoVerticalRel(float y) +SVGPathSegLinetoVerticalRel* SVGPathElement::createSVGPathSegLinetoVerticalRel(float y) { - return SVGPathSegLinetoVerticalRel::create(y); + return new SVGPathSegLinetoVerticalRel(y); } -PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2) +SVGPathSegCurvetoCubicSmoothAbs* SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2) { - return SVGPathSegCurvetoCubicSmoothAbs::create(x, y, x2, y2); + return new SVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2); } -PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2) +SVGPathSegCurvetoCubicSmoothRel* SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2) { - return SVGPathSegCurvetoCubicSmoothRel::create(x, y, x2, y2); + return new SVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2); } -PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y) +SVGPathSegCurvetoQuadraticSmoothAbs* SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y) { - return SVGPathSegCurvetoQuadraticSmoothAbs::create(x, y); + return new SVGPathSegCurvetoQuadraticSmoothAbs(x, y); } -PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y) +SVGPathSegCurvetoQuadraticSmoothRel* SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y) { - return SVGPathSegCurvetoQuadraticSmoothRel::create(x, y); + return new SVGPathSegCurvetoQuadraticSmoothRel(x, y); } void SVGPathElement::parseMappedAttribute(MappedAttribute* attr) @@ -211,7 +211,7 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) SVGPathSegList* SVGPathElement::pathSegList() const { if (!m_pathSegList) - m_pathSegList = SVGPathSegList::create(SVGNames::dAttr); + m_pathSegList = new SVGPathSegList(SVGNames::dAttr); return m_pathSegList.get(); } diff --git a/WebCore/svg/SVGPathElement.h b/WebCore/svg/SVGPathElement.h index 140e8b1..76a8ec4 100644 --- a/WebCore/svg/SVGPathElement.h +++ b/WebCore/svg/SVGPathElement.h @@ -67,25 +67,25 @@ namespace WebCore { FloatPoint getPointAtLength(float distance); unsigned long getPathSegAtLength(float distance); - static PassRefPtr<SVGPathSegClosePath> createSVGPathSegClosePath(); - static PassRefPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y); - static PassRefPtr<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y); - static PassRefPtr<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float x, float y); - static PassRefPtr<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float x, float y); - static PassRefPtr<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2); - static PassRefPtr<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2); - static PassRefPtr<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1); - static PassRefPtr<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1); - static PassRefPtr<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); - static PassRefPtr<SVGPathSegArcRel> createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); - static PassRefPtr<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLinetoHorizontalAbs(float x); - static PassRefPtr<SVGPathSegLinetoHorizontalRel> createSVGPathSegLinetoHorizontalRel(float x); - static PassRefPtr<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVerticalAbs(float y); - static PassRefPtr<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVerticalRel(float y); - static PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2); - static PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2); - static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y); - static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y); + static SVGPathSegClosePath* createSVGPathSegClosePath(); + static SVGPathSegMovetoAbs* createSVGPathSegMovetoAbs(float x, float y); + static SVGPathSegMovetoRel* createSVGPathSegMovetoRel(float x, float y); + static SVGPathSegLinetoAbs* createSVGPathSegLinetoAbs(float x, float y); + static SVGPathSegLinetoRel* createSVGPathSegLinetoRel(float x, float y); + static SVGPathSegCurvetoCubicAbs* createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2); + static SVGPathSegCurvetoCubicRel* createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2); + static SVGPathSegCurvetoQuadraticAbs* createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1); + static SVGPathSegCurvetoQuadraticRel* createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1); + static SVGPathSegArcAbs* createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); + static SVGPathSegArcRel* createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); + static SVGPathSegLinetoHorizontalAbs* createSVGPathSegLinetoHorizontalAbs(float x); + static SVGPathSegLinetoHorizontalRel* createSVGPathSegLinetoHorizontalRel(float x); + static SVGPathSegLinetoVerticalAbs* createSVGPathSegLinetoVerticalAbs(float y); + static SVGPathSegLinetoVerticalRel* createSVGPathSegLinetoVerticalRel(float y); + static SVGPathSegCurvetoCubicSmoothAbs* createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2); + static SVGPathSegCurvetoCubicSmoothRel* createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2); + static SVGPathSegCurvetoQuadraticSmoothAbs* createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y); + static SVGPathSegCurvetoQuadraticSmoothRel* createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y); // Derived from: 'SVGAnimatedPathData' virtual SVGPathSegList* pathSegList() const; diff --git a/WebCore/svg/SVGPathSeg.h b/WebCore/svg/SVGPathSeg.h index ed8ead4..11f714b 100644 --- a/WebCore/svg/SVGPathSeg.h +++ b/WebCore/svg/SVGPathSeg.h @@ -29,12 +29,15 @@ #include <wtf/RefCounted.h> -namespace WebCore { +namespace WebCore +{ class SVGPathElement; class SVGStyledElement; - class SVGPathSeg : public RefCounted<SVGPathSeg> { + class SVGPathSeg : public RefCounted<SVGPathSeg> + { public: + SVGPathSeg() { } virtual ~SVGPathSeg() { } enum SVGPathSegType { @@ -65,9 +68,6 @@ namespace WebCore { virtual String toString() const { return ""; } const QualifiedName& associatedAttributeName() const { return SVGNames::dAttr; } - - protected: - SVGPathSeg() { } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegArc.h b/WebCore/svg/SVGPathSegArc.h index 06f08f5..1a2e544 100644 --- a/WebCore/svg/SVGPathSegArc.h +++ b/WebCore/svg/SVGPathSegArc.h @@ -31,11 +31,7 @@ namespace WebCore { class SVGPathSegArcAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegArcAbs> create(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) - { - return adoptRef(new SVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag)); - } - + SVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); virtual ~SVGPathSegArcAbs(); virtual unsigned short pathSegType() const { return PATHSEG_ARC_ABS; } @@ -64,8 +60,6 @@ namespace WebCore { bool sweepFlag() const; private: - SVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); - float m_x; float m_y; float m_r1; @@ -78,10 +72,7 @@ namespace WebCore { class SVGPathSegArcRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegArcRel> create(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) - { - return adoptRef(new SVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag)); - } + SVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); virtual ~SVGPathSegArcRel(); virtual unsigned short pathSegType() const { return PATHSEG_ARC_REL; } @@ -110,8 +101,6 @@ namespace WebCore { bool sweepFlag() const; private: - SVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); - float m_x; float m_y; float m_r1; diff --git a/WebCore/svg/SVGPathSegClosePath.h b/WebCore/svg/SVGPathSegClosePath.h index eb74dea..ce573e8 100644 --- a/WebCore/svg/SVGPathSegClosePath.h +++ b/WebCore/svg/SVGPathSegClosePath.h @@ -32,15 +32,12 @@ namespace WebCore class SVGPathSegClosePath : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegClosePath> create() { return adoptRef(new SVGPathSegClosePath); } + SVGPathSegClosePath(); virtual ~SVGPathSegClosePath(); virtual unsigned short pathSegType() const { return PATHSEG_CLOSEPATH; } virtual String pathSegTypeAsLetter() const { return "Z"; } virtual String toString() const { return "Z"; } - - private: - SVGPathSegClosePath(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegCurvetoCubic.h b/WebCore/svg/SVGPathSegCurvetoCubic.h index b30d860..fdb1667 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubic.h +++ b/WebCore/svg/SVGPathSegCurvetoCubic.h @@ -30,11 +30,7 @@ namespace WebCore { class SVGPathSegCurvetoCubicAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoCubicAbs> create(float x, float y, float x1, float y1, float x2, float y2) - { - return adoptRef(new SVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2)); - } - + SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2); virtual ~SVGPathSegCurvetoCubicAbs(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_ABS; } @@ -60,8 +56,6 @@ namespace WebCore { float y2() const; private: - SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2); - float m_x; float m_y; float m_x1; @@ -72,10 +66,7 @@ namespace WebCore { class SVGPathSegCurvetoCubicRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoCubicRel> create(float x, float y, float x1, float y1, float x2, float y2) - { - return adoptRef(new SVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2)); - } + SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2); virtual ~SVGPathSegCurvetoCubicRel(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_REL; } @@ -101,8 +92,6 @@ namespace WebCore { float y2() const; private: - SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2); - float m_x; float m_y; float m_x1; diff --git a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h index c99c107..4c25181 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h +++ b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h @@ -31,7 +31,7 @@ namespace WebCore { class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> create(float x, float y, float x2, float y2) { return adoptRef(new SVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2)); } + SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2); virtual ~SVGPathSegCurvetoCubicSmoothAbs(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; } @@ -51,8 +51,6 @@ namespace WebCore { float y2() const; private: - SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2); - float m_x; float m_y; float m_x2; @@ -61,7 +59,7 @@ namespace WebCore { class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> create(float x, float y, float x2, float y2) { return adoptRef(new SVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2)); } + SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2); virtual ~SVGPathSegCurvetoCubicSmoothRel(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; } @@ -81,8 +79,6 @@ namespace WebCore { float y2() const; private: - SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2); - float m_x; float m_y; float m_x2; diff --git a/WebCore/svg/SVGPathSegCurvetoQuadratic.h b/WebCore/svg/SVGPathSegCurvetoQuadratic.h index 357ddc4..2d133f2 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadratic.h +++ b/WebCore/svg/SVGPathSegCurvetoQuadratic.h @@ -31,7 +31,7 @@ namespace WebCore { class SVGPathSegCurvetoQuadraticAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoQuadraticAbs> create(float x, float y, float x1, float y1) { return adoptRef(new SVGPathSegCurvetoQuadraticAbs(x, y, x1, y1)); } + SVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1); virtual ~SVGPathSegCurvetoQuadraticAbs(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_ABS; } @@ -51,8 +51,6 @@ namespace WebCore { float y1() const; private: - SVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1); - float m_x; float m_y; float m_x1; @@ -61,7 +59,7 @@ namespace WebCore { class SVGPathSegCurvetoQuadraticRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoQuadraticRel> create(float x, float y, float x1, float y1) { return adoptRef(new SVGPathSegCurvetoQuadraticRel(x, y, x1, y1)); } + SVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1); virtual ~SVGPathSegCurvetoQuadraticRel(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_REL; } @@ -81,8 +79,6 @@ namespace WebCore { float y1() const; private: - SVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1); - float m_x; float m_y; float m_x1; diff --git a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h index 86193fa..2490e33 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h +++ b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h @@ -31,7 +31,7 @@ namespace WebCore { class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> create(float x, float y) { return adoptRef(new SVGPathSegCurvetoQuadraticSmoothAbs(x, y)); } + SVGPathSegCurvetoQuadraticSmoothAbs(float x, float y); virtual ~SVGPathSegCurvetoQuadraticSmoothAbs(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; } @@ -45,15 +45,13 @@ namespace WebCore { float y() const; private: - SVGPathSegCurvetoQuadraticSmoothAbs(float x, float y); - float m_x; float m_y; }; class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> create(float x, float y) { return adoptRef(new SVGPathSegCurvetoQuadraticSmoothRel(x, y)); } + SVGPathSegCurvetoQuadraticSmoothRel(float x, float y); virtual ~SVGPathSegCurvetoQuadraticSmoothRel(); virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; } @@ -67,8 +65,6 @@ namespace WebCore { float y() const; private: - SVGPathSegCurvetoQuadraticSmoothRel(float x, float y); - float m_x; float m_y; }; diff --git a/WebCore/svg/SVGPathSegLineto.h b/WebCore/svg/SVGPathSegLineto.h index 0110891..b2f30fc 100644 --- a/WebCore/svg/SVGPathSegLineto.h +++ b/WebCore/svg/SVGPathSegLineto.h @@ -30,7 +30,7 @@ namespace WebCore { class SVGPathSegLinetoAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegLinetoAbs> create(float x, float y) { return adoptRef(new SVGPathSegLinetoAbs(x, y)); } + SVGPathSegLinetoAbs(float x, float y); virtual ~SVGPathSegLinetoAbs(); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_ABS; } @@ -44,15 +44,13 @@ namespace WebCore { float y() const; private: - SVGPathSegLinetoAbs(float x, float y); - float m_x; float m_y; }; class SVGPathSegLinetoRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegLinetoRel> create(float x, float y) { return adoptRef(new SVGPathSegLinetoRel(x, y)); } + SVGPathSegLinetoRel(float x, float y); virtual ~SVGPathSegLinetoRel(); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_REL; } @@ -66,8 +64,6 @@ namespace WebCore { float y() const; private: - SVGPathSegLinetoRel(float x, float y); - float m_x; float m_y; }; diff --git a/WebCore/svg/SVGPathSegLinetoHorizontal.h b/WebCore/svg/SVGPathSegLinetoHorizontal.h index 504f40d..717774c 100644 --- a/WebCore/svg/SVGPathSegLinetoHorizontal.h +++ b/WebCore/svg/SVGPathSegLinetoHorizontal.h @@ -31,7 +31,7 @@ namespace WebCore { class SVGPathSegLinetoHorizontalAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegLinetoHorizontalAbs> create(float x) { return adoptRef(new SVGPathSegLinetoHorizontalAbs(x)); } + SVGPathSegLinetoHorizontalAbs(float x); virtual ~SVGPathSegLinetoHorizontalAbs(); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_ABS; } @@ -42,13 +42,12 @@ namespace WebCore { float x() const; private: - SVGPathSegLinetoHorizontalAbs(float x); float m_x; }; class SVGPathSegLinetoHorizontalRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegLinetoHorizontalRel> create(float x) { return adoptRef(new SVGPathSegLinetoHorizontalRel(x)); } + SVGPathSegLinetoHorizontalRel(float x); virtual ~SVGPathSegLinetoHorizontalRel(); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_REL; } @@ -59,8 +58,6 @@ namespace WebCore { float x() const; private: - SVGPathSegLinetoHorizontalRel(float x); - float m_x; }; diff --git a/WebCore/svg/SVGPathSegLinetoVertical.h b/WebCore/svg/SVGPathSegLinetoVertical.h index d3bf067..24a448a 100644 --- a/WebCore/svg/SVGPathSegLinetoVertical.h +++ b/WebCore/svg/SVGPathSegLinetoVertical.h @@ -31,7 +31,7 @@ namespace WebCore { class SVGPathSegLinetoVerticalAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegLinetoVerticalAbs> create(float y) { return adoptRef(new SVGPathSegLinetoVerticalAbs(y)); } + SVGPathSegLinetoVerticalAbs(float y); virtual~SVGPathSegLinetoVerticalAbs(); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_ABS; } @@ -42,14 +42,12 @@ namespace WebCore { float y() const; private: - SVGPathSegLinetoVerticalAbs(float y); - float m_y; }; class SVGPathSegLinetoVerticalRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegLinetoVerticalRel> create(float y) { return adoptRef(new SVGPathSegLinetoVerticalRel(y)); } + SVGPathSegLinetoVerticalRel(float y); virtual ~SVGPathSegLinetoVerticalRel(); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_REL; } @@ -60,8 +58,6 @@ namespace WebCore { float y() const; private: - SVGPathSegLinetoVerticalRel(float y); - float m_y; }; diff --git a/WebCore/svg/SVGPathSegList.h b/WebCore/svg/SVGPathSegList.h index 880d54c..47e0079 100644 --- a/WebCore/svg/SVGPathSegList.h +++ b/WebCore/svg/SVGPathSegList.h @@ -33,14 +33,11 @@ namespace WebCore { class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > { public: - static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); } + SVGPathSegList(const QualifiedName&); virtual ~SVGPathSegList(); unsigned getPathSegAtLength(double); Path toPathData(); - - private: - SVGPathSegList(const QualifiedName&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegMoveto.h b/WebCore/svg/SVGPathSegMoveto.h index f97b340..6ba64d8 100644 --- a/WebCore/svg/SVGPathSegMoveto.h +++ b/WebCore/svg/SVGPathSegMoveto.h @@ -30,7 +30,7 @@ namespace WebCore { class SVGPathSegMovetoAbs : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegMovetoAbs> create(float x, float y) { return adoptRef(new SVGPathSegMovetoAbs(x, y)); } + SVGPathSegMovetoAbs(float x, float y); virtual ~SVGPathSegMovetoAbs(); virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_ABS; } @@ -44,15 +44,13 @@ namespace WebCore { float y() const; private: - SVGPathSegMovetoAbs(float x, float y); - float m_x; float m_y; }; class SVGPathSegMovetoRel : public SVGPathSeg { public: - static PassRefPtr<SVGPathSegMovetoRel> create(float x, float y) { return adoptRef(new SVGPathSegMovetoRel(x, y)); } + SVGPathSegMovetoRel(float x, float y); virtual ~SVGPathSegMovetoRel(); virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_REL; } @@ -66,8 +64,6 @@ namespace WebCore { float y() const; private: - SVGPathSegMovetoRel(float x, float y); - float m_x; float m_y; }; diff --git a/WebCore/svg/SVGPatternElement.cpp b/WebCore/svg/SVGPatternElement.cpp index dda42d7..c73bb82 100644 --- a/WebCore/svg/SVGPatternElement.cpp +++ b/WebCore/svg/SVGPatternElement.cpp @@ -63,7 +63,7 @@ SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc , m_height(this, LengthModeHeight) , m_patternUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) , m_patternContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) - , m_patternTransform(SVGTransformList::create(SVGNames::patternTransformAttr)) + , m_patternTransform(new SVGTransformList(SVGNames::patternTransformAttr)) { } @@ -144,9 +144,9 @@ void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) m_resource->invalidate(); } -void SVGPatternElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGPatternElement::childrenChanged(bool changedByParser) { - SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGStyledElement::childrenChanged(changedByParser); if (!m_resource) return; @@ -272,7 +272,7 @@ RenderObject* SVGPatternElement::createRenderer(RenderArena* arena, RenderStyle* SVGResource* SVGPatternElement::canvasResource() { if (!m_resource) - m_resource = SVGPaintServerPattern::create(this); + m_resource = new SVGPaintServerPattern(this); return m_resource.get(); } diff --git a/WebCore/svg/SVGPatternElement.h b/WebCore/svg/SVGPatternElement.h index 6b00a62..f7b6654 100644 --- a/WebCore/svg/SVGPatternElement.h +++ b/WebCore/svg/SVGPatternElement.h @@ -54,7 +54,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual SVGResource* canvasResource(); diff --git a/WebCore/svg/SVGPointList.h b/WebCore/svg/SVGPointList.h index 77d4edd..1843ef0 100644 --- a/WebCore/svg/SVGPointList.h +++ b/WebCore/svg/SVGPointList.h @@ -26,18 +26,13 @@ #if ENABLE(SVG) #include "SVGList.h" #include "FloatPoint.h" -#include <wtf/PassRefPtr.h> namespace WebCore { class SVGPointList : public SVGPODList<FloatPoint> { public: - static PassRefPtr<SVGPointList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPointList(attributeName)); } - - virtual ~SVGPointList(); - - private: SVGPointList(const QualifiedName&); + virtual ~SVGPointList(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp index 6c3416f..3af9778 100644 --- a/WebCore/svg/SVGPolyElement.cpp +++ b/WebCore/svg/SVGPolyElement.cpp @@ -51,7 +51,7 @@ SVGPolyElement::~SVGPolyElement() SVGPointList* SVGPolyElement::points() const { if (!m_points) - m_points = SVGPointList::create(SVGNames::pointsAttr); + m_points = new SVGPointList(SVGNames::pointsAttr); return m_points.get(); } diff --git a/WebCore/svg/SVGPreserveAspectRatio.cpp b/WebCore/svg/SVGPreserveAspectRatio.cpp index 0709b9d..e4223ea 100644 --- a/WebCore/svg/SVGPreserveAspectRatio.cpp +++ b/WebCore/svg/SVGPreserveAspectRatio.cpp @@ -31,7 +31,8 @@ namespace WebCore { SVGPreserveAspectRatio::SVGPreserveAspectRatio() - : m_align(SVG_PRESERVEASPECTRATIO_XMIDYMID) + : RefCounted<SVGPreserveAspectRatio>() + , m_align(SVG_PRESERVEASPECTRATIO_XMIDYMID) , m_meetOrSlice(SVG_MEETORSLICE_MEET) { // FIXME: Should the two values default to UNKNOWN instead? diff --git a/WebCore/svg/SVGPreserveAspectRatio.h b/WebCore/svg/SVGPreserveAspectRatio.h index a1bed65..1f56d5a 100644 --- a/WebCore/svg/SVGPreserveAspectRatio.h +++ b/WebCore/svg/SVGPreserveAspectRatio.h @@ -37,8 +37,6 @@ namespace WebCore { class SVGPreserveAspectRatio : public RefCounted<SVGPreserveAspectRatio> { public: - static PassRefPtr<SVGPreserveAspectRatio> create() { return adoptRef(new SVGPreserveAspectRatio); } - enum SVGPreserveAspectRatioType { SVG_PRESERVEASPECTRATIO_UNKNOWN = 0, SVG_PRESERVEASPECTRATIO_NONE = 1, @@ -59,6 +57,7 @@ namespace WebCore { SVG_MEETORSLICE_SLICE = 2 }; + SVGPreserveAspectRatio(); virtual ~SVGPreserveAspectRatio(); void setAlign(unsigned short); @@ -77,9 +76,7 @@ namespace WebCore { const QualifiedName& associatedAttributeName() const { return SVGNames::preserveAspectRatioAttr; } - private: - SVGPreserveAspectRatio(); - + protected: unsigned short m_align; unsigned short m_meetOrSlice; }; diff --git a/WebCore/svg/SVGRenderingIntent.h b/WebCore/svg/SVGRenderingIntent.h index 699f228..b0510d9 100644 --- a/WebCore/svg/SVGRenderingIntent.h +++ b/WebCore/svg/SVGRenderingIntent.h @@ -28,7 +28,8 @@ namespace WebCore { -class SVGRenderingIntent : public RefCounted<SVGRenderingIntent> { +class SVGRenderingIntent : public RefCounted<SVGRenderingIntent> +{ public: enum SVGRenderingIntentType { RENDERING_INTENT_UNKNOWN = 0, @@ -39,8 +40,8 @@ public: RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5 }; -private: - SVGRenderingIntent() { } + SVGRenderingIntent() { } + ~SVGRenderingIntent() { } }; } // namespace WebCore diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp index 33d8867..db0a209 100644 --- a/WebCore/svg/SVGSVGElement.cpp +++ b/WebCore/svg/SVGSVGElement.cpp @@ -48,6 +48,7 @@ #include "SVGViewSpec.h" #include "SVGZoomEvent.h" #include "SelectionController.h" +#include "TextStream.h" #include "TimeScheduler.h" namespace WebCore { @@ -222,7 +223,7 @@ void SVGSVGElement::addSVGWindowEventListener(const AtomicString& eventType, con // FIXME: None of these should be window events long term. // Once we propertly support SVGLoad, etc. RefPtr<EventListener> listener = document()->accessSVGExtensions()-> - createSVGEventListener(attr->localName().string(), attr->value(), this); + createSVGEventListener(attr->localName().domString(), attr->value(), this); document()->setHTMLWindowEventListener(eventType, listener.release()); } diff --git a/WebCore/svg/SVGStringList.h b/WebCore/svg/SVGStringList.h index 1cbe9d2..bf39bc6 100644 --- a/WebCore/svg/SVGStringList.h +++ b/WebCore/svg/SVGStringList.h @@ -31,14 +31,11 @@ namespace WebCore { class SVGStringList : public SVGList<String> { public: - static PassRefPtr<SVGStringList> create(const QualifiedName& attributeName) { return adoptRef(new SVGStringList(attributeName)); } + SVGStringList(const QualifiedName&); virtual ~SVGStringList(); void reset(const String& str); void parse(const String& data, UChar delimiter = ','); - - private: - SVGStringList(const QualifiedName&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGStyleElement.cpp b/WebCore/svg/SVGStyleElement.cpp index c3dbd33..27232cc 100644 --- a/WebCore/svg/SVGStyleElement.cpp +++ b/WebCore/svg/SVGStyleElement.cpp @@ -114,9 +114,9 @@ void SVGStyleElement::removedFromDocument() StyleElement::removedFromDocument(document()); } -void SVGStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGStyleElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); StyleElement::process(this); } diff --git a/WebCore/svg/SVGStyleElement.h b/WebCore/svg/SVGStyleElement.h index f0774aa..dbc045c 100644 --- a/WebCore/svg/SVGStyleElement.h +++ b/WebCore/svg/SVGStyleElement.h @@ -37,7 +37,7 @@ namespace WebCore { virtual void parseMappedAttribute(MappedAttribute*); virtual void insertedIntoDocument(); virtual void removedFromDocument(); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; } virtual void finishParsingChildren(); diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp index 127f7e0..2e4141d 100644 --- a/WebCore/svg/SVGStyledElement.cpp +++ b/WebCore/svg/SVGStyledElement.cpp @@ -2,6 +2,8 @@ Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 Rob Buis <buis@kde.org> + This file is part of the KDE project + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,11 +21,11 @@ */ #include "config.h" + #if ENABLE(SVG) #include "SVGStyledElement.h" #include "Attr.h" -#include "CSSParser.h" #include "CSSStyleSelector.h" #include "CString.h" #include "Document.h" @@ -67,9 +69,15 @@ bool SVGStyledElement::rendererIsNeeded(RenderStyle* style) return false; } -static void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, int>* propertyNameToIdMap, const QualifiedName& attrName) +static inline void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, int>* propertyNameToIdMap, const QualifiedName& attrName, const char* cssPropertyName = 0) { - int propertyId = cssPropertyID(attrName.localName()); + int propertyId = 0; + if (cssPropertyName) + propertyId = getPropertyID(cssPropertyName, strlen(cssPropertyName)); + else { + CString propertyName = attrName.localName().domString().utf8(); + propertyId = getPropertyID(propertyName.data(), propertyName.length()); + } ASSERT(propertyId > 0); propertyNameToIdMap->set(attrName.localName().impl(), propertyId); } @@ -216,9 +224,9 @@ void SVGStyledElement::invalidateResourcesInAncestorChain() const } } -void SVGStyledElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGStyledElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (document()->parsing()) return; diff --git a/WebCore/svg/SVGStyledElement.h b/WebCore/svg/SVGStyledElement.h index 0d798ab..231f7ec 100644 --- a/WebCore/svg/SVGStyledElement.h +++ b/WebCore/svg/SVGStyledElement.h @@ -55,7 +55,7 @@ namespace WebCore { virtual void svgAttributeChanged(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); // Centralized place to force a manual style resolution. Hacky but needed for now. RenderStyle* resolveStyle(RenderStyle* parentStyle); diff --git a/WebCore/svg/SVGStyledTransformableElement.cpp b/WebCore/svg/SVGStyledTransformableElement.cpp index 28ce33c..9893ab8 100644 --- a/WebCore/svg/SVGStyledTransformableElement.cpp +++ b/WebCore/svg/SVGStyledTransformableElement.cpp @@ -38,7 +38,7 @@ namespace WebCore { SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* doc) : SVGStyledLocatableElement(tagName, doc) , SVGTransformable() - , m_transform(SVGTransformList::create(SVGNames::transformAttr)) + , m_transform(new SVGTransformList(SVGNames::transformAttr)) { } diff --git a/WebCore/svg/SVGTests.cpp b/WebCore/svg/SVGTests.cpp index 1a3cf01..d11e44d 100644 --- a/WebCore/svg/SVGTests.cpp +++ b/WebCore/svg/SVGTests.cpp @@ -44,7 +44,7 @@ SVGTests::~SVGTests() SVGStringList* SVGTests::requiredFeatures() const { if (!m_features) - m_features = SVGStringList::create(SVGNames::requiredFeaturesAttr); + m_features = new SVGStringList(SVGNames::requiredFeaturesAttr); return m_features.get(); } @@ -52,7 +52,7 @@ SVGStringList* SVGTests::requiredFeatures() const SVGStringList* SVGTests::requiredExtensions() const { if (!m_extensions) - m_extensions = SVGStringList::create(SVGNames::requiredExtensionsAttr); + m_extensions = new SVGStringList(SVGNames::requiredExtensionsAttr); return m_extensions.get(); } @@ -60,7 +60,7 @@ SVGStringList* SVGTests::requiredExtensions() const SVGStringList* SVGTests::systemLanguage() const { if (!m_systemLanguage) - m_systemLanguage = SVGStringList::create(SVGNames::systemLanguageAttr); + m_systemLanguage = new SVGStringList(SVGNames::systemLanguageAttr); return m_systemLanguage.get(); } diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp index 7b65fa2..d316dd0 100644 --- a/WebCore/svg/SVGTextElement.cpp +++ b/WebCore/svg/SVGTextElement.cpp @@ -38,7 +38,7 @@ namespace WebCore { SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document* doc) : SVGTextPositioningElement(tagName, doc) , SVGTransformable() - , m_transform(SVGTransformList::create(SVGNames::transformAttr)) + , m_transform(new SVGTransformList(SVGNames::transformAttr)) { } diff --git a/WebCore/svg/SVGTextPositioningElement.cpp b/WebCore/svg/SVGTextPositioningElement.cpp index 2bfc33e..346bd1e 100644 --- a/WebCore/svg/SVGTextPositioningElement.cpp +++ b/WebCore/svg/SVGTextPositioningElement.cpp @@ -33,11 +33,11 @@ namespace WebCore { SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* doc) : SVGTextContentElement(tagName, doc) - , m_x(SVGLengthList::create(SVGNames::xAttr)) - , m_y(SVGLengthList::create(SVGNames::yAttr)) - , m_dx(SVGLengthList::create(SVGNames::dxAttr)) - , m_dy(SVGLengthList::create(SVGNames::dyAttr)) - , m_rotate(SVGNumberList::create(SVGNames::rotateAttr)) + , m_x(new SVGLengthList(SVGNames::xAttr)) + , m_y(new SVGLengthList(SVGNames::yAttr)) + , m_dx(new SVGLengthList(SVGNames::dxAttr)) + , m_dy(new SVGLengthList(SVGNames::dyAttr)) + , m_rotate(new SVGNumberList(SVGNames::rotateAttr)) { } diff --git a/WebCore/svg/SVGTitleElement.cpp b/WebCore/svg/SVGTitleElement.cpp index 3e23a1b..dba882c 100644 --- a/WebCore/svg/SVGTitleElement.cpp +++ b/WebCore/svg/SVGTitleElement.cpp @@ -46,9 +46,9 @@ void SVGTitleElement::removedFromDocument() document()->removeTitle(this); } -void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGTitleElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (inDocument()) document()->setTitle(textContent(), this); } diff --git a/WebCore/svg/SVGTitleElement.h b/WebCore/svg/SVGTitleElement.h index cd4768c..be5a301 100644 --- a/WebCore/svg/SVGTitleElement.h +++ b/WebCore/svg/SVGTitleElement.h @@ -37,7 +37,7 @@ namespace WebCore virtual void insertedIntoDocument(); virtual void removedFromDocument(); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual bool rendererIsNeeded(RenderStyle*) { return false; } }; diff --git a/WebCore/svg/SVGTransformList.h b/WebCore/svg/SVGTransformList.h index be72f9d..e41d393 100644 --- a/WebCore/svg/SVGTransformList.h +++ b/WebCore/svg/SVGTransformList.h @@ -26,13 +26,12 @@ #if ENABLE(SVG) #include "SVGList.h" #include "SVGTransform.h" -#include <wtf/PassRefPtr.h> namespace WebCore { class SVGTransformList : public SVGPODList<SVGTransform> { public: - static PassRefPtr<SVGTransformList> create(const QualifiedName& attributeName) { return adoptRef(new SVGTransformList(attributeName)); } + SVGTransformList(const QualifiedName&); virtual ~SVGTransformList(); SVGTransform createSVGTransformFromMatrix(const AffineTransform&) const; @@ -41,9 +40,6 @@ namespace WebCore { // Internal use only SVGTransform concatenate() const; SVGTransform concatenateForType(SVGTransform::SVGTransformType) const; - - private: - SVGTransformList(const QualifiedName&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGUnitTypes.h b/WebCore/svg/SVGUnitTypes.h index 6be737f..8f8b0cd 100644 --- a/WebCore/svg/SVGUnitTypes.h +++ b/WebCore/svg/SVGUnitTypes.h @@ -28,7 +28,8 @@ namespace WebCore { -class SVGUnitTypes : public RefCounted<SVGUnitTypes> { +class SVGUnitTypes : public RefCounted<SVGUnitTypes> +{ public: enum SVGUnitType { SVG_UNIT_TYPE_UNKNOWN = 0, @@ -36,8 +37,8 @@ public: SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2 }; -private: - SVGUnitTypes() { } + SVGUnitTypes() { } + ~SVGUnitTypes() { } }; } // namespace WebCore diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp index b2e8776..2944b33 100644 --- a/WebCore/svg/SVGUseElement.cpp +++ b/WebCore/svg/SVGUseElement.cpp @@ -148,9 +148,9 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) } } -void SVGUseElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) +void SVGUseElement::childrenChanged(bool changedByParser) { - SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + SVGElement::childrenChanged(changedByParser); if (!attached()) return; diff --git a/WebCore/svg/SVGUseElement.h b/WebCore/svg/SVGUseElement.h index e307a8ec..0428811 100644 --- a/WebCore/svg/SVGUseElement.h +++ b/WebCore/svg/SVGUseElement.h @@ -54,7 +54,7 @@ namespace WebCore { virtual void buildPendingResource(); virtual void parseMappedAttribute(MappedAttribute*); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void childrenChanged(bool changedByParser = false); virtual void svgAttributeChanged(const QualifiedName&); virtual void recalcStyle(StyleChange = NoChange); diff --git a/WebCore/svg/SVGViewElement.cpp b/WebCore/svg/SVGViewElement.cpp index cb16b62..24c08e6 100644 --- a/WebCore/svg/SVGViewElement.cpp +++ b/WebCore/svg/SVGViewElement.cpp @@ -49,7 +49,7 @@ SVGViewElement::~SVGViewElement() SVGStringList* SVGViewElement::viewTarget() const { if (!m_viewTarget) - m_viewTarget = SVGStringList::create(SVGNames::viewTargetAttr); + m_viewTarget = new SVGStringList(SVGNames::viewTargetAttr); return m_viewTarget.get(); } diff --git a/WebCore/svg/SVGViewSpec.cpp b/WebCore/svg/SVGViewSpec.cpp index d628d70..f7a3600 100644 --- a/WebCore/svg/SVGViewSpec.cpp +++ b/WebCore/svg/SVGViewSpec.cpp @@ -35,7 +35,7 @@ namespace WebCore { SVGViewSpec::SVGViewSpec(const SVGSVGElement* contextElement) : SVGFitToViewBox() , SVGZoomAndPan() - , m_transform(SVGTransformList::create(SVGNames::transformAttr)) + , m_transform(new SVGTransformList(SVGNames::transformAttr)) , m_contextElement(contextElement) { } diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp index de868b7..c8d5cb1 100644 --- a/WebCore/svg/graphics/SVGImage.cpp +++ b/WebCore/svg/graphics/SVGImage.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2006 Eric Seidel (eric@webkit.org) - * Copyright (C) 2008 Apple, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,7 +25,6 @@ #include "config.h" #if ENABLE(SVG) -#include "SVGImage.h" #include "CachedPage.h" #include "DocumentLoader.h" @@ -41,6 +39,7 @@ #include "Page.h" #include "ResourceError.h" #include "SVGDocument.h" +#include "SVGImage.h" #include "SVGLength.h" #include "SVGRenderSupport.h" #include "SVGSVGElement.h" @@ -139,11 +138,7 @@ void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const Fl context->clip(enclosingIntRect(dstRect)); context->translate(dstRect.location().x(), dstRect.location().y()); context->scale(FloatSize(dstRect.width()/srcRect.width(), dstRect.height()/srcRect.height())); - - if (m_frame->view()->needsLayout()) - m_frame->view()->layout(); m_frame->paint(context, enclosingIntRect(srcRect)); - context->restore(); if (imageObserver()) @@ -202,7 +197,7 @@ bool SVGImage::dataChanged(bool allDataReceived) m_frame->loader()->cancelContentPolicyCheck(); // cancel any policy checks m_frame->loader()->commitProvisionalLoad(0); m_frame->loader()->setResponseMIMEType("image/svg+xml"); - m_frame->loader()->begin(KURL()); // create the empty document + m_frame->loader()->begin("placeholder.svg"); // create the empty document m_frame->loader()->write(m_data->data(), m_data->size()); m_frame->loader()->end(); } diff --git a/WebCore/svg/graphics/SVGImageEmptyClients.h b/WebCore/svg/graphics/SVGImageEmptyClients.h index ce9296a..efaaa47 100644 --- a/WebCore/svg/graphics/SVGImageEmptyClients.h +++ b/WebCore/svg/graphics/SVGImageEmptyClients.h @@ -247,7 +247,8 @@ public: virtual void transitionToCommittedFromCachedPage(CachedPage*) { } virtual void transitionToCommittedForNewPage() { } - virtual void updateGlobalHistory(const KURL&) { } + virtual void updateGlobalHistoryForStandardLoad(const KURL&) { } + virtual void updateGlobalHistoryForReload(const KURL&) { } virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; } virtual void saveViewStateToItem(HistoryItem*) { } virtual bool canCachePage() const { return false; } diff --git a/WebCore/svg/graphics/SVGPaintServer.cpp b/WebCore/svg/graphics/SVGPaintServer.cpp index 9a59683..32c0d3c 100644 --- a/WebCore/svg/graphics/SVGPaintServer.cpp +++ b/WebCore/svg/graphics/SVGPaintServer.cpp @@ -61,8 +61,9 @@ SVGPaintServer* getPaintServerById(Document* document, const AtomicString& id) SVGPaintServerSolid* SVGPaintServer::sharedSolidPaintServer() { - static SVGPaintServerSolid* _sharedSolidPaintServer = SVGPaintServerSolid::create().releaseRef(); - + static SVGPaintServerSolid* _sharedSolidPaintServer = 0; + if (!_sharedSolidPaintServer) + _sharedSolidPaintServer = new SVGPaintServerSolid(); return _sharedSolidPaintServer; } diff --git a/WebCore/svg/graphics/SVGPaintServer.h b/WebCore/svg/graphics/SVGPaintServer.h index 2df381e..e66a103 100644 --- a/WebCore/svg/graphics/SVGPaintServer.h +++ b/WebCore/svg/graphics/SVGPaintServer.h @@ -67,6 +67,7 @@ namespace WebCore { class SVGPaintServer : public SVGResource { public: + SVGPaintServer(); virtual ~SVGPaintServer(); virtual SVGResourceType resourceType() const { return PaintServerResourceType; } @@ -96,8 +97,6 @@ namespace WebCore { #if PLATFORM(QT) void setPenProperties(const RenderObject*, const RenderStyle*, QPen&) const; #endif - protected: - SVGPaintServer(); }; TextStream& operator<<(TextStream&, const SVGPaintServer&); diff --git a/WebCore/svg/graphics/SVGPaintServerGradient.h b/WebCore/svg/graphics/SVGPaintServerGradient.h index a4af37b..afab7ab 100644 --- a/WebCore/svg/graphics/SVGPaintServerGradient.h +++ b/WebCore/svg/graphics/SVGPaintServerGradient.h @@ -60,6 +60,7 @@ namespace WebCore { class SVGPaintServerGradient : public SVGPaintServer { public: + SVGPaintServerGradient(const SVGGradientElement*); virtual ~SVGPaintServerGradient(); const Vector<SVGGradientStop>& gradientStops() const; @@ -98,9 +99,6 @@ namespace WebCore { virtual QGradient setupGradient(GraphicsContext*&, const RenderObject*) const = 0; #endif - protected: - SVGPaintServerGradient(const SVGGradientElement* owner); - private: Vector<SVGGradientStop> m_stops; SVGGradientSpreadMethod m_spreadMethod; @@ -117,13 +115,7 @@ namespace WebCore { } QuartzGradientStop; struct SharedStopCache : public RefCounted<SharedStopCache> { - public: - static PassRefPtr<SharedStopCache> create() { return adoptRef(new SharedStopCache); } - Vector<QuartzGradientStop> m_stops; - - private: - SharedStopCache() { } }; RefPtr<SharedStopCache> m_stopsCache; diff --git a/WebCore/svg/graphics/SVGPaintServerLinearGradient.h b/WebCore/svg/graphics/SVGPaintServerLinearGradient.h index 4b7da32..e198830 100644 --- a/WebCore/svg/graphics/SVGPaintServerLinearGradient.h +++ b/WebCore/svg/graphics/SVGPaintServerLinearGradient.h @@ -35,7 +35,7 @@ namespace WebCore { class SVGPaintServerLinearGradient : public SVGPaintServerGradient { public: - static PassRefPtr<SVGPaintServerLinearGradient> create(const SVGGradientElement* owner) { return adoptRef(new SVGPaintServerLinearGradient(owner)); } + SVGPaintServerLinearGradient(const SVGGradientElement* owner); virtual ~SVGPaintServerLinearGradient(); virtual SVGPaintServerType type() const { return LinearGradientPaintServer; } @@ -53,8 +53,6 @@ namespace WebCore { #endif private: - SVGPaintServerLinearGradient(const SVGGradientElement* owner); - FloatPoint m_start; FloatPoint m_end; }; diff --git a/WebCore/svg/graphics/SVGPaintServerPattern.h b/WebCore/svg/graphics/SVGPaintServerPattern.h index 8f88326..5e7f6ce 100644 --- a/WebCore/svg/graphics/SVGPaintServerPattern.h +++ b/WebCore/svg/graphics/SVGPaintServerPattern.h @@ -44,8 +44,7 @@ namespace WebCore { class SVGPaintServerPattern : public SVGPaintServer { public: - static PassRefPtr<SVGPaintServerPattern> create(const SVGPatternElement* owner) { return adoptRef(new SVGPaintServerPattern(owner)); } - + SVGPaintServerPattern(const SVGPatternElement*); virtual ~SVGPaintServerPattern(); virtual SVGPaintServerType type() const { return PatternPaintServer; } @@ -72,8 +71,6 @@ namespace WebCore { #endif private: - SVGPaintServerPattern(const SVGPatternElement*); - OwnPtr<ImageBuffer> m_tile; const SVGPatternElement* m_ownerElement; AffineTransform m_patternTransform; diff --git a/WebCore/svg/graphics/SVGPaintServerRadialGradient.h b/WebCore/svg/graphics/SVGPaintServerRadialGradient.h index 265f76b..1f19e3d 100644 --- a/WebCore/svg/graphics/SVGPaintServerRadialGradient.h +++ b/WebCore/svg/graphics/SVGPaintServerRadialGradient.h @@ -35,7 +35,7 @@ namespace WebCore { class SVGPaintServerRadialGradient : public SVGPaintServerGradient { public: - static PassRefPtr<SVGPaintServerRadialGradient> create(const SVGGradientElement* owner) { return adoptRef(new SVGPaintServerRadialGradient(owner)); } + SVGPaintServerRadialGradient(const SVGGradientElement* owner); virtual ~SVGPaintServerRadialGradient(); virtual SVGPaintServerType type() const { return RadialGradientPaintServer; } @@ -56,8 +56,6 @@ namespace WebCore { #endif private: - SVGPaintServerRadialGradient(const SVGGradientElement* owner); - float m_radius; FloatPoint m_center; FloatPoint m_focal; diff --git a/WebCore/svg/graphics/SVGPaintServerSolid.h b/WebCore/svg/graphics/SVGPaintServerSolid.h index 2dd54ab..f05a4e6 100644 --- a/WebCore/svg/graphics/SVGPaintServerSolid.h +++ b/WebCore/svg/graphics/SVGPaintServerSolid.h @@ -35,7 +35,7 @@ namespace WebCore { class SVGPaintServerSolid : public SVGPaintServer { public: - static PassRefPtr<SVGPaintServerSolid> create() { return adoptRef(new SVGPaintServerSolid); } + SVGPaintServerSolid(); virtual ~SVGPaintServerSolid(); virtual SVGPaintServerType type() const { return SolidPaintServer; } @@ -50,8 +50,6 @@ namespace WebCore { #endif private: - SVGPaintServerSolid(); - Color m_color; }; diff --git a/WebCore/svg/graphics/SVGResource.h b/WebCore/svg/graphics/SVGResource.h index 7ee98f6..5272468 100644 --- a/WebCore/svg/graphics/SVGResource.h +++ b/WebCore/svg/graphics/SVGResource.h @@ -66,6 +66,7 @@ namespace WebCore { class SVGResource : public RefCounted<SVGResource> { public: + SVGResource(); virtual ~SVGResource(); virtual void invalidate(); @@ -84,9 +85,6 @@ namespace WebCore { static void invalidateClients(HashSet<SVGStyledElement*>); static void removeClient(SVGStyledElement*); - protected: - SVGResource(); - private: HashSet<SVGStyledElement*> m_clients; }; diff --git a/WebCore/svg/graphics/SVGResourceClipper.cpp b/WebCore/svg/graphics/SVGResourceClipper.cpp index f03f5c2..3e52322 100644 --- a/WebCore/svg/graphics/SVGResourceClipper.cpp +++ b/WebCore/svg/graphics/SVGResourceClipper.cpp @@ -29,6 +29,7 @@ #include "SVGResourceClipper.h" #include "SVGRenderTreeAsText.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/SVGResourceClipper.h b/WebCore/svg/graphics/SVGResourceClipper.h index 98c295f..d5c1ab7 100644 --- a/WebCore/svg/graphics/SVGResourceClipper.h +++ b/WebCore/svg/graphics/SVGResourceClipper.h @@ -63,7 +63,7 @@ namespace WebCore { class SVGResourceClipper : public SVGResource { public: - static PassRefPtr<SVGResourceClipper> create() { return adoptRef(new SVGResourceClipper); } + SVGResourceClipper(); virtual ~SVGResourceClipper(); void resetClipData(); @@ -77,7 +77,6 @@ namespace WebCore { // To be implemented by the specific rendering devices void applyClip(GraphicsContext*, const FloatRect& boundingBox) const; private: - SVGResourceClipper(); ClipDataList m_clipData; }; diff --git a/WebCore/svg/graphics/SVGResourceFilter.cpp b/WebCore/svg/graphics/SVGResourceFilter.cpp index 8fb2dfa..dceda8b 100644 --- a/WebCore/svg/graphics/SVGResourceFilter.cpp +++ b/WebCore/svg/graphics/SVGResourceFilter.cpp @@ -26,6 +26,7 @@ #include "SVGRenderTreeAsText.h" #include "SVGFilterEffect.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/SVGResourceMarker.h b/WebCore/svg/graphics/SVGResourceMarker.h index bb4039c..a78573b 100644 --- a/WebCore/svg/graphics/SVGResourceMarker.h +++ b/WebCore/svg/graphics/SVGResourceMarker.h @@ -38,7 +38,7 @@ namespace WebCore { class SVGResourceMarker : public SVGResource { public: - static PassRefPtr<SVGResourceMarker> create() { return adoptRef(new SVGResourceMarker); } + SVGResourceMarker(); virtual ~SVGResourceMarker(); void setMarker(RenderSVGViewportContainer*); @@ -61,7 +61,6 @@ namespace WebCore { virtual TextStream& externalRepresentation(TextStream&) const; private: - SVGResourceMarker(); double m_refX, m_refY; FloatRect m_cachedBounds; float m_angle; diff --git a/WebCore/svg/graphics/SVGResourceMasker.h b/WebCore/svg/graphics/SVGResourceMasker.h index f945f56..d530571 100644 --- a/WebCore/svg/graphics/SVGResourceMasker.h +++ b/WebCore/svg/graphics/SVGResourceMasker.h @@ -34,7 +34,6 @@ #include <memory> #include <wtf/OwnPtr.h> -#include <wtf/PassRefPtr.h> namespace WebCore { @@ -44,7 +43,7 @@ namespace WebCore { class SVGResourceMasker : public SVGResource { public: - static PassRefPtr<SVGResourceMasker> create(const SVGMaskElement* ownerElement) { return adoptRef(new SVGResourceMasker(ownerElement)); } + SVGResourceMasker(const SVGMaskElement*); virtual ~SVGResourceMasker(); virtual void invalidate(); @@ -56,8 +55,6 @@ namespace WebCore { void applyMask(GraphicsContext*, const FloatRect& boundingBox); private: - SVGResourceMasker(const SVGMaskElement*); - const SVGMaskElement* m_ownerElement; OwnPtr<ImageBuffer> m_mask; diff --git a/WebCore/svg/graphics/cg/SVGPaintServerGradientCg.cpp b/WebCore/svg/graphics/cg/SVGPaintServerGradientCg.cpp index 4d41d88..d1ab090 100644 --- a/WebCore/svg/graphics/cg/SVGPaintServerGradientCg.cpp +++ b/WebCore/svg/graphics/cg/SVGPaintServerGradientCg.cpp @@ -138,7 +138,7 @@ static CGShadingRef CGShadingRefForRadialGradient(const SVGPaintServerRadialGrad void SVGPaintServerGradient::updateQuartzGradientStopsCache(const Vector<SVGGradientStop>& stops) { - m_stopsCache = SharedStopCache::create(); + m_stopsCache = new SharedStopCache; Vector<QuartzGradientStop>& stopsCache = m_stopsCache->m_stops; stopsCache.resize(stops.size()); CGFloat previousOffset = 0.0f; diff --git a/WebCore/svg/graphics/filters/SVGFEBlend.cpp b/WebCore/svg/graphics/filters/SVGFEBlend.cpp index a1f2e5b..bb083e3 100644 --- a/WebCore/svg/graphics/filters/SVGFEBlend.cpp +++ b/WebCore/svg/graphics/filters/SVGFEBlend.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEBlend.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEComponentTransfer.cpp b/WebCore/svg/graphics/filters/SVGFEComponentTransfer.cpp index d937c63..55a1730 100644 --- a/WebCore/svg/graphics/filters/SVGFEComponentTransfer.cpp +++ b/WebCore/svg/graphics/filters/SVGFEComponentTransfer.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEComponentTransfer.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEComposite.cpp b/WebCore/svg/graphics/filters/SVGFEComposite.cpp index 0be84f9..4e0dfb5 100644 --- a/WebCore/svg/graphics/filters/SVGFEComposite.cpp +++ b/WebCore/svg/graphics/filters/SVGFEComposite.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEComposite.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp index 937dfb9..2504ca6 100644 --- a/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp +++ b/WebCore/svg/graphics/filters/SVGFEDiffuseLighting.cpp @@ -24,6 +24,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGLightSource.h" #include "SVGFEDiffuseLighting.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp b/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp index a893f9d..aef9aad 100644 --- a/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp +++ b/WebCore/svg/graphics/filters/SVGFEGaussianBlur.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEGaussianBlur.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEImage.cpp b/WebCore/svg/graphics/filters/SVGFEImage.cpp index d7520be..0c9eaee 100644 --- a/WebCore/svg/graphics/filters/SVGFEImage.cpp +++ b/WebCore/svg/graphics/filters/SVGFEImage.cpp @@ -25,6 +25,7 @@ #include "SVGFEImage.h" #include "SVGResourceFilter.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/svg/graphics/filters/SVGFEMerge.cpp index ff92eaa..f4cf2db 100644 --- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp +++ b/WebCore/svg/graphics/filters/SVGFEMerge.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEMerge.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp index 06157ca..4eaad67 100644 --- a/WebCore/svg/graphics/filters/SVGFEMorphology.cpp +++ b/WebCore/svg/graphics/filters/SVGFEMorphology.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEMorphology.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp index 6ac0d17..024f2cd 100644 --- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp +++ b/WebCore/svg/graphics/filters/SVGFEOffset.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFEOffset.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp index a68c31d..ba45dae 100644 --- a/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp +++ b/WebCore/svg/graphics/filters/SVGFESpecularLighting.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFESpecularLighting.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp index 9432a0a..0f9cbaf 100644 --- a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp +++ b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp @@ -23,6 +23,7 @@ #if ENABLE(SVG) && ENABLE(SVG_FILTERS) #include "SVGFETurbulence.h" +#include "TextStream.h" namespace WebCore { diff --git a/WebCore/svg/graphics/filters/SVGFilterEffect.cpp b/WebCore/svg/graphics/filters/SVGFilterEffect.cpp index f8e246f..9423dc1 100644 --- a/WebCore/svg/graphics/filters/SVGFilterEffect.cpp +++ b/WebCore/svg/graphics/filters/SVGFilterEffect.cpp @@ -26,6 +26,7 @@ #include "SVGRenderTreeAsText.h" #include "SVGResourceFilter.h" +#include "TextStream.h" namespace WebCore { |