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, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #include "config.h" | 21 #include "config.h" |
22 | |
23 #include "core/svg/SVGRectElement.h" | 22 #include "core/svg/SVGRectElement.h" |
24 | 23 |
25 #include "core/rendering/svg/RenderSVGRect.h" | 24 #include "core/rendering/svg/RenderSVGRect.h" |
26 #include "core/rendering/svg/RenderSVGResource.h" | |
27 #include "core/svg/SVGLength.h" | 25 #include "core/svg/SVGLength.h" |
28 | 26 |
29 namespace blink { | 27 namespace blink { |
30 | 28 |
31 inline SVGRectElement::SVGRectElement(Document& document) | 29 inline SVGRectElement::SVGRectElement(Document& document) |
32 : SVGGeometryElement(SVGNames::rectTag, document) | 30 : SVGGeometryElement(SVGNames::rectTag, document) |
33 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 31 , 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)) | 32 , 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)) | 33 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
36 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 34 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 82 |
85 if (isLengthAttribute) | 83 if (isLengthAttribute) |
86 updateRelativeLengthsInformation(); | 84 updateRelativeLengthsInformation(); |
87 | 85 |
88 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); | 86 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); |
89 if (!renderer) | 87 if (!renderer) |
90 return; | 88 return; |
91 | 89 |
92 if (isLengthAttribute) { | 90 if (isLengthAttribute) { |
93 renderer->setNeedsShapeUpdate(); | 91 renderer->setNeedsShapeUpdate(); |
94 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); | 92 markForLayoutAndParentResourceInvalidation(renderer); |
95 return; | 93 return; |
96 } | 94 } |
97 | 95 |
98 ASSERT_NOT_REACHED(); | 96 ASSERT_NOT_REACHED(); |
99 } | 97 } |
100 | 98 |
101 bool SVGRectElement::selfHasRelativeLengths() const | 99 bool SVGRectElement::selfHasRelativeLengths() const |
102 { | 100 { |
103 return m_x->currentValue()->isRelative() | 101 return m_x->currentValue()->isRelative() |
104 || m_y->currentValue()->isRelative() | 102 || m_y->currentValue()->isRelative() |
105 || m_width->currentValue()->isRelative() | 103 || m_width->currentValue()->isRelative() |
106 || m_height->currentValue()->isRelative() | 104 || m_height->currentValue()->isRelative() |
107 || m_rx->currentValue()->isRelative() | 105 || m_rx->currentValue()->isRelative() |
108 || m_ry->currentValue()->isRelative(); | 106 || m_ry->currentValue()->isRelative(); |
109 } | 107 } |
110 | 108 |
111 RenderObject* SVGRectElement::createRenderer(RenderStyle*) | 109 RenderObject* SVGRectElement::createRenderer(RenderStyle*) |
112 { | 110 { |
113 return new RenderSVGRect(this); | 111 return new RenderSVGRect(this); |
114 } | 112 } |
115 | 113 |
116 } // namespace blink | 114 } // namespace blink |
OLD | NEW |