| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/svg/SVGElementInstance.h" | 30 #include "core/svg/SVGElementInstance.h" |
| 31 #include "platform/transforms/AffineTransform.h" | 31 #include "platform/transforms/AffineTransform.h" |
| 32 | 32 |
| 33 namespace WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 inline SVGPatternElement::SVGPatternElement(Document& document) | 35 inline SVGPatternElement::SVGPatternElement(Document& document) |
| 36 : SVGElement(SVGNames::patternTag, document) | 36 : SVGElement(SVGNames::patternTag, document) |
| 37 , SVGURIReference(this) | 37 , SVGURIReference(this) |
| 38 , SVGTests(this) | 38 , SVGTests(this) |
| 39 , SVGFitToViewBox(this) | 39 , SVGFitToViewBox(this) |
| 40 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth))) | 40 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
| 41 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight))) | 41 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
| 42 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth))) | 42 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
| 43 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight))) | 43 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
| 44 , m_patternTransform(SVGAnimatedTransformList::create(this, SVGNames::patter
nTransformAttr, SVGTransformList::create())) | 44 , m_patternTransform(SVGAnimatedTransformList::create(this, SVGNames::patter
nTransformAttr, SVGTransformList::create())) |
| 45 , m_patternUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(t
his, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) | 45 , m_patternUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::create(t
his, SVGNames::patternUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)) |
| 46 , m_patternContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::c
reate(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERS
PACEONUSE)) | 46 , m_patternContentUnits(SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>::c
reate(this, SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVG_UNIT_TYPE_USERS
PACEONUSE)) |
| 47 { | 47 { |
| 48 ScriptWrappable::init(this); | 48 ScriptWrappable::init(this); |
| 49 | 49 |
| 50 addToPropertyMap(m_x); | 50 addToPropertyMap(m_x); |
| 51 addToPropertyMap(m_y); | 51 addToPropertyMap(m_y); |
| 52 addToPropertyMap(m_width); | 52 addToPropertyMap(m_width); |
| 53 addToPropertyMap(m_height); | 53 addToPropertyMap(m_height); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 if (!isSupportedAttribute(name)) { | 86 if (!isSupportedAttribute(name)) { |
| 87 SVGElement::parseAttribute(name, value); | 87 SVGElement::parseAttribute(name, value); |
| 88 } else if (name == SVGNames::patternUnitsAttr) { | 88 } else if (name == SVGNames::patternUnitsAttr) { |
| 89 m_patternUnits->setBaseValueAsString(value, parseError); | 89 m_patternUnits->setBaseValueAsString(value, parseError); |
| 90 } else if (name == SVGNames::patternContentUnitsAttr) { | 90 } else if (name == SVGNames::patternContentUnitsAttr) { |
| 91 m_patternContentUnits->setBaseValueAsString(value, parseError); | 91 m_patternContentUnits->setBaseValueAsString(value, parseError); |
| 92 } else if (name == SVGNames::patternTransformAttr) { | 92 } else if (name == SVGNames::patternTransformAttr) { |
| 93 m_patternTransform->setBaseValueAsString(value, parseError); | 93 m_patternTransform->setBaseValueAsString(value, parseError); |
| 94 } else if (name == SVGNames::xAttr) { | 94 } else if (name == SVGNames::xAttr) { |
| 95 m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 95 m_x->setBaseValueAsString(value, parseError); |
| 96 } else if (name == SVGNames::yAttr) { | 96 } else if (name == SVGNames::yAttr) { |
| 97 m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 97 m_y->setBaseValueAsString(value, parseError); |
| 98 } else if (name == SVGNames::widthAttr) { | 98 } else if (name == SVGNames::widthAttr) { |
| 99 m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError); | 99 m_width->setBaseValueAsString(value, parseError); |
| 100 } else if (name == SVGNames::heightAttr) { | 100 } else if (name == SVGNames::heightAttr) { |
| 101 m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError)
; | 101 m_height->setBaseValueAsString(value, parseError); |
| 102 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { | 102 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { |
| 103 } else if (SVGTests::parseAttribute(name, value)) { | 103 } else if (SVGTests::parseAttribute(name, value)) { |
| 104 } else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseErr
or)) { | 104 } else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseErr
or)) { |
| 105 } else { | 105 } else { |
| 106 ASSERT_NOT_REACHED(); | 106 ASSERT_NOT_REACHED(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 reportAttributeParsingError(parseError, name, value); | 109 reportAttributeParsingError(parseError, name, value); |
| 110 } | 110 } |
| 111 | 111 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 bool SVGPatternElement::selfHasRelativeLengths() const | 216 bool SVGPatternElement::selfHasRelativeLengths() const |
| 217 { | 217 { |
| 218 return m_x->currentValue()->isRelative() | 218 return m_x->currentValue()->isRelative() |
| 219 || m_y->currentValue()->isRelative() | 219 || m_y->currentValue()->isRelative() |
| 220 || m_width->currentValue()->isRelative() | 220 || m_width->currentValue()->isRelative() |
| 221 || m_height->currentValue()->isRelative(); | 221 || m_height->currentValue()->isRelative(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } | 224 } |
| OLD | NEW |