Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: WebCore/svg/SVGCursorElement.cpp

Issue 5545007: Merge 73432 - 2010-12-07 Justin Schuh <jschuh@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « WebCore/svg/SVGCursorElement.h ('k') | WebCore/svg/SVGElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
39 39
40 PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagNa me, Document* document) 40 PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagNa me, Document* document)
41 { 41 {
42 return adoptRef(new SVGCursorElement(tagName, document)); 42 return adoptRef(new SVGCursorElement(tagName, document));
43 } 43 }
44 44
45 SVGCursorElement::~SVGCursorElement() 45 SVGCursorElement::~SVGCursorElement()
46 { 46 {
47 HashSet<SVGElement*>::iterator end = m_clients.end(); 47 HashSet<SVGElement*>::iterator end = m_clients.end();
48 for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it) 48 for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it)
49 (*it)->setCursorElement(0); 49 (*it)->cursorElementRemoved();
50 } 50 }
51 51
52 void SVGCursorElement::parseMappedAttribute(Attribute* attr) 52 void SVGCursorElement::parseMappedAttribute(Attribute* attr)
53 { 53 {
54 if (attr->name() == SVGNames::xAttr) 54 if (attr->name() == SVGNames::xAttr)
55 setXBaseValue(SVGLength(LengthModeWidth, attr->value())); 55 setXBaseValue(SVGLength(LengthModeWidth, attr->value()));
56 else if (attr->name() == SVGNames::yAttr) 56 else if (attr->name() == SVGNames::yAttr)
57 setYBaseValue(SVGLength(LengthModeHeight, attr->value())); 57 setYBaseValue(SVGLength(LengthModeHeight, attr->value()));
58 else { 58 else {
59 if (SVGTests::parseMappedAttribute(attr)) 59 if (SVGTests::parseMappedAttribute(attr))
60 return; 60 return;
61 if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) 61 if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
62 return; 62 return;
63 if (SVGURIReference::parseMappedAttribute(attr)) 63 if (SVGURIReference::parseMappedAttribute(attr))
64 return; 64 return;
65 65
66 SVGElement::parseMappedAttribute(attr); 66 SVGElement::parseMappedAttribute(attr);
67 } 67 }
68 } 68 }
69 69
70 void SVGCursorElement::addClient(SVGElement* element) 70 void SVGCursorElement::addClient(SVGElement* element)
71 { 71 {
72 m_clients.add(element); 72 m_clients.add(element);
73 element->setCursorElement(this); 73 element->setCursorElement(this);
74 } 74 }
75 75
76 void SVGCursorElement::removeClient(SVGElement* element) 76 void SVGCursorElement::removeClient(SVGElement* element)
77 { 77 {
78 m_clients.remove(element); 78 m_clients.remove(element);
79 element->setCursorElement(0); 79 element->cursorElementRemoved();
80 }
81
82 void SVGCursorElement::removeReferencedElement(SVGElement* element)
83 {
84 m_clients.remove(element);
80 } 85 }
81 86
82 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) 87 void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName)
83 { 88 {
84 SVGElement::svgAttributeChanged(attrName); 89 SVGElement::svgAttributeChanged(attrName);
85 90
86 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr || 91 if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr ||
87 SVGTests::isKnownAttribute(attrName) || 92 SVGTests::isKnownAttribute(attrName) ||
88 SVGExternalResourcesRequired::isKnownAttribute(attrName) || 93 SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
89 SVGURIReference::isKnownAttribute(attrName)) { 94 SVGURIReference::isKnownAttribute(attrName)) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t 128 void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons t
124 { 129 {
125 SVGElement::addSubresourceAttributeURLs(urls); 130 SVGElement::addSubresourceAttributeURLs(urls);
126 131
127 addSubresourceURL(urls, document()->completeURL(href())); 132 addSubresourceURL(urls, document()->completeURL(href()));
128 } 133 }
129 134
130 } 135 }
131 136
132 #endif // ENABLE(SVG) 137 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « WebCore/svg/SVGCursorElement.h ('k') | WebCore/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698