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

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

Issue 1149373003: Remove Range.compareNode() as it is not in the spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updated isNodeFullyContained Created 5 years, 6 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
« Source/core/dom/Range.cpp ('K') | « Source/core/frame/UseCounter.cpp ('k') | no next file » | 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 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 if (element->isMouseFocusable()) 1651 if (element->isMouseFocusable())
1652 break; 1652 break;
1653 } 1653 }
1654 ASSERT(!element || element->isMouseFocusable()); 1654 ASSERT(!element || element->isMouseFocusable());
1655 1655
1656 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus 1656 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus
1657 // a node on mouse down if it's selected and inside a focused node. It will 1657 // a node on mouse down if it's selected and inside a focused node. It will
1658 // be focused if the user does a mouseup over it, however, because the 1658 // be focused if the user does a mouseup over it, however, because the
1659 // mouseup will set a selection inside it, which will call 1659 // mouseup will set a selection inside it, which will call
1660 // FrameSelection::setFocusedNodeIfNeeded. 1660 // FrameSelection::setFocusedNodeIfNeeded.
1661 if (element 1661 if (element && m_frame->selection().isRange()) {
1662 && m_frame->selection().isRange() 1662 if (m_frame->selection().toNormalizedRange()->isNodeFullyContained(*elem ent, IGNORE_EXCEPTION)
1663 && m_frame->selection().toNormalizedRange()->compareNode(element, IGNORE _EXCEPTION) == Range::NODE_INSIDE 1663 && element->isDescendantOf(m_frame->document()->focusedElement()))
1664 && element->isDescendantOf(m_frame->document()->focusedElement())) 1664 return false;
1665 return false; 1665 }
1666
1666 1667
1667 // Only change the focus when clicking scrollbars if it can transfered to a 1668 // Only change the focus when clicking scrollbars if it can transfered to a
1668 // mouse focusable node. 1669 // mouse focusable node.
1669 if (!element && targetedEvent.hitTestResult().scrollbar()) 1670 if (!element && targetedEvent.hitTestResult().scrollbar())
1670 return true; 1671 return true;
1671 1672
1672 if (Page* page = m_frame->page()) { 1673 if (Page* page = m_frame->page()) {
1673 // If focus shift is blocked, we eat the event. Note we should never 1674 // If focus shift is blocked, we eat the event. Note we should never
1674 // clear swallowEvent if the page already set it (e.g., by canceling 1675 // clear swallowEvent if the page already set it (e.g., by canceling
1675 // default behavior). 1676 // default behavior).
(...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after
3890 unsigned EventHandler::accessKeyModifiers() 3891 unsigned EventHandler::accessKeyModifiers()
3891 { 3892 {
3892 #if OS(MACOSX) 3893 #if OS(MACOSX)
3893 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3894 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3894 #else 3895 #else
3895 return PlatformEvent::AltKey; 3896 return PlatformEvent::AltKey;
3896 #endif 3897 #endif
3897 } 3898 }
3898 3899
3899 } // namespace blink 3900 } // namespace blink
OLDNEW
« Source/core/dom/Range.cpp ('K') | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698