|Date:||04-May-2012 at 23:55||Lines Added:||42|
|Repository:||http://svn.webkit.org/repository/webkit/trunk /trunk||Lines Removed:||3|
|Commit Comment:||REGRESSION: Cursor jumps to the first line after deleting the last word. https://bugs.webkit.org/show_bug.cgi?id=85334 <rdar://problem/11210059>
Reviewed by Ryosuke Niwa.
This regression was introduced with the work to remove redundant divs.
When we decide to remove a DIV, we need to adjust the selection, if it is
expressed in terms of the node being removed. The new position was computed
using updatePositionForNodeRemoval that was not designed for the case where we
remove preserving children.
This patch adds a new method to CompositeEditCommand to do this properly.
(WebCore::CompositeEditCommand::isRemovableBlock): Code clenup.
(WebCore::DeleteSelectionCommand::removeRedundantBlocks): Uses updatePositionForNodeRemovalPreservingChildren.
* editing/deleting/delete-word-from-unstyled-div-expected.txt: Added.
* editing/deleting/delete-word-from-unstyled-div.html: Added.
Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.