Changeset 21291 in webkit


Ignore:
Timestamp:
May 7, 2007 3:15:42 PM (17 years ago)
Author:
justing
Message:

LayoutTests:

Reviewed by darin


<rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date

  • editing/selection/4895428-1-expected.checksum: Added.
  • editing/selection/4895428-1-expected.png: Added.
  • editing/selection/4895428-1-expected.txt: Added.
  • editing/selection/4895428-1.html: Added.

WebCore:

Reviewed by darin


<rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date


The code in SelectionController::contains returned false
incorrectly if the selection end just after a table
and the position was inside that table.

  • editing/SelectionController.cpp: (WebCore::SelectionController::contains): Compare the position with the ends of the selection and then use Range::comparePoint.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21287 r21291  
     12007-05-07  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by darin
     4       
     5        <rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date
     6
     7        * editing/selection/4895428-1-expected.checksum: Added.
     8        * editing/selection/4895428-1-expected.png: Added.
     9        * editing/selection/4895428-1-expected.txt: Added.
     10        * editing/selection/4895428-1.html: Added.
     11
    1122007-05-07  Darin Adler  <darin@apple.com>
    213
  • trunk/WebCore/ChangeLog

    r21287 r21291  
     12007-05-07  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by darin
     4       
     5        <rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date
     6       
     7        The code in SelectionController::contains returned false
     8        incorrectly if the selection end just after a table
     9        and the position was inside that table.
     10
     11        * editing/SelectionController.cpp:
     12        (WebCore::SelectionController::contains): Compare the position with the
     13        ends of the selection and then use Range::comparePoint.
     14
    1152007-05-07  Darin Adler  <darin@apple.com>
    216
  • trunk/WebCore/editing/SelectionController.cpp

    r21194 r21291  
    10161016        return false;
    10171017   
    1018     Position pos(innerNode->renderer()->positionForPoint(result.localPoint()).deepEquivalent());
    1019     if (pos.isNull())
    1020         return false;
    1021 
    1022     Node *n = start().node();
    1023     while (n) {
    1024         if (n == pos.node()) {
    1025             if ((n == start().node() && pos.offset() < start().offset()) ||
    1026                 (n == end().node() && pos.offset() > end().offset())) {
    1027                 return false;
    1028             }
    1029             return true;
    1030         }
    1031         if (n == end().node())
    1032             break;
    1033         n = n->traverseNextNode();
    1034     }
    1035 
    1036    return false;
     1018    VisiblePosition visiblePos(innerNode->renderer()->positionForPoint(result.localPoint()));
     1019    if (visiblePos.isNull())
     1020        return false;
     1021   
     1022    // A selection doesn't contain it's endpoints.
     1023    if (visiblePos == m_sel.visibleStart() || visiblePos == m_sel.visibleEnd())
     1024        return false;
     1025       
     1026    RefPtr<Range> range = toRange();
     1027    ExceptionCode ec = 0;
     1028    Position p(visiblePos.deepEquivalent());
     1029    return range->comparePoint(p.node(), p.offset(), ec) == 0 && ec == 0;
    10371030}
    10381031
Note: See TracChangeset for help on using the changeset viewer.