| Index: Source/core/html/HTMLAnchorElement.cpp
|
| diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
|
| index 08e28f856a4ad78ce665cad45db4ea4b56f53838..f14b579a613d76d88fb525db3efc73ed9992dae0 100644
|
| --- a/Source/core/html/HTMLAnchorElement.cpp
|
| +++ b/Source/core/html/HTMLAnchorElement.cpp
|
| @@ -147,16 +147,14 @@ static void appendServerMapMousePosition(StringBuilder& url, Event* event)
|
|
|
| void HTMLAnchorElement::defaultEventHandler(Event* event)
|
| {
|
| - if (isLiveLink()) {
|
| - Node* target = event->target() ? event->target()->toNode() : 0;
|
| - bool hasFocus = focused() || (target && target->focused());
|
| - if (hasFocus && isEnterKeyKeypressEvent(event)) {
|
| + if (isLink()) {
|
| + if (focused() && isEnterKeyKeydownEvent(event) && isLiveLink()) {
|
| event->setDefaultHandled();
|
| dispatchSimulatedClick(event);
|
| return;
|
| }
|
|
|
| - if (isLinkClick(event)) {
|
| + if (isLinkClick(event) && isLiveLink()) {
|
| handleClick(event);
|
| return;
|
| }
|
| @@ -362,9 +360,9 @@ void HTMLAnchorElement::handleClick(Event* event)
|
| }
|
| }
|
|
|
| -bool isEnterKeyKeypressEvent(Event* event)
|
| +bool isEnterKeyKeydownEvent(Event* event)
|
| {
|
| - return event->type() == EventTypeNames::keypress && event->isKeyboardEvent() && toKeyboardEvent(event)->keyIdentifier() == "Enter";
|
| + return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() && toKeyboardEvent(event)->keyIdentifier() == "Enter";
|
| }
|
|
|
| bool isLinkClick(Event* event)
|
|
|