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 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 | 23 |
24 #include "core/svg/SVGImageElement.h" | 24 #include "core/svg/SVGImageElement.h" |
25 | 25 |
26 #include "core/CSSPropertyNames.h" | 26 #include "core/CSSPropertyNames.h" |
27 #include "core/XLinkNames.h" | 27 #include "core/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" | |
31 | 30 |
32 namespace blink { | 31 namespace blink { |
33 | 32 |
34 inline SVGImageElement::SVGImageElement(Document& document) | 33 inline SVGImageElement::SVGImageElement(Document& document) |
35 : SVGGraphicsElement(SVGNames::imageTag, document) | 34 : SVGGraphicsElement(SVGNames::imageTag, document) |
36 , SVGURIReference(this) | 35 , SVGURIReference(this) |
37 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 36 , 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)) | 37 , 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)) | 38 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
40 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 39 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 m_needsLoaderURIUpdate = true; | 128 m_needsLoaderURIUpdate = true; |
130 return; | 129 return; |
131 } | 130 } |
132 | 131 |
133 RenderObject* renderer = this->renderer(); | 132 RenderObject* renderer = this->renderer(); |
134 if (!renderer) | 133 if (!renderer) |
135 return; | 134 return; |
136 | 135 |
137 if (isLengthAttribute) { | 136 if (isLengthAttribute) { |
138 if (toRenderSVGImage(renderer)->updateImageViewport()) | 137 if (toRenderSVGImage(renderer)->updateImageViewport()) |
139 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er); | 138 markForLayoutAndParentResourceInvalidation(renderer); |
140 return; | 139 return; |
141 } | 140 } |
142 | 141 |
143 if (attrName == SVGNames::preserveAspectRatioAttr) { | 142 if (attrName == SVGNames::preserveAspectRatioAttr) { |
144 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); | 143 markForLayoutAndParentResourceInvalidation(renderer); |
145 return; | 144 return; |
146 } | 145 } |
147 | 146 |
148 ASSERT_NOT_REACHED(); | 147 ASSERT_NOT_REACHED(); |
149 } | 148 } |
150 | 149 |
151 bool SVGImageElement::selfHasRelativeLengths() const | 150 bool SVGImageElement::selfHasRelativeLengths() const |
152 { | 151 { |
153 return m_x->currentValue()->isRelative() | 152 return m_x->currentValue()->isRelative() |
154 || m_y->currentValue()->isRelative() | 153 || m_y->currentValue()->isRelative() |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return AtomicString(hrefString()); | 203 return AtomicString(hrefString()); |
205 } | 204 } |
206 | 205 |
207 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) | 206 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) |
208 { | 207 { |
209 imageLoader().elementDidMoveToNewDocument(); | 208 imageLoader().elementDidMoveToNewDocument(); |
210 SVGGraphicsElement::didMoveToNewDocument(oldDocument); | 209 SVGGraphicsElement::didMoveToNewDocument(oldDocument); |
211 } | 210 } |
212 | 211 |
213 } // namespace blink | 212 } // namespace blink |
OLD | NEW |