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

Side by Side Diff: Source/WebCore/svg/SVGAElement.cpp

Issue 7807001: Merge 92809 - Crash when clicking an SVG <a> link to the local document (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 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
« no previous file with comments | « LayoutTests/svg/custom/click-internal-anchor-with-use-crash-expected.txt ('k') | no next file » | 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 #if ENABLE(SVG_ANIMATION) 164 #if ENABLE(SVG_ANIMATION)
165 if (url[0] == '#') { 165 if (url[0] == '#') {
166 Element* targetElement = treeScope()->getElementById(url.substri ng(1)); 166 Element* targetElement = treeScope()->getElementById(url.substri ng(1));
167 if (SVGSMILElement::isSMILElement(targetElement)) { 167 if (SVGSMILElement::isSMILElement(targetElement)) {
168 static_cast<SVGSMILElement*>(targetElement)->beginByLinkActi vation(); 168 static_cast<SVGSMILElement*>(targetElement)->beginByLinkActi vation();
169 event->setDefaultHandled(); 169 event->setDefaultHandled();
170 return; 170 return;
171 } 171 }
172 // Only allow navigation to internal <view> anchors. 172 // Only allow navigation to internal <view> anchors.
173 if (!targetElement->hasTagName(SVGNames::viewTag)) 173 if (targetElement && !targetElement->hasTagName(SVGNames::viewTa g))
174 return; 174 return;
175 } 175 }
176 #endif 176 #endif
177 177
178 // FIXME: Why does the SVG anchor element have this special logic 178 // FIXME: Why does the SVG anchor element have this special logic
179 // for middle click that the HTML anchor element does not have? 179 // for middle click that the HTML anchor element does not have?
180 // Making a middle click open a link in a new window or tab is 180 // Making a middle click open a link in a new window or tab is
181 // properly handled at the client level, not inside WebKit; this 181 // properly handled at the client level, not inside WebKit; this
182 // code should be deleted. 182 // code should be deleted.
183 String target = isMiddleMouseButtonEvent(event) ? "_blank" : this->t arget(); 183 String target = isMiddleMouseButtonEvent(event) ? "_blank" : this->t arget();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return false; 234 return false;
235 if (parentNode() && parentNode()->isSVGElement()) 235 if (parentNode() && parentNode()->isSVGElement())
236 return parentNode()->childShouldCreateRenderer(child); 236 return parentNode()->childShouldCreateRenderer(child);
237 237
238 return SVGElement::childShouldCreateRenderer(child); 238 return SVGElement::childShouldCreateRenderer(child);
239 } 239 }
240 240
241 } // namespace WebCore 241 } // namespace WebCore
242 242
243 #endif // ENABLE(SVG) 243 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/click-internal-anchor-with-use-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698