| 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 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 if (element->isMouseFocusable()) | 2046 if (element->isMouseFocusable()) |
| 2047 break; | 2047 break; |
| 2048 } | 2048 } |
| 2049 ASSERT(!element || element->isMouseFocusable()); | 2049 ASSERT(!element || element->isMouseFocusable()); |
| 2050 | 2050 |
| 2051 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus | 2051 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus |
| 2052 // a node on mouse down if it's selected and inside a focused node. It will | 2052 // a node on mouse down if it's selected and inside a focused node. It will |
| 2053 // be focused if the user does a mouseup over it, however, because the | 2053 // be focused if the user does a mouseup over it, however, because the |
| 2054 // mouseup will set a selection inside it, which will call | 2054 // mouseup will set a selection inside it, which will call |
| 2055 // FrameSelection::setFocusedNodeIfNeeded. | 2055 // FrameSelection::setFocusedNodeIfNeeded. |
| 2056 if (element | 2056 if (element && m_frame->selection().isRange()) { |
| 2057 && m_frame->selection().isRange() | 2057 if (Range::isNodeFullySelected(element, m_frame->selection().toNormalize
dRange().get()) |
| 2058 && m_frame->selection().toNormalizedRange()->compareNode(element, IGNORE
_EXCEPTION) == Range::NODE_INSIDE | 2058 && element->isDescendantOf(m_frame->document()->focusedElement())) |
| 2059 && element->isDescendantOf(m_frame->document()->focusedElement())) | 2059 return false; |
| 2060 return false; | 2060 } |
| 2061 |
| 2061 | 2062 |
| 2062 // Only change the focus when clicking scrollbars if it can transfered to a | 2063 // Only change the focus when clicking scrollbars if it can transfered to a |
| 2063 // mouse focusable node. | 2064 // mouse focusable node. |
| 2064 if (!element && targetedEvent.hitTestResult().scrollbar()) | 2065 if (!element && targetedEvent.hitTestResult().scrollbar()) |
| 2065 return true; | 2066 return true; |
| 2066 | 2067 |
| 2067 if (Page* page = m_frame->page()) { | 2068 if (Page* page = m_frame->page()) { |
| 2068 // If focus shift is blocked, we eat the event. Note we should never | 2069 // If focus shift is blocked, we eat the event. Note we should never |
| 2069 // clear swallowEvent if the page already set it (e.g., by canceling | 2070 // clear swallowEvent if the page already set it (e.g., by canceling |
| 2070 // default behavior). | 2071 // default behavior). |
| (...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4170 unsigned EventHandler::accessKeyModifiers() | 4171 unsigned EventHandler::accessKeyModifiers() |
| 4171 { | 4172 { |
| 4172 #if OS(MACOSX) | 4173 #if OS(MACOSX) |
| 4173 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4174 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 4174 #else | 4175 #else |
| 4175 return PlatformEvent::AltKey; | 4176 return PlatformEvent::AltKey; |
| 4176 #endif | 4177 #endif |
| 4177 } | 4178 } |
| 4178 | 4179 |
| 4179 } // namespace blink | 4180 } // namespace blink |
| OLD | NEW |