Bug 1353208 - Add check for attribute namespace ID when we decide if it should animate as a CSS property or not; r=dholbert
This seems like an existing bug. If the content specifies
attributeType="yer:opacity", we should not try to animate it as a CSS property.
This patch adds a namespace check before we try to animate as a CSS property.
MozReview-Commit-ID: 1LpBa23ddqX
--- a/dom/smil/nsSMILCompositor.cpp
+++ b/dom/smil/nsSMILCompositor.cpp
@@ -136,16 +136,20 @@ nsSMILCompositor::CreateSMILAttr()
return mKey.mElement->GetAnimatedAttr(mKey.mAttributeNamespaceID,
mKey.mAttributeName);
}
nsCSSPropertyID
nsSMILCompositor::GetCSSPropertyToAnimate() const
{
+ if (mKey.mAttributeNamespaceID != kNameSpaceID_None) {
+ return eCSSProperty_UNKNOWN;
+ }
+
nsCSSPropertyID propID =
nsCSSProps::LookupProperty(nsDependentAtomString(mKey.mAttributeName),
CSSEnabledState::eForAllContent);
if (!nsSMILCSSProperty::IsPropertyAnimatable(propID)) {
return eCSSProperty_UNKNOWN;
}
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/smil/style/namespaced-property-1.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <rect x="15" y="15" width="200" height="200" fill="blue">
+ <set attributeName="xlink:opacity" to="0.5" begin="0s" fill="freeze"/>
+ </rect>
+</svg>
--- a/layout/reftests/svg/smil/style/reftest.list
+++ b/layout/reftests/svg/smil/style/reftest.list
@@ -150,8 +150,11 @@ fuzzy-if(skiaContent,1,360) == anim-css-
== anim-css-strokewidth-4-from-by-px-px.svg anim-css-strokewidth-4-ref.svg
== anim-css-strokewidth-4-from-by-px-em.svg anim-css-strokewidth-4-ref.svg
== anim-css-strokewidth-4-from-by-em-em.svg anim-css-strokewidth-4-ref.svg
fuzzy-if(skiaContent,1,170) == anim-css-strokewidth-4-from-by-no-no.svg anim-css-strokewidth-4-ref.svg
# check correct handling of "!important" values
== important-set-1.svg anim-standard-ref.svg
== important-set-2.svg anim-standard-ref.svg
+
+# check namespaced attribute
+== namespaced-property-1.svg anim-standard-ref.svg