| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |