LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Apr 2006 09:32:44 +0000 (09:32 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Apr 2006 09:32:44 +0000 (09:32 +0000)
        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8105
          REGRESSION (NativeTextField): Option-delete deletes one space before the deleted word

        * fast/forms/input-text-option-delete-expected.checksum: Added.
        * fast/forms/input-text-option-delete-expected.png: Added.
        * fast/forms/input-text-option-delete-expected.txt: Added.
        * fast/forms/input-text-option-delete.html: Added.

WebKit:

        Reviewed by Maciej.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8105
          REGRESSION (NativeTextField): Option-delete deletes one space before the deleted word

        Test: fast/forms/input-text-option-delete.html

        * WebView/WebHTMLView.m:
        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Pass NO for
        smartDeleteOK. Smart deletion only applies to deleting a word at a time, and none of
        the callers of this function that delete a word at a time want smart deletion.
        (-[WebHTMLView deleteToEndOfLine:]): Fixed tiny formatting glitch.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13624 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/input-text-option-delete-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/input-text-option-delete-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/input-text-option-delete-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-text-option-delete.html [new file with mode: 0644]
WebKit/ChangeLog
WebKit/WebView/WebHTMLView.m

index ce7f2bd23a14ca77e2770dcdf675c4fb328a53df..5e9f0fd2c735cab3563048853c60f73ddbd27de7 100644 (file)
@@ -1,3 +1,13 @@
+2006-04-01  Darin Adler  <darin@apple.com>
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8105
+          REGRESSION (NativeTextField): Option-delete deletes one space before the deleted word
+
+        * fast/forms/input-text-option-delete-expected.checksum: Added.
+        * fast/forms/input-text-option-delete-expected.png: Added.
+        * fast/forms/input-text-option-delete-expected.txt: Added.
+        * fast/forms/input-text-option-delete.html: Added.
+
 2006-03-31  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by John.
diff --git a/LayoutTests/fast/forms/input-text-option-delete-expected.checksum b/LayoutTests/fast/forms/input-text-option-delete-expected.checksum
new file mode 100644 (file)
index 0000000..11c5b16
--- /dev/null
@@ -0,0 +1 @@
+58b2db429c3649f854b2b5a7a3eb4d14
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/input-text-option-delete-expected.png b/LayoutTests/fast/forms/input-text-option-delete-expected.png
new file mode 100644 (file)
index 0000000..94a13c3
Binary files /dev/null and b/LayoutTests/fast/forms/input-text-option-delete-expected.png differ
diff --git a/LayoutTests/fast/forms/input-text-option-delete-expected.txt b/LayoutTests/fast/forms/input-text-option-delete-expected.txt
new file mode 100644 (file)
index 0000000..f325c35
--- /dev/null
@@ -0,0 +1,24 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > DIV to 12 of #text > DIV
+EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > DIV to 12 of #text > DIV
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV to 5 of #text > DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock (anonymous) at (0,0) size 784x23
+        RenderTextField {INPUT} at (2,2) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {P} at (0,39) size 784x18
+        RenderText {TEXT} at (0,0) size 644x18
+          text run at (0,0) width 644: "Tests option-deleting a word. If the test succeeds, the word \"word\" should end up with a space after it."
+layer at (13,13) size 142x13
+  RenderBlock {DIV} at (3,3) size 142x13
+    RenderText {TEXT} at (1,0) size 30x13
+      text run at (1,0) width 30: "word "
+caret: position 5 of child 0 {TEXT} of document
diff --git a/LayoutTests/fast/forms/input-text-option-delete.html b/LayoutTests/fast/forms/input-text-option-delete.html
new file mode 100644 (file)
index 0000000..90e8752
--- /dev/null
@@ -0,0 +1,10 @@
+<input id="input" type="text" value="word another">
+<p>Tests option-deleting a word. If the test succeeds, the word "word" should end up with a space after it.</p>
+<script>
+var input = document.getElementById("input");
+input.focus();
+input.setSelectionRange(12, 12);
+if (window.eventSender) {
+    eventSender.keyDown(String.fromCharCode(127), ["altKey"]);
+}
+</script>
index d7a58da231464444da90bf80e3443fa963461ad3..62a4d66fe6b74a73d3e9fda32d2bb05bef9d9147 100644 (file)
@@ -1,3 +1,18 @@
+2006-04-01  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8105
+          REGRESSION (NativeTextField): Option-delete deletes one space before the deleted word
+
+        Test: fast/forms/input-text-option-delete.html
+
+        * WebView/WebHTMLView.m:
+        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Pass NO for
+        smartDeleteOK. Smart deletion only applies to deleting a word at a time, and none of
+        the callers of this function that delete a word at a time want smart deletion.
+        (-[WebHTMLView deleteToEndOfLine:]): Fixed tiny formatting glitch.
+
 2006-03-31  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Darin.
index 02c916c106943813ebef731f0623c5d5689eae4c..e61c92e17b0671e9f5644d7eab3acf7853859ab2 100644 (file)
@@ -4351,7 +4351,7 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 
     if (range == nil || [range collapsed] || ![self _shouldDeleteRange:range])
         return NO;
-    [self _deleteRange:range killRing:killRing prepend:NO smartDeleteOK:YES deletionAction:deletionAction];
+    [self _deleteRange:range killRing:killRing prepend:NO smartDeleteOK:NO deletionAction:deletionAction];
     return YES;
 }
 
@@ -4394,7 +4394,7 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 {
     // To match NSTextView, this command should delete the newline at the end of
     // a paragraph if you are at the end of a paragraph (like deleteToEndOfParagraph does below).
-    if(![self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary killRing:YES isTypingAction:NO])
+    if (![self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary killRing:YES isTypingAction:NO])
         [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:YES isTypingAction:NO];
 }