| 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 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-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 27 matching lines...) Expand all Loading... |
| 38 entries.append(std::make_pair(SVGMarkerUnitsUserSpaceOnUse, "userSpaceOn
Use")); | 38 entries.append(std::make_pair(SVGMarkerUnitsUserSpaceOnUse, "userSpaceOn
Use")); |
| 39 entries.append(std::make_pair(SVGMarkerUnitsStrokeWidth, "strokeWidth"))
; | 39 entries.append(std::make_pair(SVGMarkerUnitsStrokeWidth, "strokeWidth"))
; |
| 40 } | 40 } |
| 41 return entries; | 41 return entries; |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 inline SVGMarkerElement::SVGMarkerElement(Document& document) | 45 inline SVGMarkerElement::SVGMarkerElement(Document& document) |
| 46 : SVGElement(SVGNames::markerTag, document) | 46 : SVGElement(SVGNames::markerTag, document) |
| 47 , SVGFitToViewBox(this) | 47 , SVGFitToViewBox(this) |
| 48 , m_refX(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::crea
te(LengthModeWidth))) | 48 , m_refX(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::crea
te(LengthModeWidth), AllowNegativeLengths)) |
| 49 , m_refY(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::crea
te(LengthModeWidth))) | 49 , m_refY(SVGAnimatedLength::create(this, SVGNames::refXAttr, SVGLength::crea
te(LengthModeWidth), AllowNegativeLengths)) |
| 50 , m_markerWidth(SVGAnimatedLength::create(this, SVGNames::markerWidthAttr, S
VGLength::create(LengthModeWidth))) | 50 , m_markerWidth(SVGAnimatedLength::create(this, SVGNames::markerWidthAttr, S
VGLength::create(LengthModeWidth), ForbidNegativeLengths)) |
| 51 , m_markerHeight(SVGAnimatedLength::create(this, SVGNames::markerHeightAttr,
SVGLength::create(LengthModeHeight))) | 51 , m_markerHeight(SVGAnimatedLength::create(this, SVGNames::markerHeightAttr,
SVGLength::create(LengthModeHeight), ForbidNegativeLengths)) |
| 52 , m_orientAngle(SVGAnimatedAngle::create(this)) | 52 , m_orientAngle(SVGAnimatedAngle::create(this)) |
| 53 , m_markerUnits(SVGAnimatedEnumeration<SVGMarkerUnitsType>::create(this, SVG
Names::markerUnitsAttr, SVGMarkerUnitsStrokeWidth)) | 53 , m_markerUnits(SVGAnimatedEnumeration<SVGMarkerUnitsType>::create(this, SVG
Names::markerUnitsAttr, SVGMarkerUnitsStrokeWidth)) |
| 54 { | 54 { |
| 55 ScriptWrappable::init(this); | 55 ScriptWrappable::init(this); |
| 56 | 56 |
| 57 // Spec: If the markerWidth/markerHeight attribute is not specified, the eff
ect is as if a value of "3" were specified. | 57 // Spec: If the markerWidth/markerHeight attribute is not specified, the eff
ect is as if a value of "3" were specified. |
| 58 m_markerWidth->setDefaultValueAsString("3"); | 58 m_markerWidth->setDefaultValueAsString("3"); |
| 59 m_markerHeight->setDefaultValueAsString("3"); | 59 m_markerHeight->setDefaultValueAsString("3"); |
| 60 | 60 |
| 61 addToPropertyMap(m_refX); | 61 addToPropertyMap(m_refX); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 94 void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
| 95 { | 95 { |
| 96 SVGParsingError parseError = NoError; | 96 SVGParsingError parseError = NoError; |
| 97 | 97 |
| 98 if (!isSupportedAttribute(name)) | 98 if (!isSupportedAttribute(name)) |
| 99 SVGElement::parseAttribute(name, value); | 99 SVGElement::parseAttribute(name, value); |
| 100 else if (name == SVGNames::markerUnitsAttr) | 100 else if (name == SVGNames::markerUnitsAttr) |
| 101 m_markerUnits->setBaseValueAsString(value, parseError); | 101 m_markerUnits->setBaseValueAsString(value, parseError); |
| 102 else if (name == SVGNames::refXAttr) | 102 else if (name == SVGNames::refXAttr) |
| 103 m_refX->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 103 m_refX->setBaseValueAsString(value, parseError); |
| 104 else if (name == SVGNames::refYAttr) | 104 else if (name == SVGNames::refYAttr) |
| 105 m_refY->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 105 m_refY->setBaseValueAsString(value, parseError); |
| 106 else if (name == SVGNames::markerWidthAttr) | 106 else if (name == SVGNames::markerWidthAttr) |
| 107 m_markerWidth->setBaseValueAsString(value, ForbidNegativeLengths, parseE
rror); | 107 m_markerWidth->setBaseValueAsString(value, parseError); |
| 108 else if (name == SVGNames::markerHeightAttr) | 108 else if (name == SVGNames::markerHeightAttr) |
| 109 m_markerHeight->setBaseValueAsString(value, ForbidNegativeLengths, parse
Error); | 109 m_markerHeight->setBaseValueAsString(value, parseError); |
| 110 else if (name == SVGNames::orientAttr) | 110 else if (name == SVGNames::orientAttr) |
| 111 m_orientAngle->setBaseValueAsString(value, parseError); | 111 m_orientAngle->setBaseValueAsString(value, parseError); |
| 112 else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError
)) { | 112 else if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError
)) { |
| 113 } else | 113 } else |
| 114 ASSERT_NOT_REACHED(); | 114 ASSERT_NOT_REACHED(); |
| 115 | 115 |
| 116 reportAttributeParsingError(parseError, name, value); | 116 reportAttributeParsingError(parseError, name, value); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) | 119 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 bool SVGMarkerElement::selfHasRelativeLengths() const | 171 bool SVGMarkerElement::selfHasRelativeLengths() const |
| 172 { | 172 { |
| 173 return m_refX->currentValue()->isRelative() | 173 return m_refX->currentValue()->isRelative() |
| 174 || m_refY->currentValue()->isRelative() | 174 || m_refY->currentValue()->isRelative() |
| 175 || m_markerWidth->currentValue()->isRelative() | 175 || m_markerWidth->currentValue()->isRelative() |
| 176 || m_markerHeight->currentValue()->isRelative(); | 176 || m_markerHeight->currentValue()->isRelative(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } | 179 } |
| OLD | NEW |