зеркало из https://github.com/mozilla/pjs.git
Fix for bug 467671 (Leak 6 nsGlobalWindows due to DOMAnimatedLength not participating in cycle collection).
This commit is contained in:
Родитель
afb66a3a67
Коммит
f4f1bc1855
|
@ -88,31 +88,37 @@ private:
|
|||
nsSVGAngle mVal;
|
||||
};
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGAngle::DOMBaseVal)
|
||||
NS_IMPL_RELEASE(nsSVGAngle::DOMBaseVal)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGAngle::DOMBaseVal, mSVGElement)
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGAngle::DOMAnimVal)
|
||||
NS_IMPL_RELEASE(nsSVGAngle::DOMAnimVal)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGAngle::DOMAnimVal, mSVGElement)
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGAngle::DOMAnimatedAngle)
|
||||
NS_IMPL_RELEASE(nsSVGAngle::DOMAnimatedAngle)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGAngle::DOMAnimatedAngle, mSVGElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGAngle::DOMBaseVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGAngle::DOMBaseVal)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGAngle::DOMAnimVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGAngle::DOMAnimVal)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGAngle::DOMAnimatedAngle)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGAngle::DOMAnimatedAngle)
|
||||
|
||||
NS_IMPL_ADDREF(DOMSVGAngle)
|
||||
NS_IMPL_RELEASE(DOMSVGAngle)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGAngle::DOMBaseVal)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGAngle::DOMBaseVal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAngle)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAngle)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGAngle::DOMAnimVal)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGAngle::DOMAnimVal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAngle)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAngle)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGAngle::DOMAnimatedAngle)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGAngle::DOMAnimatedAngle)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedAngle)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedAngle)
|
||||
|
|
|
@ -93,7 +93,8 @@ private:
|
|||
|
||||
struct DOMBaseVal : public nsIDOMSVGAngle
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
|
||||
|
||||
DOMBaseVal(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
@ -132,7 +133,8 @@ private:
|
|||
|
||||
struct DOMAnimVal : public nsIDOMSVGAngle
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
|
||||
|
||||
DOMAnimVal(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
@ -168,7 +170,8 @@ private:
|
|||
|
||||
struct DOMAnimatedAngle : public nsIDOMSVGAnimatedAngle
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedAngle)
|
||||
|
||||
DOMAnimatedAngle(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -36,10 +36,12 @@
|
|||
|
||||
#include "nsSVGBoolean.h"
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGBoolean::DOMAnimatedBoolean)
|
||||
NS_IMPL_RELEASE(nsSVGBoolean::DOMAnimatedBoolean)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGBoolean::DOMAnimatedBoolean, mSVGElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGBoolean::DOMAnimatedBoolean)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGBoolean::DOMAnimatedBoolean)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGBoolean::DOMAnimatedBoolean)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGBoolean::DOMAnimatedBoolean)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedBoolean)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedBoolean)
|
||||
|
@ -94,4 +96,3 @@ nsSVGBoolean::ToDOMAnimatedBoolean(nsIDOMSVGAnimatedBoolean **aResult,
|
|||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,8 @@ private:
|
|||
|
||||
struct DOMAnimatedBoolean : public nsIDOMSVGAnimatedBoolean
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedBoolean)
|
||||
|
||||
DOMAnimatedBoolean(nsSVGBoolean* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -363,4 +363,14 @@ NS_NewSVG##_elementName##Element(nsIContent **aResult, \
|
|||
return rv; \
|
||||
}
|
||||
|
||||
// No unlinking, we'd need to null out the value pointer (the object it
|
||||
// points to is held by the element) and null-check it everywhere.
|
||||
#define NS_SVG_VAL_IMPL_CYCLE_COLLECTION(_val, _element) \
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(_val) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_val) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(_element, nsIContent) \
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_val)
|
||||
|
||||
|
||||
#endif // __NS_SVGELEMENT_H__
|
||||
|
|
|
@ -38,10 +38,12 @@
|
|||
#include "nsIAtom.h"
|
||||
#include "nsSVGElement.h"
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGEnum::DOMAnimatedEnum)
|
||||
NS_IMPL_RELEASE(nsSVGEnum::DOMAnimatedEnum)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGEnum::DOMAnimatedEnum, mSVGElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGEnum::DOMAnimatedEnum)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGEnum::DOMAnimatedEnum)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGEnum::DOMAnimatedEnum)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGEnum::DOMAnimatedEnum)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedEnumeration)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedEnumeration)
|
||||
|
|
|
@ -83,7 +83,8 @@ private:
|
|||
|
||||
struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum)
|
||||
|
||||
DOMAnimatedEnum(nsSVGEnum* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -36,10 +36,13 @@
|
|||
|
||||
#include "nsSVGInteger.h"
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGInteger::DOMAnimatedInteger)
|
||||
NS_IMPL_RELEASE(nsSVGInteger::DOMAnimatedInteger)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGInteger::DOMAnimatedInteger)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger, mSVGElement)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGInteger::DOMAnimatedInteger)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGInteger::DOMAnimatedInteger)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedInteger)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedInteger)
|
||||
|
@ -96,4 +99,3 @@ nsSVGInteger::ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult,
|
|||
NS_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,8 @@ private:
|
|||
|
||||
struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)
|
||||
|
||||
DOMAnimatedInteger(nsSVGInteger* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -43,28 +43,34 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsSVGIntegrationUtils.h"
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGLength2::DOMBaseVal)
|
||||
NS_IMPL_RELEASE(nsSVGLength2::DOMBaseVal)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal, mSVGElement)
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGLength2::DOMAnimVal)
|
||||
NS_IMPL_RELEASE(nsSVGLength2::DOMAnimVal)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal, mSVGElement)
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGLength2::DOMAnimatedLength)
|
||||
NS_IMPL_RELEASE(nsSVGLength2::DOMAnimatedLength)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength, mSVGElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGLength2::DOMBaseVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMBaseVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMBaseVal)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMAnimVal)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMAnimVal)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMAnimatedLength)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMAnimatedLength)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLength)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGLength2::DOMAnimVal)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLength)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGLength2::DOMAnimatedLength)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLength)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedLength)
|
||||
|
|
|
@ -123,7 +123,8 @@ private:
|
|||
|
||||
struct DOMBaseVal : public nsIDOMSVGLength
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
|
||||
|
||||
DOMBaseVal(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
@ -162,7 +163,8 @@ private:
|
|||
|
||||
struct DOMAnimVal : public nsIDOMSVGLength
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
|
||||
|
||||
DOMAnimVal(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
@ -198,7 +200,8 @@ private:
|
|||
|
||||
struct DOMAnimatedLength : public nsIDOMSVGAnimatedLength
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedLength)
|
||||
|
||||
DOMAnimatedLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -78,10 +78,12 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Marker)
|
|||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGOrientType::DOMAnimatedEnum)
|
||||
NS_IMPL_RELEASE(nsSVGOrientType::DOMAnimatedEnum)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGOrientType::DOMAnimatedEnum, mSVGElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGOrientType::DOMAnimatedEnum)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGOrientType::DOMAnimatedEnum)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGOrientType::DOMAnimatedEnum)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGOrientType::DOMAnimatedEnum)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedEnumeration)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedEnumeration)
|
||||
|
|
|
@ -71,7 +71,8 @@ private:
|
|||
|
||||
struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum)
|
||||
|
||||
DOMAnimatedEnum(nsSVGOrientType* aVal,
|
||||
nsSVGElement *aSVGElement)
|
||||
|
|
|
@ -38,10 +38,12 @@
|
|||
#include "nsTextFormatter.h"
|
||||
#include "prdtoa.h"
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGNumber2::DOMAnimatedNumber)
|
||||
NS_IMPL_RELEASE(nsSVGNumber2::DOMAnimatedNumber)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGNumber2::DOMAnimatedNumber, mSVGElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGNumber2::DOMAnimatedNumber)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGNumber2::DOMAnimatedNumber)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGNumber2::DOMAnimatedNumber)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGNumber2::DOMAnimatedNumber)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedNumber)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedNumber)
|
||||
|
|
|
@ -73,7 +73,8 @@ private:
|
|||
|
||||
struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)
|
||||
|
||||
DOMAnimatedNumber(nsSVGNumber2* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -36,10 +36,12 @@
|
|||
|
||||
#include "nsSVGString.h"
|
||||
|
||||
NS_IMPL_ADDREF(nsSVGString::DOMAnimatedString)
|
||||
NS_IMPL_RELEASE(nsSVGString::DOMAnimatedString)
|
||||
NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGString::DOMAnimatedString, mSVGElement)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsSVGString::DOMAnimatedString)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGString::DOMAnimatedString)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGString::DOMAnimatedString)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGString::DOMAnimatedString)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedString)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedString)
|
||||
|
|
|
@ -70,7 +70,8 @@ private:
|
|||
|
||||
struct DOMAnimatedString : public nsIDOMSVGAnimatedString
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString)
|
||||
|
||||
DOMAnimatedString(nsSVGString* aVal, nsSVGElement *aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
|
|
@ -52,10 +52,20 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Switch)
|
|||
//----------------------------------------------------------------------
|
||||
// nsISupports methods
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGSwitchElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsSVGSwitchElement,
|
||||
nsSVGSwitchElementBase)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mActiveChild)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsSVGSwitchElement,
|
||||
nsSVGSwitchElementBase)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mActiveChild)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsSVGSwitchElement,nsSVGSwitchElementBase)
|
||||
NS_IMPL_RELEASE_INHERITED(nsSVGSwitchElement,nsSVGSwitchElementBase)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(nsSVGSwitchElement)
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsSVGSwitchElement)
|
||||
NS_NODE_INTERFACE_TABLE4(nsSVGSwitchElement, nsIDOMNode, nsIDOMElement,
|
||||
nsIDOMSVGElement, nsIDOMSVGSwitchElement)
|
||||
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGSwitchElement)
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
// interfaces:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSVGSwitchElement,
|
||||
nsSVGSwitchElementBase)
|
||||
NS_DECL_NSIDOMSVGSWITCHELEMENT
|
||||
|
||||
// xxx I wish we could use virtual inheritance
|
||||
|
|
|
@ -57,6 +57,7 @@ _TEST_FILES = \
|
|||
scientific-helper.svg \
|
||||
test_text.html \
|
||||
text-helper.svg \
|
||||
test_valueLeaks.xhtml \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=467671
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 467671</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=467671">Mozilla Bug 467671</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
/** Test for Bug 467671 **/
|
||||
|
||||
function storeSVGPropertyAsExpando(localName, prop)
|
||||
{
|
||||
var elem = document.createElementNS("http://www.w3.org/2000/svg", localName);
|
||||
|
||||
elem.addEventListener("click", function(){}, false);
|
||||
|
||||
var propVal = elem[prop];
|
||||
Object.prototype.toSource[prop + "_expando"] = propVal;
|
||||
if (propVal instanceof SVGAnimatedAngle || propVal instanceof SVGAnimatedLength) {
|
||||
Object.prototype.toSource[prop + "_baseVal_expando"] = propVal.baseVal;
|
||||
Object.prototype.toSource[prop + "_animVal_expando"] = propVal.animVal;
|
||||
}
|
||||
}
|
||||
|
||||
// angle
|
||||
storeSVGPropertyAsExpando("marker", "orientAngle");
|
||||
|
||||
// boolean
|
||||
storeSVGPropertyAsExpando("feConvolveMatrix", "preserveAlpha");
|
||||
|
||||
// enum
|
||||
storeSVGPropertyAsExpando("feConvolveMatrix", "edgeMode");
|
||||
|
||||
// special marker enum
|
||||
storeSVGPropertyAsExpando("marker", "orientType");
|
||||
|
||||
// integer
|
||||
storeSVGPropertyAsExpando("feConvolveMatrix", "orderX");
|
||||
|
||||
// length
|
||||
storeSVGPropertyAsExpando("feConvolveMatrix", "x");
|
||||
|
||||
// number
|
||||
storeSVGPropertyAsExpando("feConvolveMatrix", "divisor");
|
||||
|
||||
// string
|
||||
storeSVGPropertyAsExpando("feConvolveMatrix", "in1");
|
||||
|
||||
var elem1 = document.createElementNS("http://www.w3.org/2000/svg", "switch");
|
||||
var elem2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
||||
elem1.appendChild(elem2);
|
||||
document.getElementById("content").appendChild(elem1);
|
||||
|
||||
elem2.addEventListener("click", function(){}, false);
|
||||
|
||||
Object.prototype.toSource.expando = elem1;
|
||||
|
||||
ok(true, "SVG shouldn't leak.");
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче