| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 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 | 22 |
| 23 #include "core/svg/SVGViewElement.h" | 23 #include "core/svg/SVGViewElement.h" |
| 24 | 24 |
| 25 | 25 |
| 26 namespace WebCore { | 26 namespace WebCore { |
| 27 | 27 |
| 28 // Animated property definitions | 28 // Animated property definitions |
| 29 DEFINE_ANIMATED_RECT(SVGViewElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | |
| 30 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGViewElement, SVGNames::preserveAspectRati
oAttr, PreserveAspectRatio, preserveAspectRatio) | 29 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGViewElement, SVGNames::preserveAspectRati
oAttr, PreserveAspectRatio, preserveAspectRatio) |
| 31 | 30 |
| 32 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGViewElement) | 31 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGViewElement) |
| 33 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | |
| 34 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 32 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
| 35 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 33 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
| 36 END_REGISTER_ANIMATED_PROPERTIES | 34 END_REGISTER_ANIMATED_PROPERTIES |
| 37 | 35 |
| 38 inline SVGViewElement::SVGViewElement(Document& document) | 36 inline SVGViewElement::SVGViewElement(Document& document) |
| 39 : SVGElement(SVGNames::viewTag, document) | 37 : SVGElement(SVGNames::viewTag, document) |
| 38 , m_viewBox(SVGAnimatedRect::create(this, SVGNames::viewBoxAttr)) |
| 40 , m_zoomAndPan(SVGZoomAndPanMagnify) | 39 , m_zoomAndPan(SVGZoomAndPanMagnify) |
| 41 , m_viewTarget(SVGNames::viewTargetAttr) | 40 , m_viewTarget(SVGNames::viewTargetAttr) |
| 42 { | 41 { |
| 43 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
| 43 |
| 44 addToPropertyMap(m_viewBox); |
| 44 registerAnimatedPropertiesForSVGViewElement(); | 45 registerAnimatedPropertiesForSVGViewElement(); |
| 45 } | 46 } |
| 46 | 47 |
| 47 PassRefPtr<SVGViewElement> SVGViewElement::create(Document& document) | 48 PassRefPtr<SVGViewElement> SVGViewElement::create(Document& document) |
| 48 { | 49 { |
| 49 return adoptRef(new SVGViewElement(document)); | 50 return adoptRef(new SVGViewElement(document)); |
| 50 } | 51 } |
| 51 | 52 |
| 52 bool SVGViewElement::isSupportedAttribute(const QualifiedName& attrName) | 53 bool SVGViewElement::isSupportedAttribute(const QualifiedName& attrName) |
| 53 { | 54 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 74 | 75 |
| 75 if (SVGFitToViewBox::parseAttribute(this, name, value)) | 76 if (SVGFitToViewBox::parseAttribute(this, name, value)) |
| 76 return; | 77 return; |
| 77 if (SVGZoomAndPan::parseAttribute(this, name, value)) | 78 if (SVGZoomAndPan::parseAttribute(this, name, value)) |
| 78 return; | 79 return; |
| 79 | 80 |
| 80 ASSERT_NOT_REACHED(); | 81 ASSERT_NOT_REACHED(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 } | 84 } |
| OLD | NEW |