Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1135)

Unified Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 619613005: The link should be activated by enter key on focusing the child element inside the anchor(relanding) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAnchorElement.cpp
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 533dc7f200053467398ad4fcd85b52a2a18c06ed..476c99df2663902cc3bf456bbf3c2ee055267acd 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -147,14 +147,15 @@ static void appendServerMapMousePosition(StringBuilder& url, Event* event)
void HTMLAnchorElement::defaultEventHandler(Event* event)
{
- if (isLink()) {
- if (focused() && isEnterKeyKeydownEvent(event) && isLiveLink()) {
+ if (isLiveLink()) {
+ Node* target = event->target()->toNode();
+ if ((focused() || (target->focused() && contains(target))) && isEnterKeyKeydownEvent(event)) {
pdr. 2014/10/01 20:32:37 This does not seem correct. 1) This will break ex
robwu 2014/10/01 21:25:54 Keyboard input events bubble, so I would expect th
event->setDefaultHandled();
dispatchSimulatedClick(event);
return;
}
- if (isLinkClick(event) && isLiveLink()) {
+ if (isLinkClick(event)) {
handleClick(event);
return;
}
« no previous file with comments | « LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698