Changeset 194964 in webkit


Ignore:
Timestamp:
Jan 13, 2016 9:04:36 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
https://bugs.webkit.org/show_bug.cgi?id=151810

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-01-13
Reviewed by Darin Adler.

Break the reference cycle between SVGPathElement and SVGPathSegWithContext
by changing the back-pointer to be a WeakPtr pointer instead of having it
RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly
the case when the SVGPathElement back-pointer is deleted.

Also change the SVGPathElement argument to the SVGPathSeg creation functions
and constructors to be a const reference instead of having it as a pointer
since SVGPathElement is the class factory for all these classes.

  • svg/SVGPathElement.cpp:

(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::createSVGPathSegClosePath):
(WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
(WebCore::SVGPathElement::createSVGPathSegMovetoRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
(WebCore::SVGPathElement::createSVGPathSegArcAbs):
(WebCore::SVGPathElement::createSVGPathSegArcRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
(WebCore::SVGPathElement::isSupportedAttribute):

  • svg/SVGPathElement.h:
  • svg/SVGPathSegArc.h:

(WebCore::SVGPathSegArc::SVGPathSegArc):

  • svg/SVGPathSegArcAbs.h:

(WebCore::SVGPathSegArcAbs::create):
(WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):

  • svg/SVGPathSegArcRel.h:

(WebCore::SVGPathSegArcRel::create):
(WebCore::SVGPathSegArcRel::SVGPathSegArcRel):

  • svg/SVGPathSegClosePath.h:

(WebCore::SVGPathSegClosePath::create):
(WebCore::SVGPathSegClosePath::SVGPathSegClosePath):

  • svg/SVGPathSegCurvetoCubic.h:

(WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic):

  • svg/SVGPathSegCurvetoCubicAbs.h:

(WebCore::SVGPathSegCurvetoCubicAbs::create):
(WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):

  • svg/SVGPathSegCurvetoCubicRel.h:

(WebCore::SVGPathSegCurvetoCubicRel::create):
(WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):

  • svg/SVGPathSegCurvetoCubicSmooth.h:

(WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth):

  • svg/SVGPathSegCurvetoCubicSmoothAbs.h:

(WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
(WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):

  • svg/SVGPathSegCurvetoCubicSmoothRel.h:

(WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
(WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):

  • svg/SVGPathSegCurvetoQuadratic.h:

(WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic):

  • svg/SVGPathSegCurvetoQuadraticAbs.h:

(WebCore::SVGPathSegCurvetoQuadraticAbs::create):
(WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):

  • svg/SVGPathSegCurvetoQuadraticRel.h:

(WebCore::SVGPathSegCurvetoQuadraticRel::create):
(WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):

  • svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:

(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
(WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):

  • svg/SVGPathSegCurvetoQuadraticSmoothRel.h:

(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
(WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):

  • svg/SVGPathSegLinetoAbs.h:

(WebCore::SVGPathSegLinetoAbs::create):
(WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):

  • svg/SVGPathSegLinetoHorizontal.h:

(WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal):

  • svg/SVGPathSegLinetoHorizontalAbs.h:

(WebCore::SVGPathSegLinetoHorizontalAbs::create):
(WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):

  • svg/SVGPathSegLinetoHorizontalRel.h:

(WebCore::SVGPathSegLinetoHorizontalRel::create):
(WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):

  • svg/SVGPathSegLinetoRel.h:

(WebCore::SVGPathSegLinetoRel::create):
(WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):

  • svg/SVGPathSegLinetoVertical.h:

(WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical):

  • svg/SVGPathSegLinetoVerticalAbs.h:

(WebCore::SVGPathSegLinetoVerticalAbs::create):
(WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):

  • svg/SVGPathSegLinetoVerticalRel.h:

(WebCore::SVGPathSegLinetoVerticalRel::create):
(WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):

  • svg/SVGPathSegMovetoAbs.h:

(WebCore::SVGPathSegMovetoAbs::create):
(WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):

  • svg/SVGPathSegMovetoRel.h:

(WebCore::SVGPathSegMovetoRel::create):
(WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):

  • svg/SVGPathSegWithContext.h:

(WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
(WebCore::SVGPathSegWithContext::animatedProperty):
(WebCore::SVGPathSegWithContext::contextElement):
(WebCore::SVGPathSegWithContext::setContextAndRole):
(WebCore::SVGPathSegWithContext::commitChange):
(WebCore::SVGPathSegSingleCoordinate::setY):
(WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate):

  • svg/properties/SVGPathSegListPropertyTearOff.cpp:

(WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
(WebCore::SVGPathSegListPropertyTearOff::replaceItem):
(WebCore::SVGPathSegListPropertyTearOff::removeItem):

Location:
trunk/Source/WebCore
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r194963 r194964  
     12016-01-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
     4        https://bugs.webkit.org/show_bug.cgi?id=151810
     5
     6        Reviewed by Darin Adler.
     7
     8        Break the reference cycle between SVGPathElement and SVGPathSegWithContext
     9        by changing the back-pointer to be a WeakPtr pointer instead of having it
     10        RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly
     11        the case when the SVGPathElement back-pointer is deleted.
     12
     13        Also change the SVGPathElement argument to the SVGPathSeg creation functions
     14        and constructors to be a const reference instead of having it as a pointer
     15        since SVGPathElement is the class factory for all these classes.
     16
     17        * svg/SVGPathElement.cpp:
     18        (WebCore::SVGPathElement::SVGPathElement):
     19        (WebCore::SVGPathElement::createSVGPathSegClosePath):
     20        (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
     21        (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
     22        (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
     23        (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
     24        (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
     25        (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
     26        (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
     27        (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
     28        (WebCore::SVGPathElement::createSVGPathSegArcAbs):
     29        (WebCore::SVGPathElement::createSVGPathSegArcRel):
     30        (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
     31        (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
     32        (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
     33        (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
     34        (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
     35        (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
     36        (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
     37        (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
     38        (WebCore::SVGPathElement::isSupportedAttribute):
     39        * svg/SVGPathElement.h:
     40        * svg/SVGPathSegArc.h:
     41        (WebCore::SVGPathSegArc::SVGPathSegArc):
     42        * svg/SVGPathSegArcAbs.h:
     43        (WebCore::SVGPathSegArcAbs::create):
     44        (WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
     45        * svg/SVGPathSegArcRel.h:
     46        (WebCore::SVGPathSegArcRel::create):
     47        (WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
     48        * svg/SVGPathSegClosePath.h:
     49        (WebCore::SVGPathSegClosePath::create):
     50        (WebCore::SVGPathSegClosePath::SVGPathSegClosePath):
     51        * svg/SVGPathSegCurvetoCubic.h:
     52        (WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic):
     53        * svg/SVGPathSegCurvetoCubicAbs.h:
     54        (WebCore::SVGPathSegCurvetoCubicAbs::create):
     55        (WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
     56        * svg/SVGPathSegCurvetoCubicRel.h:
     57        (WebCore::SVGPathSegCurvetoCubicRel::create):
     58        (WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
     59        * svg/SVGPathSegCurvetoCubicSmooth.h:
     60        (WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth):
     61        * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
     62        (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
     63        (WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
     64        * svg/SVGPathSegCurvetoCubicSmoothRel.h:
     65        (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
     66        (WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
     67        * svg/SVGPathSegCurvetoQuadratic.h:
     68        (WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic):
     69        * svg/SVGPathSegCurvetoQuadraticAbs.h:
     70        (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
     71        (WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
     72        * svg/SVGPathSegCurvetoQuadraticRel.h:
     73        (WebCore::SVGPathSegCurvetoQuadraticRel::create):
     74        (WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
     75        * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
     76        (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
     77        (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
     78        * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
     79        (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
     80        (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
     81        * svg/SVGPathSegLinetoAbs.h:
     82        (WebCore::SVGPathSegLinetoAbs::create):
     83        (WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
     84        * svg/SVGPathSegLinetoHorizontal.h:
     85        (WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal):
     86        * svg/SVGPathSegLinetoHorizontalAbs.h:
     87        (WebCore::SVGPathSegLinetoHorizontalAbs::create):
     88        (WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
     89        * svg/SVGPathSegLinetoHorizontalRel.h:
     90        (WebCore::SVGPathSegLinetoHorizontalRel::create):
     91        (WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
     92        * svg/SVGPathSegLinetoRel.h:
     93        (WebCore::SVGPathSegLinetoRel::create):
     94        (WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
     95        * svg/SVGPathSegLinetoVertical.h:
     96        (WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical):
     97        * svg/SVGPathSegLinetoVerticalAbs.h:
     98        (WebCore::SVGPathSegLinetoVerticalAbs::create):
     99        (WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
     100        * svg/SVGPathSegLinetoVerticalRel.h:
     101        (WebCore::SVGPathSegLinetoVerticalRel::create):
     102        (WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
     103        * svg/SVGPathSegMovetoAbs.h:
     104        (WebCore::SVGPathSegMovetoAbs::create):
     105        (WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
     106        * svg/SVGPathSegMovetoRel.h:
     107        (WebCore::SVGPathSegMovetoRel::create):
     108        (WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
     109        * svg/SVGPathSegWithContext.h:
     110        (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
     111        (WebCore::SVGPathSegWithContext::animatedProperty):
     112        (WebCore::SVGPathSegWithContext::contextElement):
     113        (WebCore::SVGPathSegWithContext::setContextAndRole):
     114        (WebCore::SVGPathSegWithContext::commitChange):
     115        (WebCore::SVGPathSegSingleCoordinate::setY):
     116        (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate):
     117        * svg/properties/SVGPathSegListPropertyTearOff.cpp:
     118        (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
     119        (WebCore::SVGPathSegListPropertyTearOff::replaceItem):
     120        (WebCore::SVGPathSegListPropertyTearOff::removeItem):
     121
    11222016-01-13  Andreas Kling  <akling@apple.com>
    2123
  • trunk/Source/WebCore/svg/SVGPathElement.cpp

    r194496 r194964  
    8181    : SVGGraphicsElement(tagName, document)
    8282    , m_pathSegList(PathSegUnalteredRole)
     83    , m_weakPtrFactory(this)
    8384    , m_isAnimValObserved(false)
    8485{
     
    115116Ref<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath(SVGPathSegRole role)
    116117{
    117     return SVGPathSegClosePath::create(this, role);
     118    return SVGPathSegClosePath::create(*this, role);
    118119}
    119120
    120121Ref<SVGPathSegMovetoAbs> SVGPathElement::createSVGPathSegMovetoAbs(float x, float y, SVGPathSegRole role)
    121122{
    122     return SVGPathSegMovetoAbs::create(this, role, x, y);
     123    return SVGPathSegMovetoAbs::create(*this, role, x, y);
    123124}
    124125
    125126Ref<SVGPathSegMovetoRel> SVGPathElement::createSVGPathSegMovetoRel(float x, float y, SVGPathSegRole role)
    126127{
    127     return SVGPathSegMovetoRel::create(this, role, x, y);
     128    return SVGPathSegMovetoRel::create(*this, role, x, y);
    128129}
    129130
    130131Ref<SVGPathSegLinetoAbs> SVGPathElement::createSVGPathSegLinetoAbs(float x, float y, SVGPathSegRole role)
    131132{
    132     return SVGPathSegLinetoAbs::create(this, role, x, y);
     133    return SVGPathSegLinetoAbs::create(*this, role, x, y);
    133134}
    134135
    135136Ref<SVGPathSegLinetoRel> SVGPathElement::createSVGPathSegLinetoRel(float x, float y, SVGPathSegRole role)
    136137{
    137     return SVGPathSegLinetoRel::create(this, role, x, y);
     138    return SVGPathSegLinetoRel::create(*this, role, x, y);
    138139}
    139140
    140141Ref<SVGPathSegCurvetoCubicAbs> SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole role)
    141142{
    142     return SVGPathSegCurvetoCubicAbs::create(this, role, x, y, x1, y1, x2, y2);
     143    return SVGPathSegCurvetoCubicAbs::create(*this, role, x, y, x1, y1, x2, y2);
    143144}
    144145
    145146Ref<SVGPathSegCurvetoCubicRel> SVGPathElement::createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole role)
    146147{
    147     return SVGPathSegCurvetoCubicRel::create(this, role, x, y, x1, y1, x2, y2);
     148    return SVGPathSegCurvetoCubicRel::create(*this, role, x, y, x1, y1, x2, y2);
    148149}
    149150
    150151Ref<SVGPathSegCurvetoQuadraticAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, SVGPathSegRole role)
    151152{
    152     return SVGPathSegCurvetoQuadraticAbs::create(this, role, x, y, x1, y1);
     153    return SVGPathSegCurvetoQuadraticAbs::create(*this, role, x, y, x1, y1);
    153154}
    154155
    155156Ref<SVGPathSegCurvetoQuadraticRel> SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, SVGPathSegRole role)
    156157{
    157     return SVGPathSegCurvetoQuadraticRel::create(this, role, x, y, x1, y1);
     158    return SVGPathSegCurvetoQuadraticRel::create(*this, role, x, y, x1, y1);
    158159}
    159160
    160161Ref<SVGPathSegArcAbs> SVGPathElement::createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole role)
    161162{
    162     return SVGPathSegArcAbs::create(this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
     163    return SVGPathSegArcAbs::create(*this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
    163164}
    164165
    165166Ref<SVGPathSegArcRel> SVGPathElement::createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole role)
    166167{
    167     return SVGPathSegArcRel::create(this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
     168    return SVGPathSegArcRel::create(*this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
    168169}
    169170
    170171Ref<SVGPathSegLinetoHorizontalAbs> SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x, SVGPathSegRole role)
    171172{
    172     return SVGPathSegLinetoHorizontalAbs::create(this, role, x);
     173    return SVGPathSegLinetoHorizontalAbs::create(*this, role, x);
    173174}
    174175
    175176Ref<SVGPathSegLinetoHorizontalRel> SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x, SVGPathSegRole role)
    176177{
    177     return SVGPathSegLinetoHorizontalRel::create(this, role, x);
     178    return SVGPathSegLinetoHorizontalRel::create(*this, role, x);
    178179}
    179180
    180181Ref<SVGPathSegLinetoVerticalAbs> SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y, SVGPathSegRole role)
    181182{
    182     return SVGPathSegLinetoVerticalAbs::create(this, role, y);
     183    return SVGPathSegLinetoVerticalAbs::create(*this, role, y);
    183184}
    184185
    185186Ref<SVGPathSegLinetoVerticalRel> SVGPathElement::createSVGPathSegLinetoVerticalRel(float y, SVGPathSegRole role)
    186187{
    187     return SVGPathSegLinetoVerticalRel::create(this, role, y);
     188    return SVGPathSegLinetoVerticalRel::create(*this, role, y);
    188189}
    189190
    190191Ref<SVGPathSegCurvetoCubicSmoothAbs> SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, SVGPathSegRole role)
    191192{
    192     return SVGPathSegCurvetoCubicSmoothAbs::create(this, role, x, y, x2, y2);
     193    return SVGPathSegCurvetoCubicSmoothAbs::create(*this, role, x, y, x2, y2);
    193194}
    194195
    195196Ref<SVGPathSegCurvetoCubicSmoothRel> SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, SVGPathSegRole role)
    196197{
    197     return SVGPathSegCurvetoCubicSmoothRel::create(this, role, x, y, x2, y2);
     198    return SVGPathSegCurvetoCubicSmoothRel::create(*this, role, x, y, x2, y2);
    198199}
    199200
    200201Ref<SVGPathSegCurvetoQuadraticSmoothAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, SVGPathSegRole role)
    201202{
    202     return SVGPathSegCurvetoQuadraticSmoothAbs::create(this, role, x, y);
     203    return SVGPathSegCurvetoQuadraticSmoothAbs::create(*this, role, x, y);
    203204}
    204205
    205206Ref<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, SVGPathSegRole role)
    206207{
    207     return SVGPathSegCurvetoQuadraticSmoothRel::create(this, role, x, y);
     208    return SVGPathSegCurvetoQuadraticSmoothRel::create(*this, role, x, y);
    208209}
    209210
  • trunk/Source/WebCore/svg/SVGPathElement.h

    r190844 r194964  
    9898    bool isAnimValObserved() const { return m_isAnimValObserved; }
    9999
     100    WeakPtr<SVGPathElement> createWeakPtr() const { return m_weakPtrFactory.createWeakPtr(); }
     101
    100102private:
    101103    SVGPathElement(const QualifiedName&, Document&);
     
    127129    SVGPathByteStream m_pathByteStream;
    128130    mutable SVGSynchronizableAnimatedProperty<SVGPathSegList> m_pathSegList;
     131    WeakPtrFactory<SVGPathElement> m_weakPtrFactory;
    129132    bool m_isAnimValObserved;
    130133};
  • trunk/Source/WebCore/svg/SVGPathSegArc.h

    r163440 r194964  
    2828class SVGPathSegArc : public SVGPathSegWithContext {
    2929public:
    30     SVGPathSegArc(SVGPathElement* element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
     30    SVGPathSegArc(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
    3131        : SVGPathSegWithContext(element, role)
    3232        , m_x(x)
  • trunk/Source/WebCore/svg/SVGPathSegArcAbs.h

    r183536 r194964  
    2929class SVGPathSegArcAbs : public SVGPathSegArc {
    3030public:
    31     static Ref<SVGPathSegArcAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
     31    static Ref<SVGPathSegArcAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
    3232    {
    3333        return adoptRef(*new SVGPathSegArcAbs(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag));
     
    3535
    3636private:
    37     SVGPathSegArcAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
     37    SVGPathSegArcAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
    3838        : SVGPathSegArc(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegArcRel.h

    r183536 r194964  
    2929class SVGPathSegArcRel : public SVGPathSegArc {
    3030public:
    31     static Ref<SVGPathSegArcRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
     31    static Ref<SVGPathSegArcRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
    3232    {
    3333        return adoptRef(*new SVGPathSegArcRel(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag));
     
    3535
    3636private:
    37     SVGPathSegArcRel(SVGPathElement* element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
     37    SVGPathSegArcRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag)
    3838        : SVGPathSegArc(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegClosePath.h

    r183536 r194964  
    2828class SVGPathSegClosePath : public SVGPathSegWithContext {
    2929public:
    30     static Ref<SVGPathSegClosePath> create(SVGPathElement* element, SVGPathSegRole role)
     30    static Ref<SVGPathSegClosePath> create(const SVGPathElement& element, SVGPathSegRole role)
    3131    {
    3232        return adoptRef(*new SVGPathSegClosePath(element, role));
     
    3434
    3535private:
    36     SVGPathSegClosePath(SVGPathElement* element, SVGPathSegRole role)
     36    SVGPathSegClosePath(const SVGPathElement& element, SVGPathSegRole role)
    3737        : SVGPathSegWithContext(element, role)
    3838    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoCubic.h

    r163440 r194964  
    2828class SVGPathSegCurvetoCubic : public SVGPathSegWithContext {
    2929public:
    30     SVGPathSegCurvetoCubic(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
     30    SVGPathSegCurvetoCubic(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
    3131        : SVGPathSegWithContext(element, role)
    3232        , m_x(x)
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoCubicAbs.h

    r183536 r194964  
    2929class SVGPathSegCurvetoCubicAbs : public SVGPathSegCurvetoCubic {
    3030public:
    31     static Ref<SVGPathSegCurvetoCubicAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
     31    static Ref<SVGPathSegCurvetoCubicAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoCubicAbs(element, role, x, y, x1, y1, x2, y2));
     
    3535
    3636private:
    37     SVGPathSegCurvetoCubicAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
     37    SVGPathSegCurvetoCubicAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
    3838        : SVGPathSegCurvetoCubic(element, role, x, y, x1, y1, x2, y2)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoCubicRel.h

    r183536 r194964  
    2929class SVGPathSegCurvetoCubicRel : public SVGPathSegCurvetoCubic {
    3030public:
    31     static Ref<SVGPathSegCurvetoCubicRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
     31    static Ref<SVGPathSegCurvetoCubicRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoCubicRel(element, role, x, y, x1, y1, x2, y2));
     
    3535
    3636private:
    37     SVGPathSegCurvetoCubicRel(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
     37    SVGPathSegCurvetoCubicRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2)
    3838        : SVGPathSegCurvetoCubic(element, role, x, y, x1, y1, x2, y2)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h

    r163440 r194964  
    2828class SVGPathSegCurvetoCubicSmooth : public SVGPathSegWithContext {
    2929public:
    30     SVGPathSegCurvetoCubicSmooth(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x2, float y2)
     30    SVGPathSegCurvetoCubicSmooth(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2)
    3131        : SVGPathSegWithContext(element, role)
    3232        , m_x(x)
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.h

    r183536 r194964  
    2929class SVGPathSegCurvetoCubicSmoothAbs : public SVGPathSegCurvetoCubicSmooth {
    3030public:
    31     static Ref<SVGPathSegCurvetoCubicSmoothAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x2, float y2)
     31    static Ref<SVGPathSegCurvetoCubicSmoothAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoCubicSmoothAbs(element, role, x, y, x2, y2));
     
    3535
    3636private:
    37     SVGPathSegCurvetoCubicSmoothAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x2, float y2)
     37    SVGPathSegCurvetoCubicSmoothAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2)
    3838        : SVGPathSegCurvetoCubicSmooth(element, role, x, y, x2, y2)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.h

    r183536 r194964  
    2929class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSegCurvetoCubicSmooth {
    3030public:
    31     static Ref<SVGPathSegCurvetoCubicSmoothRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x2, float y2)
     31    static Ref<SVGPathSegCurvetoCubicSmoothRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoCubicSmoothRel(element, role, x, y, x2, y2));
     
    3535
    3636private:
    37     SVGPathSegCurvetoCubicSmoothRel(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x2, float y2)
     37    SVGPathSegCurvetoCubicSmoothRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2)
    3838        : SVGPathSegCurvetoCubicSmooth(element, role, x, y, x2, y2)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoQuadratic.h

    r163440 r194964  
    2828class SVGPathSegCurvetoQuadratic : public SVGPathSegWithContext {
    2929public:
    30     SVGPathSegCurvetoQuadratic(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1)
     30    SVGPathSegCurvetoQuadratic(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1)
    3131        : SVGPathSegWithContext(element, role)
    3232        , m_x(x)
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoQuadraticAbs.h

    r183536 r194964  
    2929class SVGPathSegCurvetoQuadraticAbs : public SVGPathSegCurvetoQuadratic {
    3030public:
    31     static Ref<SVGPathSegCurvetoQuadraticAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1)
     31    static Ref<SVGPathSegCurvetoQuadraticAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoQuadraticAbs(element, role, x, y, x1, y1));
     
    3535
    3636private:
    37     SVGPathSegCurvetoQuadraticAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1)
     37    SVGPathSegCurvetoQuadraticAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1)
    3838        : SVGPathSegCurvetoQuadratic(element, role, x, y, x1, y1)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoQuadraticRel.h

    r183536 r194964  
    2929class SVGPathSegCurvetoQuadraticRel : public SVGPathSegCurvetoQuadratic {
    3030public:
    31     static Ref<SVGPathSegCurvetoQuadraticRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1)
     31    static Ref<SVGPathSegCurvetoQuadraticRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoQuadraticRel(element, role, x, y, x1, y1));
     
    3535
    3636private:
    37     SVGPathSegCurvetoQuadraticRel(SVGPathElement* element, SVGPathSegRole role, float x, float y, float x1, float y1)
     37    SVGPathSegCurvetoQuadraticRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1)
    3838        : SVGPathSegCurvetoQuadratic(element, role, x, y, x1, y1)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.h

    r183536 r194964  
    2929class SVGPathSegCurvetoQuadraticSmoothAbs : public SVGPathSegSingleCoordinate {
    3030public:
    31     static Ref<SVGPathSegCurvetoQuadraticSmoothAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     31    static Ref<SVGPathSegCurvetoQuadraticSmoothAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoQuadraticSmoothAbs(element, role, x, y));
     
    3535
    3636private:
    37     SVGPathSegCurvetoQuadraticSmoothAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     37    SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3838        : SVGPathSegSingleCoordinate(element, role, x, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.h

    r183536 r194964  
    2929class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSegSingleCoordinate {
    3030public:
    31     static Ref<SVGPathSegCurvetoQuadraticSmoothRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     31    static Ref<SVGPathSegCurvetoQuadraticSmoothRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegCurvetoQuadraticSmoothRel(element, role, x, y));
     
    3535
    3636private:
    37     SVGPathSegCurvetoQuadraticSmoothRel(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     37    SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3838        : SVGPathSegSingleCoordinate(element, role, x, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegLinetoAbs.h

    r183536 r194964  
    2929class SVGPathSegLinetoAbs : public SVGPathSegSingleCoordinate {
    3030public:
    31     static Ref<SVGPathSegLinetoAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     31    static Ref<SVGPathSegLinetoAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegLinetoAbs(element, role, x, y));
     
    3535
    3636private:
    37     SVGPathSegLinetoAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     37    SVGPathSegLinetoAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3838        : SVGPathSegSingleCoordinate(element, role, x, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegLinetoHorizontal.h

    r163440 r194964  
    2828class SVGPathSegLinetoHorizontal : public SVGPathSegWithContext {
    2929public:
    30     SVGPathSegLinetoHorizontal(SVGPathElement* element, SVGPathSegRole role, float x)
     30    SVGPathSegLinetoHorizontal(const SVGPathElement& element, SVGPathSegRole role, float x)
    3131        : SVGPathSegWithContext(element, role)
    3232        , m_x(x)
  • trunk/Source/WebCore/svg/SVGPathSegLinetoHorizontalAbs.h

    r183536 r194964  
    2929class SVGPathSegLinetoHorizontalAbs : public SVGPathSegLinetoHorizontal {
    3030public:
    31     static Ref<SVGPathSegLinetoHorizontalAbs> create(SVGPathElement* element, SVGPathSegRole role, float x)
     31    static Ref<SVGPathSegLinetoHorizontalAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x)
    3232    {
    3333        return adoptRef(*new SVGPathSegLinetoHorizontalAbs(element, role, x));
     
    3535
    3636private:
    37     SVGPathSegLinetoHorizontalAbs(SVGPathElement* element, SVGPathSegRole role, float x)
     37    SVGPathSegLinetoHorizontalAbs(const SVGPathElement& element, SVGPathSegRole role, float x)
    3838        : SVGPathSegLinetoHorizontal(element, role, x)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegLinetoHorizontalRel.h

    r183536 r194964  
    2929class SVGPathSegLinetoHorizontalRel : public SVGPathSegLinetoHorizontal {
    3030public:
    31     static Ref<SVGPathSegLinetoHorizontalRel> create(SVGPathElement* element, SVGPathSegRole role, float x)
     31    static Ref<SVGPathSegLinetoHorizontalRel> create(const SVGPathElement& element, SVGPathSegRole role, float x)
    3232    {
    3333        return adoptRef(*new SVGPathSegLinetoHorizontalRel(element, role, x));
     
    3535
    3636private:
    37     SVGPathSegLinetoHorizontalRel(SVGPathElement* element, SVGPathSegRole role, float x)
     37    SVGPathSegLinetoHorizontalRel(const SVGPathElement& element, SVGPathSegRole role, float x)
    3838        : SVGPathSegLinetoHorizontal(element, role, x)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegLinetoRel.h

    r183536 r194964  
    2929class SVGPathSegLinetoRel : public SVGPathSegSingleCoordinate {
    3030public:
    31     static Ref<SVGPathSegLinetoRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     31    static Ref<SVGPathSegLinetoRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegLinetoRel(element, role, x, y));
     
    3535
    3636private:
    37     SVGPathSegLinetoRel(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     37    SVGPathSegLinetoRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3838        : SVGPathSegSingleCoordinate(element, role, x, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegLinetoVertical.h

    r163440 r194964  
    2828class SVGPathSegLinetoVertical : public SVGPathSegWithContext {
    2929public:
    30     SVGPathSegLinetoVertical(SVGPathElement* element, SVGPathSegRole role, float y)
     30    SVGPathSegLinetoVertical(const SVGPathElement& element, SVGPathSegRole role, float y)
    3131        : SVGPathSegWithContext(element, role)
    3232        , m_y(y)
  • trunk/Source/WebCore/svg/SVGPathSegLinetoVerticalAbs.h

    r183536 r194964  
    2929class SVGPathSegLinetoVerticalAbs : public SVGPathSegLinetoVertical {
    3030public:
    31     static Ref<SVGPathSegLinetoVerticalAbs> create(SVGPathElement* element, SVGPathSegRole role, float y)
     31    static Ref<SVGPathSegLinetoVerticalAbs> create(const SVGPathElement& element, SVGPathSegRole role, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegLinetoVerticalAbs(element, role, y));
     
    3535
    3636private:
    37     SVGPathSegLinetoVerticalAbs(SVGPathElement* element, SVGPathSegRole role, float y)
     37    SVGPathSegLinetoVerticalAbs(const SVGPathElement& element, SVGPathSegRole role, float y)
    3838        : SVGPathSegLinetoVertical(element, role, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegLinetoVerticalRel.h

    r183536 r194964  
    2929class SVGPathSegLinetoVerticalRel : public SVGPathSegLinetoVertical {
    3030public:
    31     static Ref<SVGPathSegLinetoVerticalRel> create(SVGPathElement* element, SVGPathSegRole role, float y)
     31    static Ref<SVGPathSegLinetoVerticalRel> create(const SVGPathElement& element, SVGPathSegRole role, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegLinetoVerticalRel(element, role, y));
     
    3535
    3636private:
    37     SVGPathSegLinetoVerticalRel(SVGPathElement* element, SVGPathSegRole role, float y)
     37    SVGPathSegLinetoVerticalRel(const SVGPathElement& element, SVGPathSegRole role, float y)
    3838        : SVGPathSegLinetoVertical(element, role, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegMovetoAbs.h

    r183536 r194964  
    2929class SVGPathSegMovetoAbs : public SVGPathSegSingleCoordinate {
    3030public:
    31     static Ref<SVGPathSegMovetoAbs> create(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     31    static Ref<SVGPathSegMovetoAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegMovetoAbs(element, role, x, y));
     
    3535
    3636private:
    37     SVGPathSegMovetoAbs(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     37    SVGPathSegMovetoAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3838        : SVGPathSegSingleCoordinate(element, role, x, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegMovetoRel.h

    r183536 r194964  
    2929class SVGPathSegMovetoRel : public SVGPathSegSingleCoordinate {
    3030public:
    31     static Ref<SVGPathSegMovetoRel> create(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     31    static Ref<SVGPathSegMovetoRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3232    {
    3333        return adoptRef(*new SVGPathSegMovetoRel(element, role, x, y));
     
    3535
    3636private:
    37     SVGPathSegMovetoRel(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     37    SVGPathSegMovetoRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    3838        : SVGPathSegSingleCoordinate(element, role, x, y)
    3939    {
  • trunk/Source/WebCore/svg/SVGPathSegWithContext.h

    r163440 r194964  
    2727class SVGPathSegWithContext : public SVGPathSeg {
    2828public:
    29     SVGPathSegWithContext(SVGPathElement* element, SVGPathSegRole role)
     29    SVGPathSegWithContext(const SVGPathElement& element, SVGPathSegRole role)
    3030        : m_role(role)
    31         , m_element(element)
     31        , m_element(element.createWeakPtr())
    3232    {
    3333    }
     
    3535    SVGAnimatedProperty* animatedProperty() const
    3636    {
     37        if (!m_element)
     38            return nullptr;
     39
    3740        switch (m_role) {
    3841        case PathSegUndefinedRole:
    39             return 0;
     42            return nullptr;
    4043        case PathSegUnalteredRole:
    4144            return SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(m_element.get(), SVGPathElement::dPropertyInfo());
    4245        case PathSegNormalizedRole:
    4346            // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists!
    44             return 0;
     47            return nullptr;
    4548        };
    4649
    47         return 0;
     50        return nullptr;
    4851    }
    4952
     
    5457    {
    5558        m_role = role;
    56         m_element = element;
     59        m_element = element ? element->createWeakPtr() : WeakPtr<SVGPathElement>();
    5760    }
    5861
     
    6063    void commitChange()
    6164    {
    62         if (!m_element) {
    63             ASSERT(m_role == PathSegUndefinedRole);
     65        if (!m_element || m_role == PathSegUndefinedRole)
    6466            return;
    65         }
    66 
    67         ASSERT(m_role != PathSegUndefinedRole);
    6867        m_element->pathSegListChanged(m_role);
    6968    }
     
    7170private:
    7271    SVGPathSegRole m_role;
    73     RefPtr<SVGPathElement> m_element;
     72    WeakPtr<SVGPathElement> m_element;
    7473};
    7574
     
    9190
    9291protected:
    93     SVGPathSegSingleCoordinate(SVGPathElement* element, SVGPathSegRole role, float x, float y)
     92    SVGPathSegSingleCoordinate(const SVGPathElement& element, SVGPathSegRole role, float x, float y)
    9493        : SVGPathSegWithContext(element, role)
    9594        , m_x(x)
  • trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp

    r184844 r194964  
    3232    ASSERT(m_values);
    3333    for (auto& item : *m_values) {
    34         static_cast<SVGPathSegWithContext*>(item.get())->setContextAndRole(0, PathSegUndefinedRole);
     34        static_cast<SVGPathSegWithContext*>(item.get())->setContextAndRole(nullptr, PathSegUndefinedRole);
    3535    }
    3636}
     
    6767        ListItemType replacedItem = m_values->at(index);
    6868        ASSERT(replacedItem);
    69         static_cast<SVGPathSegWithContext*>(replacedItem.get())->setContextAndRole(0, PathSegUndefinedRole);
     69        static_cast<SVGPathSegWithContext*>(replacedItem.get())->setContextAndRole(nullptr, PathSegUndefinedRole);
    7070    }
    7171
     
    7777    SVGPathSegListPropertyTearOff::ListItemType removedItem = SVGPathSegListPropertyTearOff::Base::removeItemValues(index, ec);
    7878    if (removedItem)
    79         static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRole(0, PathSegUndefinedRole);
     79        static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRole(nullptr, PathSegUndefinedRole);
    8080    return removedItem;
    8181}
Note: See TracChangeset for help on using the changeset viewer.