LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Mar 2006 05:12:24 +0000 (05:12 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Mar 2006 05:12:24 +0000 (05:12 +0000)
        Reviewed by darin

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=7059>
        TinyMCE: Select All + delete sends you Back intsead of deleting

        * editing/resources/select-all-iframe-src.html: Added.
        * editing/selection/select-all-iframe-expected.checksum: Added.
        * editing/selection/select-all-iframe-expected.png: Added.
        * editing/selection/select-all-iframe-expected.txt: Added.
        * editing/selection/select-all-iframe.html: Added.

WebCore:

        Reviewed by darin

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=7059>
        TinyMCE: Select All + delete sends you Back intsead of deleting

        * page/Frame.cpp:
        (WebCore::Frame::selectFrameElementInParentIfFullySelected):

WebKitTools:

        Reviewed by darin

        Give the events that eventSender sends a unique eventNumber

        * DumpRenderTree/DumpRenderTree.m:
        (-[EventSendingController mouseDown]):
        (-[EventSendingController mouseUp]):
        (-[EventSendingController mouseMoveToX:Y:]):

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

LayoutTests/ChangeLog
LayoutTests/editing/resources/select-all-iframe-src.html [new file with mode: 0644]
LayoutTests/editing/selection/select-all-iframe-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/select-all-iframe-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/select-all-iframe-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-all-iframe.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/Frame.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m

index 840856c..a2a47a3 100644 (file)
@@ -1,3 +1,16 @@
+2006-03-01  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by darin
+        
+        <http://bugzilla.opendarwin.org/show_bug.cgi?id=7059>
+        TinyMCE: Select All + delete sends you Back intsead of deleting
+
+        * editing/resources/select-all-iframe-src.html: Added.
+        * editing/selection/select-all-iframe-expected.checksum: Added.
+        * editing/selection/select-all-iframe-expected.png: Added.
+        * editing/selection/select-all-iframe-expected.txt: Added.
+        * editing/selection/select-all-iframe.html: Added.
+
 2006-03-01  David Harrison  <harrison@apple.com>
 
         Updated test case after improving list deletion.
diff --git a/LayoutTests/editing/resources/select-all-iframe-src.html b/LayoutTests/editing/resources/select-all-iframe-src.html
new file mode 100644 (file)
index 0000000..361e7dc
--- /dev/null
@@ -0,0 +1,27 @@
+<script src=../editing.js language="JavaScript" type="text/JavaScript"></script>
+<script>
+function editingTest() {
+    if (!window.layoutTestController)
+        return;
+    
+    window.layoutTestController.waitUntilDone();
+    
+    // Give focus to the subframe so that Select All will operate on it, and not the main frame.
+    eventSender.mouseMoveTo(50, 50);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+    
+    selectAllCommand();
+    deleteCommand();
+    
+    window.layoutTestController.notifyDone();
+}
+</script>
+<body bgcolor="lightyellow" contenteditable="true">
+<div id="test">hello world</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/select-all-iframe-expected.checksum b/LayoutTests/editing/selection/select-all-iframe-expected.checksum
new file mode 100644 (file)
index 0000000..01598cd
--- /dev/null
@@ -0,0 +1 @@
+8a7cca3da1a9875fbdb6043285ec6c70
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/select-all-iframe-expected.png b/LayoutTests/editing/selection/select-all-iframe-expected.png
new file mode 100644 (file)
index 0000000..66984bc
Binary files /dev/null and b/LayoutTests/editing/selection/select-all-iframe-expected.png differ
diff --git a/LayoutTests/editing/selection/select-all-iframe-expected.txt b/LayoutTests/editing/selection/select-all-iframe-expected.txt
new file mode 100644 (file)
index 0000000..7f6d9ca
--- /dev/null
@@ -0,0 +1,54 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 4 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document 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 784x168
+        RenderPartObject {IFRAME} at (0,0) size 300x150
+          layer at (0,0) size 300x150
+            RenderCanvas at (0,0) size 300x150
+          layer at (0,0) size 300x150
+            RenderBlock {HTML} at (0,0) size 300x150
+              RenderBody {BODY} at (8,8) size 284x134 [bgcolor=#FFFFE0]
+                RenderBlock {DIV} at (0,0) size 284x18
+                  RenderBR {BR} at (0,0) size 0x18
+        RenderBR {BR} at (0,0) size 0x0
+        RenderBR {BR} at (0,150) size 0x18
+      RenderBlock {P} at (0,184) size 784x36
+        RenderInline {B} at (0,0) size 664x18
+          RenderText {TEXT} at (0,0) size 664x18
+            text run at (0,0) width 491: "This test uses the eventSender to do a mouse click to focus the subframe. "
+            text run at (491,0) width 173: "It won't run interactively."
+        RenderText {TEXT} at (664,0) size 723x36
+          text run at (664,0) width 4: " "
+          text run at (668,0) width 55: "To run it"
+          text run at (0,18) width 353: "manually, click on the iframe, Select All, then hit delete."
+      RenderBlock (anonymous) at (0,236) size 784x54
+        RenderText {TEXT} at (0,0) size 779x54
+          text run at (0,0) width 769: "Selecting all the content in a contenteditable iframe should select the iframe itself (to help the user delete the iframe) only if"
+          text run at (0,18) width 217: "the iframe is in an editable region. "
+          text run at (217,18) width 423: "This test loads ../resources/select-all-iframe-src.html into an iframe. "
+          text run at (640,18) width 139: "That file does a Select"
+          text run at (0,36) width 86: "All + Delete. "
+          text run at (86,36) width 172: "Two things should happen:"
+      RenderBlock {UL} at (0,306) size 784x54
+        RenderListItem {LI} at (40,0) size 744x36
+          RenderListMarker at (0,0) size 0x14
+          RenderText {TEXT} at (0,0) size 731x36
+            text run at (0,0) width 451: "The Select All operation should not select the iframe, only it's contents. "
+            text run at (451,0) width 280: "The results of the Select All will be apparent"
+            text run at (0,18) width 450: "from the delegate messages that DumpRenderTree receives and dumps."
+        RenderListItem {LI} at (40,36) size 744x18
+          RenderListMarker at (0,0) size 0x14
+          RenderText {TEXT} at (0,0) size 336x18
+            text run at (0,0) width 336: "The contents of the editable iframe should be deleted."
diff --git a/LayoutTests/editing/selection/select-all-iframe.html b/LayoutTests/editing/selection/select-all-iframe.html
new file mode 100644 (file)
index 0000000..6f31321
--- /dev/null
@@ -0,0 +1,9 @@
+
+<iframe id="iframe" src="../resources/select-all-iframe-src.html"></iframe><br><br>
+<p><b>This test uses the eventSender to do a mouse click to focus the subframe.  It won't run interactively.</b>  To run it manually, click on the iframe, Select All, then hit delete.</p>
+Selecting all the content in a contenteditable iframe should select the iframe itself (to help the user delete the iframe) only if the iframe is in an editable region.  This test loads ../resources/select-all-iframe-src.html into an iframe.  That file does a Select All + Delete.  Two things should happen:
+
+<ul>
+<li>The Select All operation should not select the iframe, only it's contents.  The results of the Select All will be apparent from the delegate messages that DumpRenderTree receives and dumps.</li>
+<li>The contents of the editable iframe should be deleted.</li>
+</ul>
index 38f708d..5d42a17 100644 (file)
@@ -1,3 +1,13 @@
+2006-03-01  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by darin
+        
+        <http://bugzilla.opendarwin.org/show_bug.cgi?id=7059>
+        TinyMCE: Select All + delete sends you Back intsead of deleting
+
+        * page/Frame.cpp:
+        (WebCore::Frame::selectFrameElementInParentIfFullySelected):
+
 2006-03-01  David Harrison  <harrison@apple.com>
 
         Reviewed by Justin.
index c1f768e..8926915 100644 (file)
@@ -2525,6 +2525,10 @@ void Frame::selectFrameElementInParentIfFullySelected()
     NodeImpl *ownerElementParent = ownerElement->parentNode();
     if (!ownerElementParent)
         return;
+        
+    // This method's purpose is it to make it easier to select iframes (in order to delete them).  Don't do anything if the iframe isn't deletable.
+    if (!ownerElementParent->isContentEditable())
+        return;
 
     // Create compute positions before and after the element.
     unsigned ownerElementNodeIndex = ownerElement->nodeIndex();
index b7adc38..03b616c 100644 (file)
@@ -1,3 +1,14 @@
+2006-03-01  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by darin
+        
+        Give the events that eventSender sends a unique eventNumber
+
+        * DumpRenderTree/DumpRenderTree.m:
+        (-[EventSendingController mouseDown]):
+        (-[EventSendingController mouseUp]):
+        (-[EventSendingController mouseMoveToX:Y:]):
+
 2006-03-01  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by hyatt.
index 86870cd..d27e1f4 100644 (file)
@@ -92,6 +92,7 @@
     BOOL down;
     int clickCount;
     NSTimeInterval lastClick;
+    int eventNumber;
 }
 @end
 
@@ -686,7 +687,7 @@ static void dump(void)
         clickCount = 1;
     else
         clickCount++;
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:lastMousePosition modifierFlags:nil timestamp:GetCurrentEventTime() windowNumber:0 context:[NSGraphicsContext currentContext] eventNumber:nil clickCount:clickCount pressure:nil];
+    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:lastMousePosition modifierFlags:nil timestamp:GetCurrentEventTime() windowNumber:0 context:[NSGraphicsContext currentContext] eventNumber:++eventNumber clickCount:clickCount pressure:nil];
 
     NSView *subView = [[frame webView] hitTest:[event locationInWindow]];
     if (subView) {
@@ -698,7 +699,7 @@ static void dump(void)
 - (void)mouseUp
 {
     [[[frame frameView] documentView] layout];
-    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseUp location:lastMousePosition modifierFlags:nil timestamp:GetCurrentEventTime() windowNumber:0 context:[NSGraphicsContext currentContext] eventNumber:nil clickCount:clickCount pressure:nil];
+    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseUp location:lastMousePosition modifierFlags:nil timestamp:GetCurrentEventTime() windowNumber:0 context:[NSGraphicsContext currentContext] eventNumber:++eventNumber clickCount:clickCount pressure:nil];
 
     NSView *subView = [[frame webView] hitTest:[event locationInWindow]];
     if (subView) {
@@ -722,7 +723,7 @@ static void dump(void)
 - (void)mouseMoveToX:(int)x Y:(int)y
 {
     lastMousePosition = NSMakePoint(x, [[frame webView] frame].size.height - y);
-    NSEvent *event = [NSEvent mouseEventWithType:(down ? NSLeftMouseDragged : NSMouseMoved) location:lastMousePosition modifierFlags:nil timestamp:GetCurrentEventTime() windowNumber:0 context:[NSGraphicsContext currentContext] eventNumber:nil clickCount:(down ? clickCount : 0) pressure:nil];
+    NSEvent *event = [NSEvent mouseEventWithType:(down ? NSLeftMouseDragged : NSMouseMoved) location:lastMousePosition modifierFlags:nil timestamp:GetCurrentEventTime() windowNumber:0 context:[NSGraphicsContext currentContext] eventNumber:++eventNumber clickCount:(down ? clickCount : 0) pressure:nil];
 
     NSView *subView = [[frame webView] hitTest:[event locationInWindow]];
     if (subView) {