Changeset 157944 in webkit


Ignore:
Timestamp:
Oct 24, 2013 12:18:30 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[contenteditable] Content after non-editable element disappears when merging lines using backspace
https://bugs.webkit.org/show_bug.cgi?id=122748

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-10-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

In case of paragraph merging after deletion if second paragraph
contains non-editable element, then content after the non-editable
element(including non-editable element) will be removed while the
content before the element will be merged with the first paragraph.
This happens becasue endOfParagraphToMove calculation in merging function
stop at editing boundary so endOfParagraphToMove becomes position just
before non-editable content.
With this patch now endOfParagraphToMove is calculated by skipping
over the non-editable element.

Test: editing/deleting/merge-paragraph-contatining-noneditable.html

  • editing/DeleteSelectionCommand.cpp:

(WebCore::DeleteSelectionCommand::mergeParagraphs): use CanSkipOverEditingBoundary
condition while calculating endOfParagraphToMove.

LayoutTests:

Adding test to verify that on merging the paragraph containing
non-editable element does not cause loss of non-editable content after
merging.

  • editing/deleting/merge-paragraph-contatining-noneditable-expected.txt: Added.
  • editing/deleting/merge-paragraph-contatining-noneditable.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157941 r157944  
     12013-10-24  Santosh Mahto  <santosh.ma@samsung.com>
     2
     3        [contenteditable] Content after non-editable element disappears when merging lines using backspace
     4        https://bugs.webkit.org/show_bug.cgi?id=122748
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Adding test to verify that on merging the paragraph containing
     9        non-editable element does not cause loss of non-editable content after
     10        merging.
     11
     12        * editing/deleting/merge-paragraph-contatining-noneditable-expected.txt: Added.
     13        * editing/deleting/merge-paragraph-contatining-noneditable.html: Added.
     14
    1152013-10-24  Alexey Proskuryakov  <ap@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r157942 r157944  
     12013-10-24  Santosh Mahto  <santosh.ma@samsung.com>
     2
     3        [contenteditable] Content after non-editable element disappears when merging lines using backspace
     4        https://bugs.webkit.org/show_bug.cgi?id=122748
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        In case of paragraph merging after deletion if second paragraph
     9        contains non-editable element, then content after the non-editable
     10        element(including non-editable element) will be removed while the
     11        content before the element will be merged with the first paragraph.
     12        This happens becasue endOfParagraphToMove calculation in merging function
     13        stop at editing boundary so endOfParagraphToMove becomes position just
     14        before non-editable content.
     15        With this patch now endOfParagraphToMove is calculated by skipping
     16        over the non-editable element.
     17
     18        Test: editing/deleting/merge-paragraph-contatining-noneditable.html
     19
     20        * editing/DeleteSelectionCommand.cpp:
     21        (WebCore::DeleteSelectionCommand::mergeParagraphs): use CanSkipOverEditingBoundary
     22        condition while calculating endOfParagraphToMove.
     23
    1242013-10-24  Antoine Quint  <graouts@apple.com>
    225
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r157373 r157944  
    638638        return;
    639639       
    640     VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove);
     640    VisiblePosition endOfParagraphToMove = endOfParagraph(startOfParagraphToMove, CanSkipOverEditingBoundary);
    641641   
    642642    if (mergeDestination == endOfParagraphToMove)
Note: See TracChangeset for help on using the changeset viewer.