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

Side by Side 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, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 int x = absolutePosition.x(); 140 int x = absolutePosition.x();
141 int y = absolutePosition.y(); 141 int y = absolutePosition.y();
142 url.append('?'); 142 url.append('?');
143 url.appendNumber(x); 143 url.appendNumber(x);
144 url.append(','); 144 url.append(',');
145 url.appendNumber(y); 145 url.appendNumber(y);
146 } 146 }
147 147
148 void HTMLAnchorElement::defaultEventHandler(Event* event) 148 void HTMLAnchorElement::defaultEventHandler(Event* event)
149 { 149 {
150 if (isLink()) { 150 if (isLiveLink()) {
151 if (focused() && isEnterKeyKeydownEvent(event) && isLiveLink()) { 151 Node* target = event->target()->toNode();
152 if ((focused() || (target->focused() && contains(target))) && isEnterKey KeydownEvent(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
152 event->setDefaultHandled(); 153 event->setDefaultHandled();
153 dispatchSimulatedClick(event); 154 dispatchSimulatedClick(event);
154 return; 155 return;
155 } 156 }
156 157
157 if (isLinkClick(event) && isLiveLink()) { 158 if (isLinkClick(event)) {
158 handleClick(event); 159 handleClick(event);
159 return; 160 return;
160 } 161 }
161 } 162 }
162 163
163 HTMLElement::defaultEventHandler(event); 164 HTMLElement::defaultEventHandler(event);
164 } 165 }
165 166
166 void HTMLAnchorElement::setActive(bool down) 167 void HTMLAnchorElement::setActive(bool down)
167 { 168 {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 Vector<String> argv; 392 Vector<String> argv;
392 argv.append("a"); 393 argv.append("a");
393 argv.append(fastGetAttribute(hrefAttr)); 394 argv.append(fastGetAttribute(hrefAttr));
394 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() ); 395 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() );
395 } 396 }
396 } 397 }
397 return HTMLElement::insertedInto(insertionPoint); 398 return HTMLElement::insertedInto(insertionPoint);
398 } 399 }
399 400
400 } 401 }
OLDNEW
« 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