Reviewed by harrison
<rdar://problem/
4765600>
REGRESSION: Mail.app: smart deletion of words does not work
* editing/deleting/smart-delete-003-expected.checksum: Added.
* editing/deleting/smart-delete-003-expected.png: Added.
* editing/deleting/smart-delete-003-expected.txt: Added.
* editing/deleting/smart-delete-003.html: Added.
* editing/deleting/smart-delete-004-expected.checksum: Added.
* editing/deleting/smart-delete-004-expected.png: Added.
* editing/deleting/smart-delete-004-expected.txt: Added.
* editing/deleting/smart-delete-004.html: Added.
WebKit:
Reviewed by harrison
<rdar://problem/
4765600>
REGRESSION: Mail.app: smart deletion of words does not work
Regressed when we pushed selecion expansion down into WebCore. It's OK
to try a smart delete from _deleteWithDirection:, which is called by
deleteFoward: and deleteBackward: if the current selection is a
range.
* WebView/WebHTMLView.m:
(-[NSArray _deleteWithDirection:granularity:killRing:isTypingAction:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17113
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-17 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <rdar://problem/4765600>
+ REGRESSION: Mail.app: smart deletion of words does not work
+
+ * editing/deleting/smart-delete-003-expected.checksum: Added.
+ * editing/deleting/smart-delete-003-expected.png: Added.
+ * editing/deleting/smart-delete-003-expected.txt: Added.
+ * editing/deleting/smart-delete-003.html: Added.
+ * editing/deleting/smart-delete-004-expected.checksum: Added.
+ * editing/deleting/smart-delete-004-expected.png: Added.
+ * editing/deleting/smart-delete-004-expected.txt: Added.
+ * editing/deleting/smart-delete-004.html: Added.
+
2006-10-18 Adam Roben <aroben@apple.com>
Reviewed by Maciej.
--- /dev/null
+63468c9c237c04e458fae3bbc7a1c2a6
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 768x36
+ text run at (0,0) width 392: "This tests deleting a selection created with a word granularity. "
+ text run at (392,0) width 348: "To run it manually, double click on 'bar' and hit delete. "
+ text run at (740,0) width 28: "You"
+ text run at (0,18) width 125: "should see 'foo bar'."
+ RenderBlock {DIV} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 47x18
+ text run at (0,0) width 47: "foo baz"
+caret: position 3 of child 0 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<p>This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit delete. You should see 'foo bar'.</p>
+<div id="div" contenteditable="true">foo bar baz</div>
+
+<script>
+if (window.layoutTestController) {
+ var div = document.getElementById("div");
+ var sel = window.getSelection();
+
+ sel.setPosition(div, 0);
+ sel.modify("move", "forward", "word");
+ sel.modify("move", "forward", "word");
+ sel.modify("extend", "backward", "word");
+ textInputController.doCommand("deleteBackward:");
+}
+</script>
--- /dev/null
+cdfd56093cf3801b073bd1297242add8
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 745x36
+ text run at (0,0) width 392: "This tests deleting a selection created with a word granularity. "
+ text run at (392,0) width 353: "To run it manually, double click on 'bar' and hit forward"
+ text run at (0,18) width 45: "delete. "
+ text run at (45,18) width 157: "You should see 'foo bar'."
+ RenderBlock {DIV} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 47x18
+ text run at (0,0) width 47: "foo baz"
+caret: position 3 of child 0 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<p>This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit forward delete. You should see 'foo bar'.</p>
+<div id="div" contenteditable="true">foo bar baz</div>
+
+<script>
+if (window.layoutTestController) {
+ var div = document.getElementById("div");
+ var sel = window.getSelection();
+
+ sel.setPosition(div, 0);
+ sel.modify("move", "forward", "word");
+ sel.modify("move", "forward", "word");
+ sel.modify("extend", "backward", "word");
+ textInputController.doCommand("deleteForward:");
+}
+</script>
+2006-10-17 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <rdar://problem/4765600>
+ REGRESSION: Mail.app: smart deletion of words does not work
+
+ Regressed when we pushed selecion expansion down into WebCore. It's OK
+ to try a smart delete from _deleteWithDirection:, which is called by
+ deleteFoward: and deleteBackward: if the current selection is a
+ range.
+
+ * WebView/WebHTMLView.m:
+ (-[NSArray _deleteWithDirection:granularity:killRing:isTypingAction:]):
+
2006-10-13 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
if (![self _canEdit])
return NO;
- DOMRange *range;
+ DOMRange *range = [self _selectedRange];
WebDeletionAction deletionAction = deleteSelectionAction;
+ BOOL smartDeleteOK = NO;
+
if ([self _hasSelection]) {
- range = [self _selectedRange];
+ smartDeleteOK = YES;
if (isTypingAction)
deletionAction = deleteKeyAction;
} else {
- range = [self _selectedRange];
switch (direction) {
case WebBridgeSelectForward:
case WebBridgeSelectRight:
if (range == nil)
return NO;
- [self _deleteRange:range killRing:killRing prepend:NO smartDeleteOK:NO deletionAction:deletionAction granularity:granularity];
+ [self _deleteRange:range killRing:killRing prepend:NO smartDeleteOK:smartDeleteOK deletionAction:deletionAction granularity:granularity];
return YES;
}