summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGRadialGradientElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
commit5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch)
tree8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebCore/svg/SVGRadialGradientElement.cpp
parent33b26980cb24288b5a9f2590ccf32a949281bb79 (diff)
downloadqtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
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();
}
}