| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "config.h" | 21 #include "config.h" |
| 22 | 22 |
| 23 #include "core/svg/SVGRectElement.h" | 23 #include "core/svg/SVGRectElement.h" |
| 24 | 24 |
| 25 #include "core/rendering/svg/RenderSVGRect.h" | 25 #include "core/rendering/svg/RenderSVGRect.h" |
| 26 #include "core/rendering/svg/RenderSVGResource.h" | 26 #include "core/rendering/svg/RenderSVGResource.h" |
| 27 #include "core/svg/SVGLength.h" | 27 #include "core/svg/SVGLength.h" |
| 28 | 28 |
| 29 namespace WebCore { | 29 namespace WebCore { |
| 30 | 30 |
| 31 SVGRectElement::SVGRectElement(Document& document) | 31 inline SVGRectElement::SVGRectElement(Document& document) |
| 32 : SVGGeometryElement(SVGNames::rectTag, document) | 32 : SVGGeometryElement(SVGNames::rectTag, document) |
| 33 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 33 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
| 34 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) | 34 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
| 35 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) | 35 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
| 36 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 36 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
| 37 , m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(L
engthModeWidth), ForbidNegativeLengths)) | 37 , m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(L
engthModeWidth), ForbidNegativeLengths)) |
| 38 , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(L
engthModeHeight), ForbidNegativeLengths)) | 38 , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(L
engthModeHeight), ForbidNegativeLengths)) |
| 39 { | 39 { |
| 40 ScriptWrappable::init(this); | 40 ScriptWrappable::init(this); |
| 41 | 41 |
| 42 addToPropertyMap(m_x); | 42 addToPropertyMap(m_x); |
| 43 addToPropertyMap(m_y); | 43 addToPropertyMap(m_y); |
| 44 addToPropertyMap(m_width); | 44 addToPropertyMap(m_width); |
| 45 addToPropertyMap(m_height); | 45 addToPropertyMap(m_height); |
| 46 addToPropertyMap(m_rx); | 46 addToPropertyMap(m_rx); |
| 47 addToPropertyMap(m_ry); | 47 addToPropertyMap(m_ry); |
| 48 } | 48 } |
| 49 | 49 |
| 50 DEFINE_NODE_FACTORY(SVGRectElement) |
| 51 |
| 50 bool SVGRectElement::isSupportedAttribute(const QualifiedName& attrName) | 52 bool SVGRectElement::isSupportedAttribute(const QualifiedName& attrName) |
| 51 { | 53 { |
| 52 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 54 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 53 if (supportedAttributes.isEmpty()) { | 55 if (supportedAttributes.isEmpty()) { |
| 54 supportedAttributes.add(SVGNames::xAttr); | 56 supportedAttributes.add(SVGNames::xAttr); |
| 55 supportedAttributes.add(SVGNames::yAttr); | 57 supportedAttributes.add(SVGNames::yAttr); |
| 56 supportedAttributes.add(SVGNames::widthAttr); | 58 supportedAttributes.add(SVGNames::widthAttr); |
| 57 supportedAttributes.add(SVGNames::heightAttr); | 59 supportedAttributes.add(SVGNames::heightAttr); |
| 58 supportedAttributes.add(SVGNames::rxAttr); | 60 supportedAttributes.add(SVGNames::rxAttr); |
| 59 supportedAttributes.add(SVGNames::ryAttr); | 61 supportedAttributes.add(SVGNames::ryAttr); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 || m_rx->currentValue()->isRelative() | 128 || m_rx->currentValue()->isRelative() |
| 127 || m_ry->currentValue()->isRelative(); | 129 || m_ry->currentValue()->isRelative(); |
| 128 } | 130 } |
| 129 | 131 |
| 130 RenderObject* SVGRectElement::createRenderer(RenderStyle*) | 132 RenderObject* SVGRectElement::createRenderer(RenderStyle*) |
| 131 { | 133 { |
| 132 return new RenderSVGRect(this); | 134 return new RenderSVGRect(this); |
| 133 } | 135 } |
| 134 | 136 |
| 135 } | 137 } |
| OLD | NEW |