Changeset 145871 in webkit


Ignore:
Timestamp:
Mar 14, 2013 9:25:27 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Backspace/delete at start of table cell shouldn't step out of cell
https://bugs.webkit.org/show_bug.cgi?id=35372

Patch by Shezan Baig <Shezan Baig> on 2013-03-14
Reviewed by Ryosuke Niwa.

Source/WebCore:

Make Delete and ForwardDelete commands be no-ops if we are at the first
position or last position of a table cell respectively.

Tests: editing/deleting/backspace-at-table-cell-beginning.html

editing/deleting/forward-delete-at-table-cell-ending.html

  • editing/TypingCommand.cpp:

(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):

LayoutTests:

  • editing/deleting/backspace-at-table-cell-beginning-expected.txt: Added.
  • editing/deleting/backspace-at-table-cell-beginning.html: Added.
  • editing/deleting/forward-delete-at-table-cell-ending-expected.txt: Added.
  • editing/deleting/forward-delete-at-table-cell-ending.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145870 r145871  
     12013-03-14  Shezan Baig  <sbaig1@bloomberg.net>
     2
     3        Backspace/delete at start of table cell shouldn't step out of cell
     4        https://bugs.webkit.org/show_bug.cgi?id=35372
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * editing/deleting/backspace-at-table-cell-beginning-expected.txt: Added.
     9        * editing/deleting/backspace-at-table-cell-beginning.html: Added.
     10        * editing/deleting/forward-delete-at-table-cell-ending-expected.txt: Added.
     11        * editing/deleting/forward-delete-at-table-cell-ending.html: Added.
     12
    1132013-03-14  Xidorn Quan  <quanxunzhen@gmail.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r145870 r145871  
     12013-03-14  Shezan Baig  <sbaig1@bloomberg.net>
     2
     3        Backspace/delete at start of table cell shouldn't step out of cell
     4        https://bugs.webkit.org/show_bug.cgi?id=35372
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Make Delete and ForwardDelete commands be no-ops if we are at the first
     9        position or last position of a table cell respectively.
     10
     11        Tests: editing/deleting/backspace-at-table-cell-beginning.html
     12               editing/deleting/forward-delete-at-table-cell-ending.html
     13
     14        * editing/TypingCommand.cpp:
     15        (WebCore::TypingCommand::deleteKeyPressed):
     16        (WebCore::TypingCommand::forwardDeleteKeyPressed):
     17
    1182013-03-14  Xidorn Quan  <quanxunzhen@gmail.com>
    219
  • trunk/Source/WebCore/editing/TypingCommand.cpp

    r144911 r145871  
    466466
    467467        VisiblePosition visibleStart(endingSelection().visibleStart());
    468         // If we have a caret selection on an empty cell, we have nothing to do.
    469         if (isEmptyTableCell(visibleStart.deepEquivalent().containerNode()))
     468        // If we have a caret selection at the beginning of a cell, we have nothing to do.
     469        Node* enclosingTableCell = enclosingNodeOfType(visibleStart.deepEquivalent(), &isTableCell);
     470        if (enclosingTableCell && visibleStart == firstPositionInNode(enclosingTableCell))
    470471            return;
    471472
     
    555556        Position downstreamEnd = endingSelection().end().downstream();
    556557        VisiblePosition visibleEnd = endingSelection().visibleEnd();
    557         if (isEmptyTableCell(visibleEnd.deepEquivalent().containerNode()))
     558        Node* enclosingTableCell = enclosingNodeOfType(visibleEnd.deepEquivalent(), &isTableCell);
     559        if (enclosingTableCell && visibleEnd == lastPositionInNode(enclosingTableCell))
    558560            return;
    559561        if (visibleEnd == endOfParagraph(visibleEnd))
Note: See TracChangeset for help on using the changeset viewer.