Commit 604f3a4c authored by justing's avatar justing
Browse files

LayoutTests:

        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: http://svn.webkit.org/repository/webkit/trunk@13081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 151e8bbb
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.
......
<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
8a7cca3da1a9875fbdb6043285ec6c70
\ No newline at end of file
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."
<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>
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.
......
......@@ -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();
......
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.
......
......@@ -92,6 +92,7 @@ @interface EventSendingController : NSObject
BOOL down;
int clickCount;
NSTimeInterval lastClick;
int eventNumber;
}
@end
......@@ -686,7 +687,7 @@ - (void)mouseDown
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 @@ - (void)mouseDown
- (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 @@ - (void)mouseUp
- (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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment