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

Side by Side Diff: third_party/WebKit/WebCore/html/HTMLAnchorElement.cpp

Issue 342071: Fix persistent focus rings on anchor elements on the 223 branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/223/src/
Patch Set: Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/qt/fast/events/click-focus-anchor-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 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 { 62 {
63 if (isContentEditable()) 63 if (isContentEditable())
64 return HTMLElement::supportsFocus(); 64 return HTMLElement::supportsFocus();
65 // If not a link we should still be able to focus the element if it has tabI ndex. 65 // If not a link we should still be able to focus the element if it has tabI ndex.
66 return isLink() || HTMLElement::supportsFocus(); 66 return isLink() || HTMLElement::supportsFocus();
67 } 67 }
68 68
69 bool HTMLAnchorElement::isMouseFocusable() const 69 bool HTMLAnchorElement::isMouseFocusable() const
70 { 70 {
71 // Anchor elements should be mouse focusable, https://bugs.webkit.org/show_b ug.cgi?id=26856 71 // Anchor elements should be mouse focusable, https://bugs.webkit.org/show_b ug.cgi?id=26856
72 #if PLATFORM(MAC) 72 #if !PLATFORM(GTK) && !PLATFORM(QT)
73 if (isLink()) 73 if (isLink())
74 return false; 74 // Only allow links with tabIndex or contentEditable to be mouse focusab le.
75 return HTMLElement::supportsFocus();
75 #endif 76 #endif
77
76 // Allow tab index etc to control focus. 78 // Allow tab index etc to control focus.
77 return HTMLElement::isMouseFocusable(); 79 return HTMLElement::isMouseFocusable();
78 } 80 }
79 81
80 bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const 82 bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
81 { 83 {
82 if (!isLink()) 84 if (!isLink())
83 return HTMLElement::isKeyboardFocusable(event); 85 return HTMLElement::isKeyboardFocusable(event);
84 86
85 if (!isFocusable()) 87 if (!isFocusable())
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // this link or if the shift key is down 432 // this link or if the shift key is down
431 case EditableLinkLiveWhenNotFocused: 433 case EditableLinkLiveWhenNotFocused:
432 return m_wasShiftKeyDownOnMouseDown || m_rootEditableElementForSelec tionOnMouseDown != rootEditableElement(); 434 return m_wasShiftKeyDownOnMouseDown || m_rootEditableElementForSelec tionOnMouseDown != rootEditableElement();
433 435
434 case EditableLinkOnlyLiveWithShiftKey: 436 case EditableLinkOnlyLiveWithShiftKey:
435 return m_wasShiftKeyDownOnMouseDown; 437 return m_wasShiftKeyDownOnMouseDown;
436 } 438 }
437 } 439 }
438 440
439 } 441 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/qt/fast/events/click-focus-anchor-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698