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, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 if (hasTagName(SVGNames::textTag)) { | 190 if (hasTagName(SVGNames::textTag)) { |
191 rect = static_cast<const SVGTextElement*>(this)->getBBox(styleUpdateStra
tegy); | 191 rect = static_cast<const SVGTextElement*>(this)->getBBox(styleUpdateStra
tegy); |
192 return true; | 192 return true; |
193 } | 193 } |
194 return false; | 194 return false; |
195 } | 195 } |
196 | 196 |
197 void SVGElement::setCursorElement(SVGCursorElement* cursorElement) | 197 void SVGElement::setCursorElement(SVGCursorElement* cursorElement) |
198 { | 198 { |
199 ensureRareSVGData()->setCursorElement(cursorElement); | 199 SVGElementRareData* rareData = ensureRareSVGData(); |
| 200 if (SVGCursorElement* oldCursorElement = rareData->cursorElement()) { |
| 201 if (cursorElement == oldCursorElement) |
| 202 return; |
| 203 oldCursorElement->removeReferencedElement(this); |
| 204 } |
| 205 rareData->setCursorElement(cursorElement); |
| 206 } |
| 207 |
| 208 void SVGElement::cursorElementRemoved() |
| 209 { |
| 210 ASSERT(hasRareSVGData()); |
| 211 rareSVGData()->setCursorElement(0); |
200 } | 212 } |
201 | 213 |
202 void SVGElement::setCursorImageValue(CSSCursorImageValue* cursorImageValue) | 214 void SVGElement::setCursorImageValue(CSSCursorImageValue* cursorImageValue) |
203 { | 215 { |
204 ensureRareSVGData()->setCursorImageValue(cursorImageValue); | 216 SVGElementRareData* rareData = ensureRareSVGData(); |
| 217 if (CSSCursorImageValue* oldCursorImageValue = rareData->cursorImageValue())
{ |
| 218 if (cursorImageValue == oldCursorImageValue) |
| 219 return; |
| 220 oldCursorImageValue->removeReferencedElement(this); |
| 221 } |
| 222 rareData->setCursorImageValue(cursorImageValue); |
| 223 } |
| 224 |
| 225 void SVGElement::cursorImageElementRemoved() |
| 226 { |
| 227 ASSERT(hasRareSVGData()); |
| 228 rareSVGData()->setCursorImageValue(0); |
205 } | 229 } |
206 | 230 |
207 void SVGElement::parseMappedAttribute(Attribute* attr) | 231 void SVGElement::parseMappedAttribute(Attribute* attr) |
208 { | 232 { |
209 // standard events | 233 // standard events |
210 if (attr->name() == onloadAttr) | 234 if (attr->name() == onloadAttr) |
211 setAttributeEventListener(eventNames().loadEvent, createAttributeEventLi
stener(this, attr)); | 235 setAttributeEventListener(eventNames().loadEvent, createAttributeEventLi
stener(this, attr)); |
212 else if (attr->name() == onclickAttr) | 236 else if (attr->name() == onclickAttr) |
213 setAttributeEventListener(eventNames().clickEvent, createAttributeEventL
istener(this, attr)); | 237 setAttributeEventListener(eventNames().clickEvent, createAttributeEventL
istener(this, attr)); |
214 else if (attr->name() == onmousedownAttr) | 238 else if (attr->name() == onmousedownAttr) |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 const_cast<SVGElement*>(this)->synchronizeProperty(name); | 367 const_cast<SVGElement*>(this)->synchronizeProperty(name); |
344 if (name == anyQName()) | 368 if (name == anyQName()) |
345 setAreSVGAttributesValid(); | 369 setAreSVGAttributesValid(); |
346 | 370 |
347 clearIsSynchronizingSVGAttributes(); | 371 clearIsSynchronizingSVGAttributes(); |
348 } | 372 } |
349 | 373 |
350 } | 374 } |
351 | 375 |
352 #endif // ENABLE(SVG) | 376 #endif // ENABLE(SVG) |
OLD | NEW |