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

Side by Side Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 562653002: Do not reset mouse focus flag on keydown at anchor elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add regression test (click-focus-keydown-no-ring) 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLAnchorElement.h ('k') | Source/core/html/HTMLFormControlElement.h » ('j') | 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return HTMLElement::supportsFocus(); 82 return HTMLElement::supportsFocus();
83 // If not a link we should still be able to focus the element if it has tabI ndex. 83 // If not a link we should still be able to focus the element if it has tabI ndex.
84 return isLink() || HTMLElement::supportsFocus(); 84 return isLink() || HTMLElement::supportsFocus();
85 } 85 }
86 86
87 bool HTMLAnchorElement::shouldHaveFocusAppearance() const 87 bool HTMLAnchorElement::shouldHaveFocusAppearance() const
88 { 88 {
89 return !m_wasFocusedByMouse || HTMLElement::supportsFocus(); 89 return !m_wasFocusedByMouse || HTMLElement::supportsFocus();
90 } 90 }
91 91
92 bool HTMLAnchorElement::wasFocusedByMouse() const 92 void HTMLAnchorElement::dispatchFocusEvent(Element* oldFocusedElement, FocusType type)
93 { 93 {
94 return m_wasFocusedByMouse; 94 if (type != FocusTypePage)
95 } 95 m_wasFocusedByMouse = type == FocusTypeMouse;
96 96 HTMLElement::dispatchFocusEvent(oldFocusedElement, type);
97 void HTMLAnchorElement::setWasFocusedByMouse(bool wasFocusedByMouse)
98 {
99 m_wasFocusedByMouse = wasFocusedByMouse;
100 } 97 }
101 98
102 bool HTMLAnchorElement::isMouseFocusable() const 99 bool HTMLAnchorElement::isMouseFocusable() const
103 { 100 {
104 if (isLink()) 101 if (isLink())
105 return supportsFocus(); 102 return supportsFocus();
106 103
107 return HTMLElement::isMouseFocusable(); 104 return HTMLElement::isMouseFocusable();
108 } 105 }
109 106
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 Vector<String> argv; 393 Vector<String> argv;
397 argv.append("a"); 394 argv.append("a");
398 argv.append(fastGetAttribute(hrefAttr)); 395 argv.append(fastGetAttribute(hrefAttr));
399 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() ); 396 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() );
400 } 397 }
401 } 398 }
402 return HTMLElement::insertedInto(insertionPoint); 399 return HTMLElement::insertedInto(insertionPoint);
403 } 400 }
404 401
405 } 402 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAnchorElement.h ('k') | Source/core/html/HTMLFormControlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698