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 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 if (element->isMouseFocusable()) | 1631 if (element->isMouseFocusable()) |
1632 break; | 1632 break; |
1633 } | 1633 } |
1634 ASSERT(!element || element->isMouseFocusable()); | 1634 ASSERT(!element || element->isMouseFocusable()); |
1635 | 1635 |
1636 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus | 1636 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus |
1637 // a node on mouse down if it's selected and inside a focused node. It will | 1637 // a node on mouse down if it's selected and inside a focused node. It will |
1638 // be focused if the user does a mouseup over it, however, because the | 1638 // be focused if the user does a mouseup over it, however, because the |
1639 // mouseup will set a selection inside it, which will call | 1639 // mouseup will set a selection inside it, which will call |
1640 // FrameSelection::setFocusedNodeIfNeeded. | 1640 // FrameSelection::setFocusedNodeIfNeeded. |
1641 if (element | 1641 if (element && m_frame->selection().isRange()) { |
1642 && m_frame->selection().isRange() | 1642 if (m_frame->selection().toNormalizedRange()->isNodeFullyContained(*elem
ent) |
1643 && m_frame->selection().toNormalizedRange()->compareNode(element, IGNORE
_EXCEPTION) == Range::NODE_INSIDE | 1643 && element->isDescendantOf(m_frame->document()->focusedElement())) |
1644 && element->isDescendantOf(m_frame->document()->focusedElement())) | 1644 return false; |
1645 return false; | 1645 } |
| 1646 |
1646 | 1647 |
1647 // Only change the focus when clicking scrollbars if it can transfered to a | 1648 // Only change the focus when clicking scrollbars if it can transfered to a |
1648 // mouse focusable node. | 1649 // mouse focusable node. |
1649 if (!element && targetedEvent.hitTestResult().scrollbar()) | 1650 if (!element && targetedEvent.hitTestResult().scrollbar()) |
1650 return true; | 1651 return true; |
1651 | 1652 |
1652 if (Page* page = m_frame->page()) { | 1653 if (Page* page = m_frame->page()) { |
1653 // If focus shift is blocked, we eat the event. Note we should never | 1654 // If focus shift is blocked, we eat the event. Note we should never |
1654 // clear swallowEvent if the page already set it (e.g., by canceling | 1655 // clear swallowEvent if the page already set it (e.g., by canceling |
1655 // default behavior). | 1656 // default behavior). |
(...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3922 unsigned EventHandler::accessKeyModifiers() | 3923 unsigned EventHandler::accessKeyModifiers() |
3923 { | 3924 { |
3924 #if OS(MACOSX) | 3925 #if OS(MACOSX) |
3925 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3926 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3926 #else | 3927 #else |
3927 return PlatformEvent::AltKey; | 3928 return PlatformEvent::AltKey; |
3928 #endif | 3929 #endif |
3929 } | 3930 } |
3930 | 3931 |
3931 } // namespace blink | 3932 } // namespace blink |
OLD | NEW |