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

Side by Side Diff: Source/core/svg/SVGMPathElement.cpp

Issue 23685007: Have SVGURIReference API deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGPatternElement.cpp » ('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) 2007 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 clearResourceReferences(); 57 clearResourceReferences();
58 } 58 }
59 59
60 void SVGMPathElement::buildPendingResource() 60 void SVGMPathElement::buildPendingResource()
61 { 61 {
62 clearResourceReferences(); 62 clearResourceReferences();
63 if (!inDocument()) 63 if (!inDocument())
64 return; 64 return;
65 65
66 String id; 66 String id;
67 Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentVal ue(), &document(), &id); 67 Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentVal ue(), document(), &id);
68 if (!target) { 68 if (!target) {
69 // Do not register as pending if we are already pending this resource. 69 // Do not register as pending if we are already pending this resource.
70 if (document().accessSVGExtensions()->isElementPendingResource(this, id) ) 70 if (document().accessSVGExtensions()->isElementPendingResource(this, id) )
71 return; 71 return;
72 72
73 if (!id.isEmpty()) { 73 if (!id.isEmpty()) {
74 document().accessSVGExtensions()->addPendingResource(id, this); 74 document().accessSVGExtensions()->addPendingResource(id, this);
75 ASSERT(hasPendingResources()); 75 ASSERT(hasPendingResources());
76 } 76 }
77 } else if (target->isSVGElement()) { 77 } else if (target->isSVGElement()) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) 146 if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
147 return; 147 return;
148 148
149 ASSERT_NOT_REACHED(); 149 ASSERT_NOT_REACHED();
150 } 150 }
151 151
152 SVGPathElement* SVGMPathElement::pathElement() 152 SVGPathElement* SVGMPathElement::pathElement()
153 { 153 {
154 Element* target = targetElementFromIRIString(hrefCurrentValue(), &document() ); 154 Element* target = targetElementFromIRIString(hrefCurrentValue(), document()) ;
155 if (target && target->hasTagName(SVGNames::pathTag)) 155 if (target && target->hasTagName(SVGNames::pathTag))
156 return toSVGPathElement(target); 156 return toSVGPathElement(target);
157 return 0; 157 return 0;
158 } 158 }
159 159
160 void SVGMPathElement::targetPathChanged() 160 void SVGMPathElement::targetPathChanged()
161 { 161 {
162 notifyParentOfPathChange(parentNode()); 162 notifyParentOfPathChange(parentNode());
163 } 163 }
164 164
165 void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent) 165 void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent)
166 { 166 {
167 if (parent && parent->hasTagName(SVGNames::animateMotionTag)) 167 if (parent && parent->hasTagName(SVGNames::animateMotionTag))
168 static_cast<SVGAnimateMotionElement*>(parent)->updateAnimationPath(); 168 static_cast<SVGAnimateMotionElement*>(parent)->updateAnimationPath();
169 } 169 }
170 170
171 } // namespace WebCore 171 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/SVGLinearGradientElement.cpp ('k') | Source/core/svg/SVGPatternElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698