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, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "core/rendering/RenderImageResource.h" | 28 #include "core/rendering/RenderImageResource.h" |
29 #include "core/rendering/svg/RenderSVGImage.h" | 29 #include "core/rendering/svg/RenderSVGImage.h" |
30 #include "core/rendering/svg/RenderSVGResource.h" | 30 #include "core/rendering/svg/RenderSVGResource.h" |
31 #include "core/svg/SVGElementInstance.h" | 31 #include "core/svg/SVGElementInstance.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 inline SVGImageElement::SVGImageElement(Document& document) | 35 inline SVGImageElement::SVGImageElement(Document& document) |
36 : SVGGraphicsElement(SVGNames::imageTag, document) | 36 : SVGGraphicsElement(SVGNames::imageTag, document) |
37 , SVGURIReference(this) | 37 , SVGURIReference(this) |
38 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth))) | 38 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
39 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight))) | 39 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
40 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth))) | 40 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
41 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight))) | 41 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
42 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGName
s::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) | 42 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGName
s::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) |
43 , m_imageLoader(this) | 43 , m_imageLoader(this) |
44 , m_needsLoaderURIUpdate(true) | 44 , m_needsLoaderURIUpdate(true) |
45 { | 45 { |
46 ScriptWrappable::init(this); | 46 ScriptWrappable::init(this); |
47 | 47 |
48 addToPropertyMap(m_x); | 48 addToPropertyMap(m_x); |
49 addToPropertyMap(m_y); | 49 addToPropertyMap(m_y); |
50 addToPropertyMap(m_width); | 50 addToPropertyMap(m_width); |
51 addToPropertyMap(m_height); | 51 addToPropertyMap(m_height); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value)
; | 100 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value)
; |
101 } | 101 } |
102 | 102 |
103 void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) | 103 void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) |
104 { | 104 { |
105 SVGParsingError parseError = NoError; | 105 SVGParsingError parseError = NoError; |
106 | 106 |
107 if (!isSupportedAttribute(name)) { | 107 if (!isSupportedAttribute(name)) { |
108 SVGGraphicsElement::parseAttribute(name, value); | 108 SVGGraphicsElement::parseAttribute(name, value); |
109 } else if (name == SVGNames::xAttr) { | 109 } else if (name == SVGNames::xAttr) { |
110 m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 110 m_x->setBaseValueAsString(value, parseError); |
111 } else if (name == SVGNames::yAttr) { | 111 } else if (name == SVGNames::yAttr) { |
112 m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 112 m_y->setBaseValueAsString(value, parseError); |
113 } else if (name == SVGNames::widthAttr) { | 113 } else if (name == SVGNames::widthAttr) { |
114 m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); | 114 m_width->setBaseValueAsString(value, parseError); |
115 } else if (name == SVGNames::heightAttr) { | 115 } else if (name == SVGNames::heightAttr) { |
116 m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError)
; | 116 m_height->setBaseValueAsString(value, parseError); |
117 } else if (name == SVGNames::preserveAspectRatioAttr) { | 117 } else if (name == SVGNames::preserveAspectRatioAttr) { |
118 m_preserveAspectRatio->setBaseValueAsString(value, parseError); | 118 m_preserveAspectRatio->setBaseValueAsString(value, parseError); |
119 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { | 119 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { |
120 } else { | 120 } else { |
121 ASSERT_NOT_REACHED(); | 121 ASSERT_NOT_REACHED(); |
122 } | 122 } |
123 | 123 |
124 reportAttributeParsingError(parseError, name, value); | 124 reportAttributeParsingError(parseError, name, value); |
125 } | 125 } |
126 | 126 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return AtomicString(hrefString()); | 223 return AtomicString(hrefString()); |
224 } | 224 } |
225 | 225 |
226 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) | 226 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) |
227 { | 227 { |
228 m_imageLoader.elementDidMoveToNewDocument(); | 228 m_imageLoader.elementDidMoveToNewDocument(); |
229 SVGGraphicsElement::didMoveToNewDocument(oldDocument); | 229 SVGGraphicsElement::didMoveToNewDocument(oldDocument); |
230 } | 230 } |
231 | 231 |
232 } | 232 } |
OLD | NEW |