| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 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 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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/SVGPatternElement.h" | 24 #include "core/svg/SVGPatternElement.h" |
| 25 | 25 |
| 26 #include "XLinkNames.h" | 26 #include "XLinkNames.h" |
| 27 #include "core/dom/ElementTraversal.h" | 27 #include "core/dom/ElementTraversal.h" |
| 28 #include "core/rendering/svg/RenderSVGResourcePattern.h" | 28 #include "core/rendering/svg/RenderSVGResourcePattern.h" |
| 29 #include "core/svg/PatternAttributes.h" | 29 #include "core/svg/PatternAttributes.h" |
| 30 #include "platform/transforms/AffineTransform.h" | 30 #include "platform/transforms/AffineTransform.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 SVGPatternElement::SVGPatternElement(Document& document) | 34 inline SVGPatternElement::SVGPatternElement(Document& document) |
| 35 : SVGElement(SVGNames::patternTag, document) | 35 : SVGElement(SVGNames::patternTag, document) |
| 36 , SVGURIReference(this) | 36 , SVGURIReference(this) |
| 37 , SVGTests(this) | 37 , SVGTests(this) |
| 38 , SVGFitToViewBox(this) | 38 , SVGFitToViewBox(this) |
| 39 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 39 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
| 40 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) | 40 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
| 41 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) | 41 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
| 42 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 42 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
| 43 , m_patternTransform(SVGAnimatedTransformList::create(this, SVGNames::patter
nTransformAttr, SVGTransformList::create())) | 43 , m_patternTransform(SVGAnimatedTransformList::create(this, SVGNames::patter
nTransformAttr, SVGTransformList::create())) |
| 44 , m_patternUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(t
his, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) | 44 , m_patternUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(t
his, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) |
| 45 , m_patternContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::c
reate(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERS
PACEONUSE)) | 45 , m_patternContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::c
reate(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERS
PACEONUSE)) |
| 46 { | 46 { |
| 47 ScriptWrappable::init(this); | 47 ScriptWrappable::init(this); |
| 48 | 48 |
| 49 addToPropertyMap(m_x); | 49 addToPropertyMap(m_x); |
| 50 addToPropertyMap(m_y); | 50 addToPropertyMap(m_y); |
| 51 addToPropertyMap(m_width); | 51 addToPropertyMap(m_width); |
| 52 addToPropertyMap(m_height); | 52 addToPropertyMap(m_height); |
| 53 addToPropertyMap(m_patternTransform); | 53 addToPropertyMap(m_patternTransform); |
| 54 addToPropertyMap(m_patternUnits); | 54 addToPropertyMap(m_patternUnits); |
| 55 addToPropertyMap(m_patternContentUnits); | 55 addToPropertyMap(m_patternContentUnits); |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEFINE_NODE_FACTORY(SVGPatternElement) |
| 59 |
| 58 bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName) | 60 bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName) |
| 59 { | 61 { |
| 60 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 62 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 61 if (supportedAttributes.isEmpty()) { | 63 if (supportedAttributes.isEmpty()) { |
| 62 SVGURIReference::addSupportedAttributes(supportedAttributes); | 64 SVGURIReference::addSupportedAttributes(supportedAttributes); |
| 63 SVGTests::addSupportedAttributes(supportedAttributes); | 65 SVGTests::addSupportedAttributes(supportedAttributes); |
| 64 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 66 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
| 65 supportedAttributes.add(SVGNames::patternUnitsAttr); | 67 supportedAttributes.add(SVGNames::patternUnitsAttr); |
| 66 supportedAttributes.add(SVGNames::patternContentUnitsAttr); | 68 supportedAttributes.add(SVGNames::patternContentUnitsAttr); |
| 67 supportedAttributes.add(SVGNames::patternTransformAttr); | 69 supportedAttributes.add(SVGNames::patternTransformAttr); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 211 |
| 210 bool SVGPatternElement::selfHasRelativeLengths() const | 212 bool SVGPatternElement::selfHasRelativeLengths() const |
| 211 { | 213 { |
| 212 return m_x->currentValue()->isRelative() | 214 return m_x->currentValue()->isRelative() |
| 213 || m_y->currentValue()->isRelative() | 215 || m_y->currentValue()->isRelative() |
| 214 || m_width->currentValue()->isRelative() | 216 || m_width->currentValue()->isRelative() |
| 215 || m_height->currentValue()->isRelative(); | 217 || m_height->currentValue()->isRelative(); |
| 216 } | 218 } |
| 217 | 219 |
| 218 } | 220 } |
| OLD | NEW |