Changeset 55752 in webkit


Ignore:
Timestamp:
Mar 9, 2010 3:41:38 PM (14 years ago)
Author:
ojan@chromium.org
Message:

2010-03-03 Ojan Vafai <ojan@chromium.org>

Reviewed by Adam Barth.

undo after smartdelete should select the deleted space
https://bugs.webkit.org/show_bug.cgi?id=35713

  • editing/undo/undo-smart-delete-reversed-selection-expected.txt: Added.
  • editing/undo/undo-smart-delete-reversed-selection.html: Added.
  • editing/undo/undo-smart-delete-word-expected.txt: Added.
  • editing/undo/undo-smart-delete-word.html: Added.

2010-03-03 Ojan Vafai <ojan@chromium.org>

Reviewed by Adam Barth.

undo after smartdelete should select the deleted space
https://bugs.webkit.org/show_bug.cgi?id=35713

TextEdit behavior is to select the deleted space after a smartdelete.

Tests: editing/undo/undo-smart-delete-reversed-selection.html

editing/undo/undo-smart-delete-word.html

  • editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::setStartingSelectionOnSmartDelete): (WebCore::DeleteSelectionCommand::initializePositionData):
  • editing/DeleteSelectionCommand.h:
  • editing/VisibleSelection.cpp: (WebCore::VisibleSelection::setWithoutValidation): This assert looks bogus to me. undo-smart-delete-reversed-selection.html hits it but not as a result of the other changes in this patch. The granularity when deleting after making a wordgranularity selection is wordgranularity, not charactergranularity.
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55748 r55752  
     12010-03-03  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        undo after smartdelete should select the deleted space
     6        https://bugs.webkit.org/show_bug.cgi?id=35713
     7
     8        * editing/undo/undo-smart-delete-reversed-selection-expected.txt: Added.
     9        * editing/undo/undo-smart-delete-reversed-selection.html: Added.
     10        * editing/undo/undo-smart-delete-word-expected.txt: Added.
     11        * editing/undo/undo-smart-delete-word.html: Added.
     12
    1132010-03-09  Anton Muhin  <antonm@chromium.org>
    214
  • trunk/WebCore/ChangeLog

    r55747 r55752  
     12010-03-03  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        undo after smartdelete should select the deleted space
     6        https://bugs.webkit.org/show_bug.cgi?id=35713
     7
     8        TextEdit behavior is to select the deleted space after a smartdelete.
     9
     10        Tests: editing/undo/undo-smart-delete-reversed-selection.html
     11               editing/undo/undo-smart-delete-word.html
     12
     13        * editing/DeleteSelectionCommand.cpp:
     14        (WebCore::DeleteSelectionCommand::setStartingSelectionOnSmartDelete):
     15        (WebCore::DeleteSelectionCommand::initializePositionData):
     16        * editing/DeleteSelectionCommand.h:
     17        * editing/VisibleSelection.cpp:
     18        (WebCore::VisibleSelection::setWithoutValidation):
     19        This assert looks bogus to me. undo-smart-delete-reversed-selection.html hits it
     20        but not as a result of the other changes in this patch. The granularity when
     21        deleting after making a wordgranularity selection is wordgranularity, not charactergranularity.
     22
    1232010-03-09  Steve Falkenburg  <sfalken@apple.com>
    224
  • trunk/WebCore/editing/DeleteSelectionCommand.cpp

    r53809 r55752  
    162162}
    163163
     164void DeleteSelectionCommand::setStartingSelectionOnSmartDelete(Position& start, Position& end)
     165{
     166    VisiblePosition newBase;
     167    VisiblePosition newExtent;
     168    if (startingSelection().isBaseFirst()) {
     169        newBase = start;
     170        newExtent = end;
     171    } else {
     172        newBase = end;
     173        newExtent = start;       
     174    }
     175    setStartingSelection(VisibleSelection(newBase, newExtent));           
     176}
     177   
    164178void DeleteSelectionCommand::initializePositionData()
    165179{
     
    231245            m_downstreamStart = pos.downstream();
    232246            m_leadingWhitespace = m_upstreamStart.leadingWhitespacePosition(visiblePos.affinity());
     247
     248            setStartingSelectionOnSmartDelete(m_upstreamStart, m_upstreamEnd);
    233249        }
    234250       
     
    242258            m_downstreamEnd = pos.downstream();
    243259            m_trailingWhitespace = m_downstreamEnd.trailingWhitespacePosition(VP_DEFAULT_AFFINITY);
     260
     261            setStartingSelectionOnSmartDelete(m_downstreamStart, m_downstreamEnd);
    244262        }
    245263    }
  • trunk/WebCore/editing/DeleteSelectionCommand.h

    r43154 r55752  
    5252
    5353    void initializeStartEnd(Position&, Position&);
     54    void setStartingSelectionOnSmartDelete(Position&, Position&);
    5455    void initializePositionData();
    5556    void saveTypingStyleState();
  • trunk/WebCore/editing/VisibleSelection.cpp

    r52220 r55752  
    442442    ASSERT(base != extent);
    443443    ASSERT(m_affinity == DOWNSTREAM);
    444     ASSERT(m_granularity == CharacterGranularity);
    445444    m_base = base;
    446445    m_extent = extent;
Note: See TracChangeset for help on using the changeset viewer.