Changeset 156635 in webkit


Ignore:
Timestamp:
Sep 30, 2013 12:12:44 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

user-select: none cursor turns to I-beam on mouse dragging
https://bugs.webkit.org/show_bug.cgi?id=90159

Patch by Vani Hegde <vani.hegde@samsung.com> on 2013-09-30
Reviewed by Ryosuke Niwa.

Source/WebCore:

When tried to select some text in an area that has style
cursor:default set, cursor type changes to text cursor ignoring
the cursor style that is explicitly set.

When the cursor style is explicitly set as default (or something else),
we should not change it to text cursor no matter what we are over
or what operation we are performing (be it hovering over the text
or selecting the text).

During text selection, changing the cursor type to text only when
there is no explicit cursor type set fixes the issue.

Test: editing/caret/selection-with-caret-type-progress.html

  • page/EventHandler.cpp:

(WebCore::EventHandler::selectCursor):
During selection, set the cursor style to text only if there is no
explicit cursor style set.

LayoutTests:

Test case added to verify that explicitly set cursor style
is retained on performing text selection.

  • editing/caret/selection-with-caret-type-progress-expected.txt: Added.
  • editing/caret/selection-with-caret-type-progress.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156619 r156635  
     12013-09-30  Vani Hegde  <vani.hegde@samsung.com>
     2
     3        user-select: none cursor turns to I-beam on mouse dragging
     4        https://bugs.webkit.org/show_bug.cgi?id=90159
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Test case added to verify that explicitly set cursor style
     9        is retained on performing text selection.
     10
     11        * editing/caret/selection-with-caret-type-progress-expected.txt: Added.
     12        * editing/caret/selection-with-caret-type-progress.html: Added.
     13
    1142013-09-29  Philip Rogers  <pdr@google.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r156633 r156635  
     12013-09-30  Vani Hegde  <vani.hegde@samsung.com>
     2
     3        user-select: none cursor turns to I-beam on mouse dragging
     4        https://bugs.webkit.org/show_bug.cgi?id=90159
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        When tried to select some text in an area that has style
     9        cursor:default set, cursor type changes to text cursor ignoring
     10        the cursor style that is explicitly set.
     11
     12        When the cursor style is explicitly set as default (or something else),
     13        we should not change it to text cursor no matter what we are over
     14        or what operation we are performing (be it hovering over the text
     15        or selecting the text).
     16
     17        During text selection, changing the cursor type to text only when
     18        there is no explicit cursor type set fixes the issue.
     19
     20        Test: editing/caret/selection-with-caret-type-progress.html
     21
     22        * page/EventHandler.cpp:
     23        (WebCore::EventHandler::selectCursor):
     24        During selection, set the cursor style to text only if there is no
     25        explicit cursor style set.
     26
    1272013-09-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    228
  • trunk/Source/WebCore/page/EventHandler.cpp

    r156622 r156635  
    13041304#endif
    13051305
    1306     // During selection, use an I-beam no matter what we're over.
    1307     // If a drag may be starting or we're capturing mouse events for a particular node, don't treat this as a selection.
    1308     if (m_mousePressed && m_mouseDownMayStartSelect
    1309 #if ENABLE(DRAG_SUPPORT)
    1310         && !m_mouseDownMayStartDrag
    1311 #endif
    1312         && m_frame.selection().isCaretOrRange() && !m_capturingMouseEventsNode)
    1313         return iBeam;
    1314 
    13151306    if (renderer) {
    13161307        Cursor overrideCursor;
     
    13741365            }
    13751366        }
     1367
     1368        // During selection, use an I-beam regardless of the content beneath the cursor when cursor style is not explicitly specified.
     1369        // If a drag may be starting or we're capturing mouse events for a particular node, don't treat this as a selection.
     1370        if (m_mousePressed && m_mouseDownMayStartSelect
     1371#if ENABLE(DRAG_SUPPORT)
     1372            && !m_mouseDownMayStartDrag
     1373#endif
     1374            && m_frame.selection().isCaretOrRange()
     1375            && !m_capturingMouseEventsNode) {
     1376            return iBeam;
     1377        }
     1378
    13761379        if ((editable || (renderer && renderer->isText() && node->canStartSelection())) && !inResizer && !result.scrollbar())
    13771380            return iBeam;
Note: See TracChangeset for help on using the changeset viewer.