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

Side by Side Diff: Source/core/input/EventHandler.cpp

Issue 1311623004: Make EventHandler to use VisibleSelection::toNormalizedEphemeralRange() instead of toNormalizedRange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T17:22:50 Created 5 years, 4 months 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
« no previous file with comments | « no previous file | Source/core/input/EventHandlerTest.cpp » ('j') | 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) 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 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 break; 1647 break;
1648 } 1648 }
1649 ASSERT(!element || element->isMouseFocusable()); 1649 ASSERT(!element || element->isMouseFocusable());
1650 1650
1651 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus 1651 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus
1652 // a node on mouse down if it's selected and inside a focused node. It will 1652 // a node on mouse down if it's selected and inside a focused node. It will
1653 // be focused if the user does a mouseup over it, however, because the 1653 // be focused if the user does a mouseup over it, however, because the
1654 // mouseup will set a selection inside it, which will call 1654 // mouseup will set a selection inside it, which will call
1655 // FrameSelection::setFocusedNodeIfNeeded. 1655 // FrameSelection::setFocusedNodeIfNeeded.
1656 if (element && m_frame->selection().isRange()) { 1656 if (element && m_frame->selection().isRange()) {
1657 if (m_frame->selection().toNormalizedRange()->isNodeFullyContained(*elem ent) 1657 // TODO(yosin) We should not create |Range| object for calling
1658 // |isNodeFullyContained()|.
1659 if (createRange(m_frame->selection().selection().toNormalizedEphemeralRa nge())->isNodeFullyContained(*element)
1658 && element->isDescendantOf(m_frame->document()->focusedElement())) 1660 && element->isDescendantOf(m_frame->document()->focusedElement()))
1659 return false; 1661 return false;
1660 } 1662 }
1661 1663
1662 1664
1663 // Only change the focus when clicking scrollbars if it can transfered to a 1665 // Only change the focus when clicking scrollbars if it can transfered to a
1664 // mouse focusable node. 1666 // mouse focusable node.
1665 if (!element && targetedEvent.hitTestResult().scrollbar()) 1667 if (!element && targetedEvent.hitTestResult().scrollbar())
1666 return true; 1668 return true;
1667 1669
(...skipping 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after
3989 unsigned EventHandler::accessKeyModifiers() 3991 unsigned EventHandler::accessKeyModifiers()
3990 { 3992 {
3991 #if OS(MACOSX) 3993 #if OS(MACOSX)
3992 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3994 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3993 #else 3995 #else
3994 return PlatformEvent::AltKey; 3996 return PlatformEvent::AltKey;
3995 #endif 3997 #endif
3996 } 3998 }
3997 3999
3998 } // namespace blink 4000 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698