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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 { | 103 { |
104 if (parentNode() && parentNode()->isSVGElement() && toSVGElement(parentNode(
))->isTextContent()) | 104 if (parentNode() && parentNode()->isSVGElement() && toSVGElement(parentNode(
))->isTextContent()) |
105 return new RenderSVGInline(this); | 105 return new RenderSVGInline(this); |
106 | 106 |
107 return new RenderSVGTransformableContainer(this); | 107 return new RenderSVGTransformableContainer(this); |
108 } | 108 } |
109 | 109 |
110 void SVGAElement::defaultEventHandler(Event* event) | 110 void SVGAElement::defaultEventHandler(Event* event) |
111 { | 111 { |
112 if (isLink()) { | 112 if (isLink()) { |
113 if (focused() && isEnterKeyKeydownEvent(event)) { | 113 ASSERT(event->target()); |
| 114 Node* target = event->target()->toNode(); |
| 115 ASSERT(target); |
| 116 if ((focused() || target->focused()) && isEnterKeyKeypressEvent(event))
{ |
114 event->setDefaultHandled(); | 117 event->setDefaultHandled(); |
115 dispatchSimulatedClick(event); | 118 dispatchSimulatedClick(event); |
116 return; | 119 return; |
117 } | 120 } |
118 | 121 |
119 if (isLinkClick(event)) { | 122 if (isLinkClick(event)) { |
120 String url = stripLeadingAndTrailingHTMLSpaces(hrefString()); | 123 String url = stripLeadingAndTrailingHTMLSpaces(hrefString()); |
121 | 124 |
122 if (url[0] == '#') { | 125 if (url[0] == '#') { |
123 Element* targetElement = treeScope().getElementById(AtomicString
(url.substring(1))); | 126 Element* targetElement = treeScope().getElementById(AtomicString
(url.substring(1))); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 return SVGElement::canStartSelection(); | 204 return SVGElement::canStartSelection(); |
202 return hasEditableStyle(); | 205 return hasEditableStyle(); |
203 } | 206 } |
204 | 207 |
205 bool SVGAElement::willRespondToMouseClickEvents() | 208 bool SVGAElement::willRespondToMouseClickEvents() |
206 { | 209 { |
207 return isLink() || SVGGraphicsElement::willRespondToMouseClickEvents(); | 210 return isLink() || SVGGraphicsElement::willRespondToMouseClickEvents(); |
208 } | 211 } |
209 | 212 |
210 } // namespace blink | 213 } // namespace blink |
OLD | NEW |