summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGRadialGradientElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebCore/svg/SVGRadialGradientElement.cpp
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
downloadqtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebCore/svg/SVGRadialGradientElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGRadialGradientElement.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/WebCore/svg/SVGRadialGradientElement.cpp b/Source/WebCore/svg/SVGRadialGradientElement.cpp
index dcc4007b7..682eb8876 100644
--- a/Source/WebCore/svg/SVGRadialGradientElement.cpp
+++ b/Source/WebCore/svg/SVGRadialGradientElement.cpp
@@ -46,6 +46,7 @@ DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::cyAttr, Cy, cy)
DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::rAttr, R, r)
DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::fxAttr, Fx, fx)
DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::fyAttr, Fy, fy)
+DEFINE_ANIMATED_LENGTH(SVGRadialGradientElement, SVGNames::frAttr, Fr, fr)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRadialGradientElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
@@ -53,6 +54,7 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGRadialGradientElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(r)
REGISTER_LOCAL_ANIMATED_PROPERTY(fx)
REGISTER_LOCAL_ANIMATED_PROPERTY(fy)
+ REGISTER_LOCAL_ANIMATED_PROPERTY(fr)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGradientElement)
END_REGISTER_ANIMATED_PROPERTIES
@@ -63,8 +65,9 @@ inline SVGRadialGradientElement::SVGRadialGradientElement(const QualifiedName& t
, m_r(LengthModeOther, "50%")
, m_fx(LengthModeWidth)
, m_fy(LengthModeHeight)
+ , m_fr(LengthModeOther, "0%")
{
- // Spec: If the cx/cy/r attribute is not specified, the effect is as if a value of "50%" were specified.
+ // Spec: If the cx/cy/r/fr attribute is not specified, the effect is as if a value of "50%" were specified.
ASSERT(hasTagName(SVGNames::radialGradientTag));
registerAnimatedPropertiesForSVGRadialGradientElement();
}
@@ -83,6 +86,7 @@ bool SVGRadialGradientElement::isSupportedAttribute(const QualifiedName& attrNam
supportedAttributes.add(SVGNames::fxAttr);
supportedAttributes.add(SVGNames::fyAttr);
supportedAttributes.add(SVGNames::rAttr);
+ supportedAttributes.add(SVGNames::frAttr);
}
return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
}
@@ -103,6 +107,8 @@ void SVGRadialGradientElement::parseAttribute(const Attribute& attribute)
setFxBaseValue(SVGLength::construct(LengthModeWidth, attribute.value(), parseError));
else if (attribute.name() == SVGNames::fyAttr)
setFyBaseValue(SVGLength::construct(LengthModeHeight, attribute.value(), parseError));
+ else if (attribute.name() == SVGNames::frAttr)
+ setFrBaseValue(SVGLength::construct(LengthModeOther, attribute.value(), parseError, ForbidNegativeLengths));
else
ASSERT_NOT_REACHED();
@@ -175,6 +181,9 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
if (!attributes.hasFy() && current->hasAttribute(SVGNames::fyAttr))
attributes.setFy(radial->fy());
+
+ if (!attributes.hasFr() && current->hasAttribute(SVGNames::frAttr))
+ attributes.setFr(radial->fr());
}
processedGradients.add(current);
@@ -201,7 +210,6 @@ bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttribute
if (!attributes.hasFy())
attributes.setFy(attributes.cy());
-
return true;
}
@@ -211,7 +219,8 @@ bool SVGRadialGradientElement::selfHasRelativeLengths() const
|| cy().isRelative()
|| r().isRelative()
|| fx().isRelative()
- || fy().isRelative();
+ || fy().isRelative()
+ || fr().isRelative();
}
}