Source/WebCore/svg/SVGCircleElement.cpp

2424#include "SVGCircleElement.h"
2525
2626#include "Attribute.h"
 27#include "ExceptionCode.h"
2728#include "FloatPoint.h"
2829#include "RenderSVGPath.h"
2930#include "RenderSVGResource.h"

@@bool SVGCircleElement::isSupportedAttribute(const QualifiedName& attrName)
6970
7071void SVGCircleElement::parseMappedAttribute(Attribute* attr)
7172{
 73 ExceptionCode ec = 0;
 74
7275 if (!isSupportedAttribute(attr->name())) {
7376 SVGStyledTransformableElement::parseMappedAttribute(attr);
74  return;
75  }
76 
77  if (attr->name() == SVGNames::cxAttr) {
78  setCxBaseValue(SVGLength(LengthModeWidth, attr->value()));
79  return;
80  }
81 
82  if (attr->name() == SVGNames::cyAttr) {
83  setCyBaseValue(SVGLength(LengthModeHeight, attr->value()));
84  return;
85  }
86 
87  if (attr->name() == SVGNames::rAttr) {
88  setRBaseValue(SVGLength(LengthModeOther, attr->value()));
 77 } else if (attr->name() == SVGNames::cxAttr) {
 78 setCxBaseValue(SVGLength::create(LengthModeWidth, attr->value(), ec));
 79 } else if (attr->name() == SVGNames::cyAttr) {
 80 setCyBaseValue(SVGLength::create(LengthModeHeight, attr->value(), ec));
 81 } else if (attr->name() == SVGNames::rAttr) {
 82 setRBaseValue(SVGLength::create(LengthModeOther, attr->value(), ec));
8983 if (rBaseValue().value(this) < 0.0)
9084 document()->accessSVGExtensions()->reportError("A negative value for circle <r> is not allowed");
91  return;
 85 } else if (SVGTests::parseMappedAttribute(attr)
 86 || SVGLangSpace::parseMappedAttribute(attr)
 87 || SVGExternalResourcesRequired::parseMappedAttribute(attr)) {
 88 } else {
 89 ASSERT_NOT_REACHED();
9290 }
9391
94  if (SVGTests::parseMappedAttribute(attr))
95  return;
96  if (SVGLangSpace::parseMappedAttribute(attr))
97  return;
98  if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
99  return;
100 
101  ASSERT_NOT_REACHED();
 92 if (ec) {
 93 document()->accessSVGExtensions()->reportError("Invalid value for circle attribute " +
 94 attr->name().toString() + "=\"" +
 95 attr->value() + "\"");
 96 }
10297}
10398
10499void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)

Source/WebCore/svg/SVGDocumentExtensions.cpp

@@static int parserLineNumber(Document* document)
198198static void reportMessage(Document* document, MessageLevel level, const String& message)
199199{
200200 if (Frame* frame = document->frame())
201  frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, level, message, parserLineNumber(document), String());
 201 frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, level, message,
 202 parserLineNumber(document), document->documentURI());
202203}
203204
204205void SVGDocumentExtensions::reportWarning(const String& message)

Source/WebCore/svg/SVGLength.cpp

@@bool SVGLength::operator!=(const SVGLength& other) const
149149 return !operator==(other);
150150}
151151
 152SVGLength SVGLength::create(SVGLengthMode mode, const String& valueAsString, ExceptionCode& exceptionCode)
 153{
 154 SVGLength length = SVGLength(mode);
 155
 156 length.setValueAsString(valueAsString, exceptionCode);
 157
 158 return length;
 159}
 160
152161SVGLengthType SVGLength::unitType() const
153162{
154163 return extractType(m_unit);

Source/WebCore/svg/SVGLength.h

@@public:
7676 bool operator==(const SVGLength&) const;
7777 bool operator!=(const SVGLength&) const;
7878
 79 static SVGLength create(SVGLengthMode, const String&, ExceptionCode&);
 80
7981 float value(const SVGElement* context) const;
8082 float value(const SVGElement* context, ExceptionCode&) const;
8183 void setValue(float, const SVGElement* context, ExceptionCode&);