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, |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "XLinkNames.h" | 26 #include "XLinkNames.h" |
27 #include "core/dom/Document.h" | 27 #include "core/dom/Document.h" |
28 #include "core/svg/SVGElementInstance.h" | 28 #include "core/svg/SVGElementInstance.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 inline SVGCursorElement::SVGCursorElement(Document& document) | 32 inline SVGCursorElement::SVGCursorElement(Document& document) |
33 : SVGElement(SVGNames::cursorTag, document) | 33 : SVGElement(SVGNames::cursorTag, document) |
34 , SVGTests(this) | 34 , SVGTests(this) |
35 , SVGURIReference(this) | 35 , SVGURIReference(this) |
36 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth))) | 36 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
37 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight))) | 37 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
38 { | 38 { |
39 ScriptWrappable::init(this); | 39 ScriptWrappable::init(this); |
40 | 40 |
41 addToPropertyMap(m_x); | 41 addToPropertyMap(m_x); |
42 addToPropertyMap(m_y); | 42 addToPropertyMap(m_y); |
43 } | 43 } |
44 | 44 |
45 PassRefPtr<SVGCursorElement> SVGCursorElement::create(Document& document) | 45 PassRefPtr<SVGCursorElement> SVGCursorElement::create(Document& document) |
46 { | 46 { |
47 return adoptRef(new SVGCursorElement(document)); | 47 return adoptRef(new SVGCursorElement(document)); |
(...skipping 18 matching lines...) Expand all Loading... |
66 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 66 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
67 } | 67 } |
68 | 68 |
69 void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 69 void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
70 { | 70 { |
71 SVGParsingError parseError = NoError; | 71 SVGParsingError parseError = NoError; |
72 | 72 |
73 if (!isSupportedAttribute(name)) { | 73 if (!isSupportedAttribute(name)) { |
74 SVGElement::parseAttribute(name, value); | 74 SVGElement::parseAttribute(name, value); |
75 } else if (name == SVGNames::xAttr) { | 75 } else if (name == SVGNames::xAttr) { |
76 m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 76 m_x->setBaseValueAsString(value, parseError); |
77 } else if (name == SVGNames::yAttr) { | 77 } else if (name == SVGNames::yAttr) { |
78 m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 78 m_y->setBaseValueAsString(value, parseError); |
79 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { | 79 } else if (SVGURIReference::parseAttribute(name, value, parseError)) { |
80 } else if (SVGTests::parseAttribute(name, value)) { | 80 } else if (SVGTests::parseAttribute(name, value)) { |
81 } else { | 81 } else { |
82 ASSERT_NOT_REACHED(); | 82 ASSERT_NOT_REACHED(); |
83 } | 83 } |
84 | 84 |
85 reportAttributeParsingError(parseError, name, value); | 85 reportAttributeParsingError(parseError, name, value); |
86 } | 86 } |
87 | 87 |
88 void SVGCursorElement::addClient(SVGElement* element) | 88 void SVGCursorElement::addClient(SVGElement* element) |
(...skipping 27 matching lines...) Expand all Loading... |
116 | 116 |
117 // Any change of a cursor specific attribute triggers this recalc. | 117 // Any change of a cursor specific attribute triggers this recalc. |
118 HashSet<SVGElement*>::const_iterator it = m_clients.begin(); | 118 HashSet<SVGElement*>::const_iterator it = m_clients.begin(); |
119 HashSet<SVGElement*>::const_iterator end = m_clients.end(); | 119 HashSet<SVGElement*>::const_iterator end = m_clients.end(); |
120 | 120 |
121 for (; it != end; ++it) | 121 for (; it != end; ++it) |
122 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); | 122 (*it)->setNeedsStyleRecalc(SubtreeStyleChange); |
123 } | 123 } |
124 | 124 |
125 } | 125 } |
OLD | NEW |