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

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: Patch for landing 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 | « LayoutTests/editing/caret/caret-type-for-user-select-none-expected.txt ('k') | 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 3a76fe38c87b71fff49668d7f09b69c8c675ac9d..f91e4781a8e47d3e0964f16b82fb2d5c2333a0c2 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -1105,13 +1105,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)) {
@@ -1168,6 +1161,16 @@ 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) {
+ return iBeam;
+ }
+
if ((editable || (renderer && renderer->isText() && node->canStartSelection())) && !inResizer && !scrollbar)
return iBeam;
return pointerCursor();
« no previous file with comments | « LayoutTests/editing/caret/caret-type-for-user-select-none-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698