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 13 matching lines...) Expand all Loading... |
24 #include "core/svg/SVGImageElement.h" | 24 #include "core/svg/SVGImageElement.h" |
25 | 25 |
26 #include "CSSPropertyNames.h" | 26 #include "CSSPropertyNames.h" |
27 #include "XLinkNames.h" | 27 #include "XLinkNames.h" |
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 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
34 SVGImageElement::SVGImageElement(Document& document) | 34 inline SVGImageElement::SVGImageElement(Document& document) |
35 : SVGGraphicsElement(SVGNames::imageTag, document) | 35 : SVGGraphicsElement(SVGNames::imageTag, document) |
36 , SVGURIReference(this) | 36 , SVGURIReference(this) |
37 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 37 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
38 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) | 38 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
39 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) | 39 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
40 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 40 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
41 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGName
s::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) | 41 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGName
s::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())) |
42 , m_imageLoader(this) | 42 , m_imageLoader(this) |
43 , m_needsLoaderURIUpdate(true) | 43 , m_needsLoaderURIUpdate(true) |
44 { | 44 { |
45 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
46 | 46 |
47 addToPropertyMap(m_x); | 47 addToPropertyMap(m_x); |
48 addToPropertyMap(m_y); | 48 addToPropertyMap(m_y); |
49 addToPropertyMap(m_width); | 49 addToPropertyMap(m_width); |
50 addToPropertyMap(m_height); | 50 addToPropertyMap(m_height); |
51 addToPropertyMap(m_preserveAspectRatio); | 51 addToPropertyMap(m_preserveAspectRatio); |
52 } | 52 } |
53 | 53 |
| 54 DEFINE_NODE_FACTORY(SVGImageElement) |
| 55 |
54 bool SVGImageElement::currentFrameHasSingleSecurityOrigin() const | 56 bool SVGImageElement::currentFrameHasSingleSecurityOrigin() const |
55 { | 57 { |
56 if (RenderSVGImage* renderSVGImage = toRenderSVGImage(renderer())) { | 58 if (RenderSVGImage* renderSVGImage = toRenderSVGImage(renderer())) { |
57 if (renderSVGImage->imageResource()->hasImage()) { | 59 if (renderSVGImage->imageResource()->hasImage()) { |
58 if (Image* image = renderSVGImage->imageResource()->cachedImage()->i
mage()) | 60 if (Image* image = renderSVGImage->imageResource()->cachedImage()->i
mage()) |
59 return image->currentFrameHasSingleSecurityOrigin(); | 61 return image->currentFrameHasSingleSecurityOrigin(); |
60 } | 62 } |
61 } | 63 } |
62 | 64 |
63 return true; | 65 return true; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 return AtomicString(hrefString()); | 219 return AtomicString(hrefString()); |
218 } | 220 } |
219 | 221 |
220 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) | 222 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) |
221 { | 223 { |
222 m_imageLoader.elementDidMoveToNewDocument(); | 224 m_imageLoader.elementDidMoveToNewDocument(); |
223 SVGGraphicsElement::didMoveToNewDocument(oldDocument); | 225 SVGGraphicsElement::didMoveToNewDocument(oldDocument); |
224 } | 226 } |
225 | 227 |
226 } | 228 } |
OLD | NEW |