OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 // The layout needs to be up to date to determine if an element is focus
able. | 2027 // The layout needs to be up to date to determine if an element is focus
able. |
2028 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 2028 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
2029 | 2029 |
2030 // Blur current focus node when a link/button is clicked; this | 2030 // Blur current focus node when a link/button is clicked; this |
2031 // is expected by some sites that rely on onChange handlers running | 2031 // is expected by some sites that rely on onChange handlers running |
2032 // from form fields before the button click is processed. | 2032 // from form fields before the button click is processed. |
2033 Node* node = m_nodeUnderMouse.get(); | 2033 Node* node = m_nodeUnderMouse.get(); |
2034 | 2034 |
2035 // Walk up the DOM tree to search for a node to focus. | 2035 // Walk up the DOM tree to search for a node to focus. |
2036 while (node) { | 2036 while (node) { |
2037 if (node->isMouseFocusable()) { | 2037 if (node->isFocusable()) { |
2038 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we
don't focus a | 2038 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we
don't focus a |
2039 // node on mouse down if it's selected and inside a focused node
. It will be | 2039 // node on mouse down if it's selected and inside a focused node
. It will be |
2040 // focused if the user does a mouseup over it, however, because
the mouseup | 2040 // focused if the user does a mouseup over it, however, because
the mouseup |
2041 // will set a selection inside it, which will call setFocuseNode
IfNeeded. | 2041 // will set a selection inside it, which will call setFocuseNode
IfNeeded. |
2042 Node* n = node->isShadowRoot() ? toShadowRoot(node)->host() : no
de; | 2042 Node* n = node->isShadowRoot() ? toShadowRoot(node)->host() : no
de; |
2043 if (m_frame->selection()->isRange() | 2043 if (m_frame->selection()->isRange() |
2044 && m_frame->selection()->toNormalizedRange()->compareNode(n,
IGNORE_EXCEPTION) == Range::NODE_INSIDE | 2044 && m_frame->selection()->toNormalizedRange()->compareNode(n,
IGNORE_EXCEPTION) == Range::NODE_INSIDE |
2045 && n->isDescendantOf(m_frame->document()->focusedElement())) | 2045 && n->isDescendantOf(m_frame->document()->focusedElement())) |
2046 return true; | 2046 return true; |
2047 | 2047 |
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3834 unsigned EventHandler::accessKeyModifiers() | 3834 unsigned EventHandler::accessKeyModifiers() |
3835 { | 3835 { |
3836 #if OS(DARWIN) | 3836 #if OS(DARWIN) |
3837 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3837 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3838 #else | 3838 #else |
3839 return PlatformEvent::AltKey; | 3839 return PlatformEvent::AltKey; |
3840 #endif | 3840 #endif |
3841 } | 3841 } |
3842 | 3842 |
3843 } // namespace WebCore | 3843 } // namespace WebCore |
OLD | NEW |