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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 23461040: Selection should not set the cursor type to text over the explicitly set cursor type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 5e6ae7dc70028e6107ca404cd6dd90479e0ce145..fda0a28c0fea586fc515965833db6e7f350d248c 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -1118,13 +1118,6 @@ OptionalCursor EventHandler::selectCursor(const MouseEventWithHitTestResults& ev
bool horizontalText = !style || style->isHorizontalWritingMode();
const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor();
- // During selection, use an I-beam no matter what we're over.
- // If a drag may be starting or we're capturing mouse events for a particular node, don't treat this as a selection.
- if (m_mousePressed && m_mouseDownMayStartSelect
- && !m_mouseDownMayStartDrag
- && m_frame->selection().isCaretOrRange() && !m_capturingMouseEventsNode)
- return iBeam;
-
if (renderer) {
Cursor overrideCursor;
switch (renderer->getCursor(roundedIntPoint(event.localPoint()), overrideCursor)) {
@@ -1181,6 +1174,14 @@ OptionalCursor EventHandler::selectCursor(const MouseEventWithHitTestResults& ev
inResizer = layer->isPointInResizeControl(view->windowToContents(event.event().position()), ResizerForPointer);
}
}
+
+ // During selection, use an I-beam no matter what we're over.
+ // If a drag may be starting or we're capturing mouse events for a particular node, don't treat this as a selection.
+ if (m_mousePressed && m_mouseDownMayStartSelect
+ && !m_mouseDownMayStartDrag
+ && m_frame->selection().isCaretOrRange() && !m_capturingMouseEventsNode)
yosin_UTC9 2013/09/13 03:42:44 nit: Please align "&&" to m_mousePressed nit: Plea
+ return iBeam;
+
if ((editable || (renderer && renderer->isText() && node->canStartSelection())) && !inResizer && !scrollbar)
return iBeam;
return pointerCursor();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698