Bug 615658 - SMIL animation of some filter attributes don't invalidate correctly. r=jwatt, a=roc.

--HG--
extra : rebase_source : 85b4bbde3697272e5f4f3352b993f46a49a845d6
This commit is contained in:
Robert Longson 2010-12-05 11:37:45 +00:00
Родитель 0d3fdc5034
Коммит e83166f6ce
3 изменённых файлов: 43 добавлений и 27 удалений

Просмотреть файл

@ -80,6 +80,7 @@
#define NUM_ENTRIES_IN_4x5_MATRIX 20
using namespace mozilla;
using namespace mozilla::dom;
static void
CopyDataRect(PRUint8 *aDest, const PRUint8 *aSrc, PRUint32 aStride,
@ -306,7 +307,7 @@ nsSVGFE::GetLengthInfo()
NS_ARRAY_LENGTH(sLengthInfo));
}
inline static void DidAnimateAttr(nsSVGFE *aFilterPrimitive)
inline static void DidAnimateAttr(Element *aFilterPrimitive)
{
// nsSVGLeafFrame doesn't implement AttributeChanged.
nsIFrame* frame = aFilterPrimitive->GetPrimaryFrame();
@ -1779,10 +1780,23 @@ public:
protected:
virtual NumberAttributesInfo GetNumberInfo();
virtual void DidAnimateNumber(PRUint8 aAttrEnum) {
// No frame, use parent's
NS_ASSERTION(!GetPrimaryFrame(), "Not expecting a frame");
DidAnimateAttr(nsSVGUtils::GetParentElement(this));
}
virtual EnumAttributesInfo GetEnumInfo();
virtual void DidAnimateEnum(PRUint8 aAttrEnum) {
// No frame, use parent's
NS_ASSERTION(!GetPrimaryFrame(), "Not expecting a frame");
DidAnimateAttr(nsSVGUtils::GetParentElement(this));
}
virtual NumberListAttributesInfo GetNumberListInfo();
virtual void DidAnimateNumberList(PRUint8 aAttrEnum);
virtual void DidAnimateNumberList(PRUint8 aAttrEnum) {
// No frame, use parent's
NS_ASSERTION(!GetPrimaryFrame(), "Not expecting a frame");
DidAnimateAttr(nsSVGUtils::GetParentElement(this));
}
// nsIDOMSVGComponentTransferFunctionElement properties:
enum { TABLEVALUES };
@ -2053,22 +2067,6 @@ nsSVGComponentTransferFunctionElement::GetNumberInfo()
NS_ARRAY_LENGTH(sNumberInfo));
}
void
nsSVGComponentTransferFunctionElement::DidAnimateNumberList(PRUint8 aAttrEnum)
{
// We don't have a frame, so use our parent's
nsCOMPtr<nsIDOMSVGFEComponentTransferElement> compTrans =
do_QueryInterface(GetParent());
if (compTrans) {
// nsSVGLeafFrame doesn't implement AttributeChanged.
nsIFrame* frame = static_cast<nsSVGFE*>(GetParent())->GetPrimaryFrame();
if (frame) {
nsSVGEffects::InvalidateRenderingObservers(frame);
}
}
}
class nsSVGFEFuncRElement : public nsSVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncRElement
{
@ -4335,6 +4333,11 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
protected:
virtual NumberAttributesInfo GetNumberInfo();
virtual void DidAnimateNumber(PRUint8 aAttrEnum) {
// No frame, use parent's
NS_ASSERTION(!GetPrimaryFrame(), "Not expecting a frame");
DidAnimateAttr(nsSVGUtils::GetParentElement(this));
}
enum { AZIMUTH, ELEVATION };
nsSVGNumber2 mNumberAttributes[2];
@ -4423,6 +4426,11 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
protected:
virtual NumberAttributesInfo GetNumberInfo();
virtual void DidAnimateNumber(PRUint8 aAttrEnum) {
// No frame, use parent's
NS_ASSERTION(!GetPrimaryFrame(), "Not expecting a frame");
DidAnimateAttr(nsSVGUtils::GetParentElement(this));
}
enum { X, Y, Z };
nsSVGNumber2 mNumberAttributes[3];
@ -4516,6 +4524,11 @@ public:
virtual nsXPCClassInfo* GetClassInfo();
protected:
virtual NumberAttributesInfo GetNumberInfo();
virtual void DidAnimateNumber(PRUint8 aAttrEnum) {
// No frame, use parent's
NS_ASSERTION(!GetPrimaryFrame(), "Not expecting a frame");
DidAnimateAttr(nsSVGUtils::GetParentElement(this));
}
enum { X, Y, Z, POINTS_AT_X, POINTS_AT_Y, POINTS_AT_Z,
SPECULAR_EXPONENT, LIMITING_CONE_ANGLE };

Просмотреть файл

@ -4779,7 +4779,11 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
}
if ((aTag != nsGkAtoms::svg && !parentIsSVG) ||
(aTag == nsGkAtoms::desc || aTag == nsGkAtoms::title)) {
(aTag == nsGkAtoms::desc || aTag == nsGkAtoms::title ||
aTag == nsGkAtoms::feFuncR || aTag == nsGkAtoms::feFuncG ||
aTag == nsGkAtoms::feFuncB || aTag == nsGkAtoms::feFuncA ||
aTag == nsGkAtoms::feDistantLight || aTag == nsGkAtoms::fePointLight ||
aTag == nsGkAtoms::feSpotLight)) {
// Sections 5.1 and G.4 of SVG 1.1 say that SVG elements other than
// svg:svg not contained within svg:svg are incorrect, although they
// don't seem to specify error handling. Ignore them, since many of
@ -4791,6 +4795,9 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
// adding to the undisplayed content map.
//
// We don't currently handle any UI for desc/title
//
// The filter types are children of filter elements that use their
// parent frames when necessary
return &sSuppressData;
}
@ -4880,15 +4887,8 @@ nsCSSFrameConstructor::FindSVGData(nsIContent* aContent,
SIMPLE_SVG_CREATE(filter, NS_NewSVGFilterFrame),
SIMPLE_SVG_CREATE(pattern, NS_NewSVGPatternFrame),
SIMPLE_SVG_CREATE(mask, NS_NewSVGMaskFrame),
SIMPLE_SVG_CREATE(feDistantLight, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(fePointLight, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feSpotLight, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feBlend, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feColorMatrix, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feFuncR, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feFuncG, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feFuncB, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feFuncA, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feComposite, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feComponentTransfer, NS_NewSVGLeafFrame),
SIMPLE_SVG_CREATE(feConvolveMatrix, NS_NewSVGLeafFrame),

Просмотреть файл

@ -83,7 +83,10 @@ fails == anim-fillcolor-1.svg anim-standard-ref.svg # bug 436296
== anim-filter-size-01.svg lime.svg
# animate some <number> attributes:
== anim-feComponentTransfer-01.svg lime.svg
== anim-feDistantLight-01.svg anim-feDistantLight-01-ref.svg
== anim-feOffset-01.svg lime.svg
== anim-feSpotLight-01.svg anim-feSpotLight-01-ref.svg
== anim-offset-01.svg lime.svg
== anim-pathLength-01.svg anim-pathLength-01-ref.svg