Changeset 152198 in webkit


Ignore:
Timestamp:
Jun 28, 2013 5:09:09 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

An element with -webkit-user-select: all should be selected on single click
https://bugs.webkit.org/show_bug.cgi?id=117864

Reviewed by Darin Adler.

Source/WebCore:

Set m_mouseDownMayStartSelect true even when the node cannot start selection
if the node was inside an element with -webkit-user-select: all.

Test: editing/selection/user-select-all-with-single-click.html

  • page/EventHandler.cpp:

(WebCore::canMouseDownStartSelect):

LayoutTests:

Add tests for single clicking on an element with user-select: all.
We select the entire element regardless of whether the user had clicked on text or an image
to be consistent even though Firefox requires a double click on the latter case.

  • editing/selection/user-select-all-with-image-single-click-expected.txt: Added.
  • editing/selection/user-select-all-with-image-single-click.html: Added.
  • editing/selection/user-select-all-with-single-click-expected.txt: Added.
  • editing/selection/user-select-all-with-single-click.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152185 r152198  
     12013-06-28  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        An element with -webkit-user-select: all should be selected on single click
     4        https://bugs.webkit.org/show_bug.cgi?id=117864
     5
     6        Reviewed by Darin Adler.
     7
     8        Add tests for single clicking on an element with user-select: all.
     9        We select the entire element regardless of whether the user had clicked on text or an image
     10        to be consistent even though Firefox requires a double click on the latter case.
     11
     12        * editing/selection/user-select-all-with-image-single-click-expected.txt: Added.
     13        * editing/selection/user-select-all-with-image-single-click.html: Added.
     14        * editing/selection/user-select-all-with-single-click-expected.txt: Added.
     15        * editing/selection/user-select-all-with-single-click.html: Added.
     16
    1172013-06-28  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebCore/ChangeLog

    r152197 r152198  
     12013-06-28  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        An element with -webkit-user-select: all should be selected on single click
     4        https://bugs.webkit.org/show_bug.cgi?id=117864
     5
     6        Reviewed by Darin Adler.
     7
     8        Set m_mouseDownMayStartSelect true even when the node cannot start selection
     9        if the node was inside an element with -webkit-user-select: all.
     10
     11        Test: editing/selection/user-select-all-with-single-click.html
     12
     13        * page/EventHandler.cpp:
     14        (WebCore::canMouseDownStartSelect):
     15
    1162013-06-28  Ryosuke Niwa  <rniwa@webkit.org>
    217
  • trunk/Source/WebCore/dom/Position.h

    r150954 r152198  
    192192    static bool nodeIsUserSelectAll(const Node*);
    193193    static Node* rootUserSelectAllForNode(Node*);
     194#else
     195    static bool nodeIsUserSelectAll(const Node*) { return false; }
     196    static Node* rootUserSelectAllForNode(Node*) { return 0; }
    194197#endif
    195198    static ContainerNode* findParent(const Node*);
  • trunk/Source/WebCore/page/EventHandler.cpp

    r152149 r152198  
    641641        return true;
    642642
    643     if (!node->canStartSelection())
    644         return false;
    645 
    646     return true;
     643    return node->canStartSelection() || Position::nodeIsUserSelectAll(node);
    647644}
    648645
Note: See TracChangeset for help on using the changeset viewer.