Commit df86b335 authored by kouhei@chromium.org's avatar kouhei@chromium.org

Remove 3-args |SVGAnimatedLength::baseValueToString()| impl.

This CL is to prepare for auto-dispatching baseValueToString in SVG*Element::parseAttribute.
SVGAnimatedLength required {Forbid,Allow}NegativeValues setting to be passed in as an argument of baseValueToString.
This was making auto-dispatch for baseValueToString calls difficult.

This CL removes the SVGLengthNegativeValuesMode argument from |SVGAnimatedLength::baseValueToString()|. The setting is passed in by |SVGAnimatedLength| ctor.

BUG=349370

Review URL: https://codereview.chromium.org/206133005

git-svn-id: svn://svn.chromium.org/blink/trunk@169648 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 577ff466
...@@ -39,7 +39,7 @@ void SVGAnimatedLength::setDefaultValueAsString(const String& value) ...@@ -39,7 +39,7 @@ void SVGAnimatedLength::setDefaultValueAsString(const String& value)
baseValue()->setValueAsString(value, ASSERT_NO_EXCEPTION); baseValue()->setValueAsString(value, ASSERT_NO_EXCEPTION);
} }
void SVGAnimatedLength::setBaseValueAsString(const String& value, SVGLengthNegativeValuesMode mode, SVGParsingError& parseError) void SVGAnimatedLength::setBaseValueAsString(const String& value, SVGParsingError& parseError)
{ {
TrackExceptionState es; TrackExceptionState es;
...@@ -48,7 +48,7 @@ void SVGAnimatedLength::setBaseValueAsString(const String& value, SVGLengthNegat ...@@ -48,7 +48,7 @@ void SVGAnimatedLength::setBaseValueAsString(const String& value, SVGLengthNegat
if (es.hadException()) { if (es.hadException()) {
parseError = ParsingAttributeFailedError; parseError = ParsingAttributeFailedError;
baseValue()->newValueSpecifiedUnits(LengthTypeNumber, 0); baseValue()->newValueSpecifiedUnits(LengthTypeNumber, 0);
} else if (mode == ForbidNegativeLengths && baseValue()->valueInSpecifiedUnits() < 0) { } else if (m_negativeValuesMode == ForbidNegativeLengths && baseValue()->valueInSpecifiedUnits() < 0) {
parseError = NegativeValueForbiddenError; parseError = NegativeValueForbiddenError;
} }
} }
......
...@@ -38,19 +38,23 @@ namespace WebCore { ...@@ -38,19 +38,23 @@ namespace WebCore {
class SVGAnimatedLength : public NewSVGAnimatedProperty<SVGLength> { class SVGAnimatedLength : public NewSVGAnimatedProperty<SVGLength> {
public: public:
static PassRefPtr<SVGAnimatedLength> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtr<SVGLength> initialValue) static PassRefPtr<SVGAnimatedLength> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtr<SVGLength> initialValue, SVGLengthNegativeValuesMode negativeValuesMode)
{ {
return adoptRef(new SVGAnimatedLength(contextElement, attributeName, initialValue)); return adoptRef(new SVGAnimatedLength(contextElement, attributeName, initialValue, negativeValuesMode));
} }
void setDefaultValueAsString(const String&); void setDefaultValueAsString(const String&);
void setBaseValueAsString(const String&, SVGLengthNegativeValuesMode, SVGParsingError&); void setBaseValueAsString(const String&, SVGParsingError&);
protected: protected:
SVGAnimatedLength(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtr<SVGLength> initialValue) SVGAnimatedLength(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtr<SVGLength> initialValue, SVGLengthNegativeValuesMode negativeValuesMode)
: NewSVGAnimatedProperty<SVGLength>(contextElement, attributeName, initialValue) : NewSVGAnimatedProperty<SVGLength>(contextElement, attributeName, initialValue)
, m_negativeValuesMode(negativeValuesMode)
{ {
} }
private:
SVGLengthNegativeValuesMode m_negativeValuesMode;
}; };
} // namespace WebCore } // namespace WebCore
......
...@@ -31,9 +31,9 @@ namespace WebCore { ...@@ -31,9 +31,9 @@ namespace WebCore {
inline SVGCircleElement::SVGCircleElement(Document& document) inline SVGCircleElement::SVGCircleElement(Document& document)
: SVGGeometryElement(SVGNames::circleTag, document) : SVGGeometryElement(SVGNames::circleTag, document)
, m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth))) , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight))) , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(LengthModeOther))) , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(LengthModeOther), ForbidNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -65,11 +65,11 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr ...@@ -65,11 +65,11 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGeometryElement::parseAttribute(name, value); SVGGeometryElement::parseAttribute(name, value);
else if (name == SVGNames::cxAttr) else if (name == SVGNames::cxAttr)
m_cx->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_cx->setBaseValueAsString(value, parseError);
else if (name == SVGNames::cyAttr) else if (name == SVGNames::cyAttr)
m_cy->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_cy->setBaseValueAsString(value, parseError);
else if (name == SVGNames::rAttr) else if (name == SVGNames::rAttr)
m_r->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_r->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -33,8 +33,8 @@ inline SVGCursorElement::SVGCursorElement(Document& document) ...@@ -33,8 +33,8 @@ inline SVGCursorElement::SVGCursorElement(Document& document)
: SVGElement(SVGNames::cursorTag, document) : SVGElement(SVGNames::cursorTag, document)
, SVGTests(this) , SVGTests(this)
, SVGURIReference(this) , SVGURIReference(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -73,9 +73,9 @@ void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr ...@@ -73,9 +73,9 @@ void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr
if (!isSupportedAttribute(name)) { if (!isSupportedAttribute(name)) {
SVGElement::parseAttribute(name, value); SVGElement::parseAttribute(name, value);
} else if (name == SVGNames::xAttr) { } else if (name == SVGNames::xAttr) {
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::yAttr) { } else if (name == SVGNames::yAttr) {
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
} else if (SVGURIReference::parseAttribute(name, value, parseError)) { } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
} else if (SVGTests::parseAttribute(name, value)) { } else if (SVGTests::parseAttribute(name, value)) {
} else { } else {
......
...@@ -31,10 +31,10 @@ namespace WebCore { ...@@ -31,10 +31,10 @@ namespace WebCore {
inline SVGEllipseElement::SVGEllipseElement(Document& document) inline SVGEllipseElement::SVGEllipseElement(Document& document)
: SVGGeometryElement(SVGNames::ellipseTag, document) : SVGGeometryElement(SVGNames::ellipseTag, document)
, m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth))) , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight))) , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(LengthModeWidth))) , m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(LengthModeHeight))) , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -68,13 +68,13 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt ...@@ -68,13 +68,13 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGeometryElement::parseAttribute(name, value); SVGGeometryElement::parseAttribute(name, value);
else if (name == SVGNames::cxAttr) else if (name == SVGNames::cxAttr)
m_cx->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_cx->setBaseValueAsString(value, parseError);
else if (name == SVGNames::cyAttr) else if (name == SVGNames::cyAttr)
m_cy->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_cy->setBaseValueAsString(value, parseError);
else if (name == SVGNames::rxAttr) else if (name == SVGNames::rxAttr)
m_rx->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_rx->setBaseValueAsString(value, parseError);
else if (name == SVGNames::ryAttr) else if (name == SVGNames::ryAttr)
m_ry->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_ry->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -35,10 +35,10 @@ namespace WebCore { ...@@ -35,10 +35,10 @@ namespace WebCore {
inline SVGFilterElement::SVGFilterElement(Document& document) inline SVGFilterElement::SVGFilterElement(Document& document)
: SVGElement(SVGNames::filterTag, document) : SVGElement(SVGNames::filterTag, document)
, SVGURIReference(this) , SVGURIReference(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_filterUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::filterUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) , m_filterUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::filterUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX))
, m_primitiveUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::primitiveUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)) , m_primitiveUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::primitiveUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE))
, m_filterRes(SVGAnimatedIntegerOptionalInteger::create(this, SVGNames::filterResAttr)) , m_filterRes(SVGAnimatedIntegerOptionalInteger::create(this, SVGNames::filterResAttr))
...@@ -102,13 +102,13 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicStr ...@@ -102,13 +102,13 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicStr
else if (name == SVGNames::primitiveUnitsAttr) else if (name == SVGNames::primitiveUnitsAttr)
m_primitiveUnits->setBaseValueAsString(value, parseError); m_primitiveUnits->setBaseValueAsString(value, parseError);
else if (name == SVGNames::xAttr) else if (name == SVGNames::xAttr)
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
else if (name == SVGNames::yAttr) else if (name == SVGNames::yAttr)
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
else if (name == SVGNames::widthAttr) else if (name == SVGNames::widthAttr)
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
else if (name == SVGNames::heightAttr) else if (name == SVGNames::heightAttr)
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
else if (name == SVGNames::filterResAttr) else if (name == SVGNames::filterResAttr)
m_filterRes->setBaseValueAsString(value, parseError); m_filterRes->setBaseValueAsString(value, parseError);
else if (SVGURIReference::parseAttribute(name, value, parseError)) { else if (SVGURIReference::parseAttribute(name, value, parseError)) {
......
...@@ -33,10 +33,10 @@ namespace WebCore { ...@@ -33,10 +33,10 @@ namespace WebCore {
SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document& document) SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document& document)
: SVGElement(tagName, document) : SVGElement(tagName, document)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_result(SVGAnimatedString::create(this, SVGNames::resultAttr, SVGString::create())) , m_result(SVGAnimatedString::create(this, SVGNames::resultAttr, SVGString::create()))
{ {
// Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified. // Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified.
...@@ -74,13 +74,13 @@ void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& n ...@@ -74,13 +74,13 @@ void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& n
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGElement::parseAttribute(name, value); SVGElement::parseAttribute(name, value);
else if (name == SVGNames::xAttr) else if (name == SVGNames::xAttr)
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
else if (name == SVGNames::yAttr) else if (name == SVGNames::yAttr)
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
else if (name == SVGNames::widthAttr) else if (name == SVGNames::widthAttr)
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
else if (name == SVGNames::heightAttr) else if (name == SVGNames::heightAttr)
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
else if (name == SVGNames::resultAttr) else if (name == SVGNames::resultAttr)
m_result->setBaseValueAsString(value, parseError); m_result->setBaseValueAsString(value, parseError);
else else
......
...@@ -32,10 +32,10 @@ namespace WebCore { ...@@ -32,10 +32,10 @@ namespace WebCore {
inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document) inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document)
: SVGGraphicsElement(SVGNames::foreignObjectTag, document) : SVGGraphicsElement(SVGNames::foreignObjectTag, document)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -69,13 +69,13 @@ void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At ...@@ -69,13 +69,13 @@ void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGraphicsElement::parseAttribute(name, value); SVGGraphicsElement::parseAttribute(name, value);
else if (name == SVGNames::xAttr) else if (name == SVGNames::xAttr)
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
else if (name == SVGNames::yAttr) else if (name == SVGNames::yAttr)
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
else if (name == SVGNames::widthAttr) else if (name == SVGNames::widthAttr)
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
else if (name == SVGNames::heightAttr) else if (name == SVGNames::heightAttr)
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -35,10 +35,10 @@ namespace WebCore { ...@@ -35,10 +35,10 @@ namespace WebCore {
inline SVGImageElement::SVGImageElement(Document& document) inline SVGImageElement::SVGImageElement(Document& document)
: SVGGraphicsElement(SVGNames::imageTag, document) : SVGGraphicsElement(SVGNames::imageTag, document)
, SVGURIReference(this) , SVGURIReference(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()))
, m_imageLoader(this) , m_imageLoader(this)
, m_needsLoaderURIUpdate(true) , m_needsLoaderURIUpdate(true)
...@@ -107,13 +107,13 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri ...@@ -107,13 +107,13 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
if (!isSupportedAttribute(name)) { if (!isSupportedAttribute(name)) {
SVGGraphicsElement::parseAttribute(name, value); SVGGraphicsElement::parseAttribute(name, value);
} else if (name == SVGNames::xAttr) { } else if (name == SVGNames::xAttr) {
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::yAttr) { } else if (name == SVGNames::yAttr) {
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::widthAttr) { } else if (name == SVGNames::widthAttr) {
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::heightAttr) { } else if (name == SVGNames::heightAttr) {
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::preserveAspectRatioAttr) { } else if (name == SVGNames::preserveAspectRatioAttr) {
m_preserveAspectRatio->setBaseValueAsString(value, parseError); m_preserveAspectRatio->setBaseValueAsString(value, parseError);
} else if (SVGURIReference::parseAttribute(name, value, parseError)) { } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
......
...@@ -30,10 +30,10 @@ namespace WebCore { ...@@ -30,10 +30,10 @@ namespace WebCore {
inline SVGLineElement::SVGLineElement(Document& document) inline SVGLineElement::SVGLineElement(Document& document)
: SVGGeometryElement(SVGNames::lineTag, document) : SVGGeometryElement(SVGNames::lineTag, document)
, m_x1(SVGAnimatedLength::create(this, SVGNames::x1Attr, SVGLength::create(LengthModeWidth))) , m_x1(SVGAnimatedLength::create(this, SVGNames::x1Attr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y1(SVGAnimatedLength::create(this, SVGNames::y1Attr, SVGLength::create(LengthModeHeight))) , m_y1(SVGAnimatedLength::create(this, SVGNames::y1Attr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(LengthModeWidth))) , m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(LengthModeHeight))) , m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -67,13 +67,13 @@ void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicStrin ...@@ -67,13 +67,13 @@ void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicStrin
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGeometryElement::parseAttribute(name, value); SVGGeometryElement::parseAttribute(name, value);
else if (name == SVGNames::x1Attr) else if (name == SVGNames::x1Attr)
m_x1->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x1->setBaseValueAsString(value, parseError);
else if (name == SVGNames::y1Attr) else if (name == SVGNames::y1Attr)
m_y1->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y1->setBaseValueAsString(value, parseError);
else if (name == SVGNames::x2Attr) else if (name == SVGNames::x2Attr)
m_x2->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x2->setBaseValueAsString(value, parseError);
else if (name == SVGNames::y2Attr) else if (name == SVGNames::y2Attr)
m_y2->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y2->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -35,10 +35,10 @@ namespace WebCore { ...@@ -35,10 +35,10 @@ namespace WebCore {
inline SVGLinearGradientElement::SVGLinearGradientElement(Document& document) inline SVGLinearGradientElement::SVGLinearGradientElement(Document& document)
: SVGGradientElement(SVGNames::linearGradientTag, document) : SVGGradientElement(SVGNames::linearGradientTag, document)
, m_x1(SVGAnimatedLength::create(this, SVGNames::x1Attr, SVGLength::create(LengthModeWidth))) , m_x1(SVGAnimatedLength::create(this, SVGNames::x1Attr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y1(SVGAnimatedLength::create(this, SVGNames::y1Attr, SVGLength::create(LengthModeHeight))) , m_y1(SVGAnimatedLength::create(this, SVGNames::y1Attr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(LengthModeWidth))) , m_x2(SVGAnimatedLength::create(this, SVGNames::x2Attr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(LengthModeHeight))) , m_y2(SVGAnimatedLength::create(this, SVGNames::y2Attr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -75,13 +75,13 @@ void SVGLinearGradientElement::parseAttribute(const QualifiedName& name, const A ...@@ -75,13 +75,13 @@ void SVGLinearGradientElement::parseAttribute(const QualifiedName& name, const A
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGradientElement::parseAttribute(name, value); SVGGradientElement::parseAttribute(name, value);
else if (name == SVGNames::x1Attr) else if (name == SVGNames::x1Attr)
m_x1->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x1->setBaseValueAsString(value, parseError);
else if (name == SVGNames::y1Attr) else if (name == SVGNames::y1Attr)
m_y1->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y1->setBaseValueAsString(value, parseError);
else if (name == SVGNames::x2Attr) else if (name == SVGNames::x2Attr)
m_x2->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x2->setBaseValueAsString(value, parseError);
else if (name == SVGNames::y2Attr) else if (name == SVGNames::y2Attr)
m_y2->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y2->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -45,10 +45,10 @@ template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerUn ...@@ -45,10 +45,10 @@ template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerUn
inline SVGMarkerElement::SVGMarkerElement(Document& document) inline SVGMarkerElement::SVGMarkerElement(Document& document)
: SVGElement(SVGNames::markerTag, document) : SVGElement(SVGNames::markerTag, document)
, SVGFitToViewBox(this) , SVGFitToViewBox(this)
, m_refX(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::create(LengthModeWidth))) , m_refX(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_refY(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::create(LengthModeWidth))) , m_refY(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_markerWidth(SVGAnimatedLength::create(this, SVGNames::markerWidthAttr, SVGLength::create(LengthModeWidth))) , m_markerWidth(SVGAnimatedLength::create(this, SVGNames::markerWidthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_markerHeight(SVGAnimatedLength::create(this, SVGNames::markerHeightAttr, SVGLength::create(LengthModeHeight))) , m_markerHeight(SVGAnimatedLength::create(this, SVGNames::markerHeightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_orientAngle(SVGAnimatedAngle::create(this)) , m_orientAngle(SVGAnimatedAngle::create(this))
, m_markerUnits(SVGAnimatedEnumeration<SVGMarkerUnitsType>::create(this, SVGNames::markerUnitsAttr, SVGMarkerUnitsStrokeWidth)) , m_markerUnits(SVGAnimatedEnumeration<SVGMarkerUnitsType>::create(this, SVGNames::markerUnitsAttr, SVGMarkerUnitsStrokeWidth))
{ {
...@@ -100,13 +100,13 @@ void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr ...@@ -100,13 +100,13 @@ void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr
else if (name == SVGNames::markerUnitsAttr) else if (name == SVGNames::markerUnitsAttr)
m_markerUnits->setBaseValueAsString(value, parseError); m_markerUnits->setBaseValueAsString(value, parseError);
else if (name == SVGNames::refXAttr) else if (name == SVGNames::refXAttr)
m_refX->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_refX->setBaseValueAsString(value, parseError);
else if (name == SVGNames::refYAttr) else if (name == SVGNames::refYAttr)
m_refY->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_refY->setBaseValueAsString(value, parseError);
else if (name == SVGNames::markerWidthAttr) else if (name == SVGNames::markerWidthAttr)
m_markerWidth->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_markerWidth->setBaseValueAsString(value, parseError);
else if (name == SVGNames::markerHeightAttr) else if (name == SVGNames::markerHeightAttr)
m_markerHeight->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_markerHeight->setBaseValueAsString(value, parseError);
else if (name == SVGNames::orientAttr) else if (name == SVGNames::orientAttr)
m_orientAngle->setBaseValueAsString(value, parseError); m_orientAngle->setBaseValueAsString(value, parseError);
else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) { else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) {
......
...@@ -33,10 +33,10 @@ namespace WebCore { ...@@ -33,10 +33,10 @@ namespace WebCore {
inline SVGMaskElement::SVGMaskElement(Document& document) inline SVGMaskElement::SVGMaskElement(Document& document)
: SVGElement(SVGNames::maskTag, document) : SVGElement(SVGNames::maskTag, document)
, SVGTests(this) , SVGTests(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_maskUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::maskUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) , m_maskUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::maskUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX))
, m_maskContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::maskContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)) , m_maskContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::maskContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE))
{ {
...@@ -89,13 +89,13 @@ void SVGMaskElement::parseAttribute(const QualifiedName& name, const AtomicStrin ...@@ -89,13 +89,13 @@ void SVGMaskElement::parseAttribute(const QualifiedName& name, const AtomicStrin
else if (name == SVGNames::maskContentUnitsAttr) else if (name == SVGNames::maskContentUnitsAttr)
m_maskContentUnits->setBaseValueAsString(value, parseError); m_maskContentUnits->setBaseValueAsString(value, parseError);
else if (name == SVGNames::xAttr) else if (name == SVGNames::xAttr)
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
else if (name == SVGNames::yAttr) else if (name == SVGNames::yAttr)
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
else if (name == SVGNames::widthAttr) else if (name == SVGNames::widthAttr)
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
else if (name == SVGNames::heightAttr) else if (name == SVGNames::heightAttr)
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
else if (SVGTests::parseAttribute(name, value)) { else if (SVGTests::parseAttribute(name, value)) {
} else } else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -37,10 +37,10 @@ inline SVGPatternElement::SVGPatternElement(Document& document) ...@@ -37,10 +37,10 @@ inline SVGPatternElement::SVGPatternElement(Document& document)
, SVGURIReference(this) , SVGURIReference(this)
, SVGTests(this) , SVGTests(this)
, SVGFitToViewBox(this) , SVGFitToViewBox(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_patternTransform(SVGAnimatedTransformList::create(this, SVGNames::patternTransformAttr, SVGTransformList::create())) , m_patternTransform(SVGAnimatedTransformList::create(this, SVGNames::patternTransformAttr, SVGTransformList::create()))
, m_patternUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) , m_patternUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX))
, m_patternContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)) , m_patternContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE))
...@@ -92,13 +92,13 @@ void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt ...@@ -92,13 +92,13 @@ void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt
} else if (name == SVGNames::patternTransformAttr) { } else if (name == SVGNames::patternTransformAttr) {
m_patternTransform->setBaseValueAsString(value, parseError); m_patternTransform->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::xAttr) { } else if (name == SVGNames::xAttr) {
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::yAttr) { } else if (name == SVGNames::yAttr) {
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::widthAttr) { } else if (name == SVGNames::widthAttr) {
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::heightAttr) { } else if (name == SVGNames::heightAttr) {
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
} else if (SVGURIReference::parseAttribute(name, value, parseError)) { } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
} else if (SVGTests::parseAttribute(name, value)) { } else if (SVGTests::parseAttribute(name, value)) {
} else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) { } else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) {
......
...@@ -34,12 +34,12 @@ namespace WebCore { ...@@ -34,12 +34,12 @@ namespace WebCore {
inline SVGRadialGradientElement::SVGRadialGradientElement(Document& document) inline SVGRadialGradientElement::SVGRadialGradientElement(Document& document)
: SVGGradientElement(SVGNames::radialGradientTag, document) : SVGGradientElement(SVGNames::radialGradientTag, document)
, m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth))) , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight))) , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(LengthModeOther))) , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(LengthModeOther), ForbidNegativeLengths))
, m_fx(SVGAnimatedLength::create(this, SVGNames::fxAttr, SVGLength::create(LengthModeWidth))) , m_fx(SVGAnimatedLength::create(this, SVGNames::fxAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_fy(SVGAnimatedLength::create(this, SVGNames::fyAttr, SVGLength::create(LengthModeHeight))) , m_fy(SVGAnimatedLength::create(this, SVGNames::fyAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_fr(SVGAnimatedLength::create(this, SVGNames::frAttr, SVGLength::create(LengthModeOther))) , m_fr(SVGAnimatedLength::create(this, SVGNames::frAttr, SVGLength::create(LengthModeOther), ForbidNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -85,17 +85,17 @@ void SVGRadialGradientElement::parseAttribute(const QualifiedName& name, const A ...@@ -85,17 +85,17 @@ void SVGRadialGradientElement::parseAttribute(const QualifiedName& name, const A
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGradientElement::parseAttribute(name, value); SVGGradientElement::parseAttribute(name, value);
else if (name == SVGNames::cxAttr) else if (name == SVGNames::cxAttr)
m_cx->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_cx->setBaseValueAsString(value, parseError);
else if (name == SVGNames::cyAttr) else if (name == SVGNames::cyAttr)
m_cy->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_cy->setBaseValueAsString(value, parseError);
else if (name == SVGNames::rAttr) else if (name == SVGNames::rAttr)
m_r->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_r->setBaseValueAsString(value, parseError);
else if (name == SVGNames::fxAttr) else if (name == SVGNames::fxAttr)
m_fx->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_fx->setBaseValueAsString(value, parseError);
else if (name == SVGNames::fyAttr) else if (name == SVGNames::fyAttr)
m_fy->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_fy->setBaseValueAsString(value, parseError);
else if (name == SVGNames::frAttr) else if (name == SVGNames::frAttr)
m_fr->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_fr->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -31,12 +31,12 @@ namespace WebCore { ...@@ -31,12 +31,12 @@ namespace WebCore {
inline SVGRectElement::SVGRectElement(Document& document) inline SVGRectElement::SVGRectElement(Document& document)
: SVGGeometryElement(SVGNames::rectTag, document) : SVGGeometryElement(SVGNames::rectTag, document)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(LengthModeWidth))) , m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(LengthModeHeight))) , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
{ {
ScriptWrappable::init(this); ScriptWrappable::init(this);
...@@ -74,17 +74,17 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin ...@@ -74,17 +74,17 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGGeometryElement::parseAttribute(name, value); SVGGeometryElement::parseAttribute(name, value);
else if (name == SVGNames::xAttr) else if (name == SVGNames::xAttr)
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
else if (name == SVGNames::yAttr) else if (name == SVGNames::yAttr)
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
else if (name == SVGNames::rxAttr) else if (name == SVGNames::rxAttr)
m_rx->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_rx->setBaseValueAsString(value, parseError);
else if (name == SVGNames::ryAttr) else if (name == SVGNames::ryAttr)
m_ry->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_ry->setBaseValueAsString(value, parseError);
else if (name == SVGNames::widthAttr) else if (name == SVGNames::widthAttr)
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
else if (name == SVGNames::heightAttr) else if (name == SVGNames::heightAttr)
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
else else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -66,10 +66,10 @@ namespace WebCore { ...@@ -66,10 +66,10 @@ namespace WebCore {
inline SVGSVGElement::SVGSVGElement(Document& doc) inline SVGSVGElement::SVGSVGElement(Document& doc)
: SVGGraphicsElement(SVGNames::svgTag, doc) : SVGGraphicsElement(SVGNames::svgTag, doc)
, SVGFitToViewBox(this) , SVGFitToViewBox(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_useCurrentView(false) , m_useCurrentView(false)
, m_timeContainer(SMILTimeContainer::create(*this)) , m_timeContainer(SMILTimeContainer::create(*this))
, m_translation(SVGPoint::create()) , m_translation(SVGPoint::create())
...@@ -267,13 +267,13 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString ...@@ -267,13 +267,13 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString
} else if (name == HTMLNames::onerrorAttr) { } else if (name == HTMLNames::onerrorAttr) {
document().setWindowAttributeEventListener(EventTypeNames::error, createAttributeEventListener(document().frame(), name, value)); document().setWindowAttributeEventListener(EventTypeNames::error, createAttributeEventListener(document().frame(), name, value));
} else if (name == SVGNames::xAttr) { } else if (name == SVGNames::xAttr) {
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::yAttr) { } else if (name == SVGNames::yAttr) {
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::widthAttr) { } else if (name == SVGNames::widthAttr) {
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::heightAttr) { } else if (name == SVGNames::heightAttr) {
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
} else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) { } else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) {
} else if (SVGZoomAndPan::parseAttribute(name, value)) { } else if (SVGZoomAndPan::parseAttribute(name, value)) {
} else { } else {
......
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
private: private:
SVGAnimatedTextLength(SVGTextContentElement* contextElement) SVGAnimatedTextLength(SVGTextContentElement* contextElement)
: SVGAnimatedLength(contextElement, SVGNames::textLengthAttr, SVGLength::create(LengthModeOther)) : SVGAnimatedLength(contextElement, SVGNames::textLengthAttr, SVGLength::create(LengthModeOther), ForbidNegativeLengths)
{ {
} }
}; };
...@@ -238,7 +238,7 @@ void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom ...@@ -238,7 +238,7 @@ void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom
else if (name == SVGNames::lengthAdjustAttr) { else if (name == SVGNames::lengthAdjustAttr) {
m_lengthAdjust->setBaseValueAsString(value, parseError); m_lengthAdjust->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::textLengthAttr) { } else if (name == SVGNames::textLengthAttr) {
m_textLength->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_textLength->setBaseValueAsString(value, parseError);
} else if (name.matches(XMLNames::spaceAttr)) { } else if (name.matches(XMLNames::spaceAttr)) {
} else } else
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -54,7 +54,7 @@ template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath ...@@ -54,7 +54,7 @@ template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
inline SVGTextPathElement::SVGTextPathElement(Document& document) inline SVGTextPathElement::SVGTextPathElement(Document& document)
: SVGTextContentElement(SVGNames::textPathTag, document) : SVGTextContentElement(SVGNames::textPathTag, document)
, SVGURIReference(this) , SVGURIReference(this)
, m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, SVGLength::create(LengthModeOther))) , m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, SVGLength::create(LengthModeOther), AllowNegativeLengths))
, m_method(SVGAnimatedEnumeration<SVGTextPathMethodType>::create(this, SVGNames::methodAttr, SVGTextPathMethodAlign)) , m_method(SVGAnimatedEnumeration<SVGTextPathMethodType>::create(this, SVGNames::methodAttr, SVGTextPathMethodAlign))
, m_spacing(SVGAnimatedEnumeration<SVGTextPathSpacingType>::create(this, SVGNames::spacingAttr, SVGTextPathSpacingExact)) , m_spacing(SVGAnimatedEnumeration<SVGTextPathSpacingType>::create(this, SVGNames::spacingAttr, SVGTextPathSpacingExact))
{ {
...@@ -99,7 +99,7 @@ void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicS ...@@ -99,7 +99,7 @@ void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicS
if (!isSupportedAttribute(name)) if (!isSupportedAttribute(name))
SVGTextContentElement::parseAttribute(name, value); SVGTextContentElement::parseAttribute(name, value);
else if (name == SVGNames::startOffsetAttr) else if (name == SVGNames::startOffsetAttr)
m_startOffset->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_startOffset->setBaseValueAsString(value, parseError);
else if (name == SVGNames::methodAttr) else if (name == SVGNames::methodAttr)
m_method->setBaseValueAsString(value, parseError); m_method->setBaseValueAsString(value, parseError);
else if (name == SVGNames::spacingAttr) else if (name == SVGNames::spacingAttr)
......
...@@ -54,10 +54,10 @@ namespace WebCore { ...@@ -54,10 +54,10 @@ namespace WebCore {
inline SVGUseElement::SVGUseElement(Document& document, bool wasInsertedByParser) inline SVGUseElement::SVGUseElement(Document& document, bool wasInsertedByParser)
: SVGGraphicsElement(SVGNames::useTag, document) : SVGGraphicsElement(SVGNames::useTag, document)
, SVGURIReference(this) , SVGURIReference(this)
, m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth))) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth), AllowNegativeLengths))
, m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight), AllowNegativeLengths))
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth), ForbidNegativeLengths))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight), ForbidNegativeLengths))
, m_wasInsertedByParser(wasInsertedByParser) , m_wasInsertedByParser(wasInsertedByParser)
, m_haveFiredLoadEvent(false) , m_haveFiredLoadEvent(false)
, m_needsShadowTreeRecreation(false) , m_needsShadowTreeRecreation(false)
...@@ -125,13 +125,13 @@ void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString ...@@ -125,13 +125,13 @@ void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString
if (!isSupportedAttribute(name)) { if (!isSupportedAttribute(name)) {
SVGGraphicsElement::parseAttribute(name, value); SVGGraphicsElement::parseAttribute(name, value);
} else if (name == SVGNames::xAttr) { } else if (name == SVGNames::xAttr) {
m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_x->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::yAttr) { } else if (name == SVGNames::yAttr) {
m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); m_y->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::widthAttr) { } else if (name == SVGNames::widthAttr) {
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_width->setBaseValueAsString(value, parseError);
} else if (name == SVGNames::heightAttr) { } else if (name == SVGNames::heightAttr) {
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError); m_height->setBaseValueAsString(value, parseError);
} else if (SVGURIReference::parseAttribute(name, value, parseError)) { } else if (SVGURIReference::parseAttribute(name, value, parseError)) {
} else { } else {
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment