void SVGRadialGradientElement::parseMappedAttribute(MappedAttribute* attr) { if (attr->name() == SVGNames::cxAttr) setCxBaseValue(SVGLength(LengthModeWidth, attr->value())); else if (attr->name() == SVGNames::cyAttr) setCyBaseValue(SVGLength(LengthModeHeight, attr->value())); else if (attr->name() == SVGNames::rAttr) { setRBaseValue(SVGLength(LengthModeOther, attr->value())); if (rBaseValue().value(this) < 0.0) document()->accessSVGExtensions()->reportError("A negative value for radial gradient radius <r> is not allowed"); } else if (attr->name() == SVGNames::fxAttr) setFxBaseValue(SVGLength(LengthModeWidth, attr->value())); else if (attr->name() == SVGNames::fyAttr) setFyBaseValue(SVGLength(LengthModeHeight, attr->value())); else SVGGradientElement::parseMappedAttribute(attr); }
void SVGCircleElement::parseMappedAttribute(MappedAttribute* attr) { if (attr->name() == SVGNames::cxAttr) setCxBaseValue(SVGLength(LengthModeWidth, attr->value())); else if (attr->name() == SVGNames::cyAttr) setCyBaseValue(SVGLength(LengthModeHeight, attr->value())); else if (attr->name() == SVGNames::rAttr) { setRBaseValue(SVGLength(LengthModeOther, attr->value())); if (rBaseValue().value(this) < 0.0) document()->accessSVGExtensions()->reportError("A negative value for circle <r> is not allowed"); } else { if (SVGTests::parseMappedAttribute(attr)) return; if (SVGLangSpace::parseMappedAttribute(attr)) return; if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) return; SVGStyledTransformableElement::parseMappedAttribute(attr); } }
void SVGRadialGradientElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { SVGParsingError parseError = NoError; if (name == SVGNames::cxAttr) setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); else if (name == SVGNames::cyAttr) setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)); else if (name == SVGNames::rAttr) setRBaseValue(SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::fxAttr) setFxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); else if (name == SVGNames::fyAttr) setFyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)); else if (name == SVGNames::frAttr) setFrBaseValue(SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); reportAttributeParsingError(parseError, name, value); SVGGradientElement::parseAttribute(name, value); }
void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { SVGParsingError parseError = NoError; if (!isSupportedAttribute(name)) SVGGraphicsElement::parseAttribute(name, value); else if (name == SVGNames::cxAttr) setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); else if (name == SVGNames::cyAttr) setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)); else if (name == SVGNames::rxAttr) setRxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); else if (name == SVGNames::ryAttr) setRyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); else if (SVGLangSpace::parseAttribute(name, value) || SVGExternalResourcesRequired::parseAttribute(name, value)) { } else ASSERT_NOT_REACHED(); reportAttributeParsingError(parseError, name, value); }