Index: Source/core/html/HTMLAnchorElement.cpp |
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp |
index 6163eb8b78e9ea16c135f1376c4bdef04ce13e84..7736b8d1ba8b54d8ba0141d8805bba213a046f91 100644 |
--- a/Source/core/html/HTMLAnchorElement.cpp |
+++ b/Source/core/html/HTMLAnchorElement.cpp |
@@ -147,8 +147,11 @@ static void appendServerMapMousePosition(StringBuilder& url, Event* event) |
void HTMLAnchorElement::defaultEventHandler(Event* event) |
{ |
- if (isLink()) { |
- if (focused() && isEnterKeyKeydownEvent(event) && isLiveLink()) { |
+ if (isLiveLink()) { |
+ ASSERT(event->target()); |
+ Node* target = event->target()->toNode(); |
+ ASSERT(target); |
+ if ((focused() || target->focused()) && isEnterKeyKeypressEvent(event)) { |
robwu
2014/10/13 09:19:48
Don't forget to update similar code in src/third_p
Miyoung Shin(g)
2014/10/13 11:05:01
Sure, I remember it.
But I mentioned earlier, I ho
robwu
2014/10/13 11:29:33
There is some duplicate logic in the implementatio
|
event->setDefaultHandled(); |
dispatchSimulatedClick(event); |
return; |
@@ -357,6 +360,11 @@ void HTMLAnchorElement::handleClick(Event* event) |
} |
} |
+bool isEnterKeyKeypressEvent(Event* event) |
+{ |
+ return event->type() == EventTypeNames::keypress && event->isKeyboardEvent() && toKeyboardEvent(event)->keyIdentifier() == "Enter"; |
+} |
+ |
bool isEnterKeyKeydownEvent(Event* event) |
robwu
2014/10/13 09:19:48
And remove this method declaration (and its defeni
Miyoung Shin(g)
2014/10/13 11:05:01
Sure, I remember it as well.
After checking SVG is
|
{ |
return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() && toKeyboardEvent(event)->keyIdentifier() == "Enter"; |