OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |