| Index: Source/core/html/HTMLAnchorElement.cpp
|
| diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
|
| index 6163eb8b78e9ea16c135f1376c4bdef04ce13e84..4761a5625df5d6f30a70c18a350b28444e782783 100644
|
| --- a/Source/core/html/HTMLAnchorElement.cpp
|
| +++ b/Source/core/html/HTMLAnchorElement.cpp
|
| @@ -147,14 +147,17 @@ 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)) {
|
| event->setDefaultHandled();
|
| dispatchSimulatedClick(event);
|
| return;
|
| }
|
|
|
| - if (isLinkClick(event) && isLiveLink()) {
|
| + if (isLinkClick(event)) {
|
| handleClick(event);
|
| return;
|
| }
|
| @@ -357,9 +360,9 @@ void HTMLAnchorElement::handleClick(Event* event)
|
| }
|
| }
|
|
|
| -bool isEnterKeyKeydownEvent(Event* event)
|
| +bool isEnterKeyKeypressEvent(Event* event)
|
| {
|
| - return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() && toKeyboardEvent(event)->keyIdentifier() == "Enter";
|
| + return event->type() == EventTypeNames::keypress && event->isKeyboardEvent() && toKeyboardEvent(event)->keyIdentifier() == "Enter";
|
| }
|
|
|
| bool isLinkClick(Event* event)
|
|
|