WebKitTools:
authoralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 01:28:27 +0000 (01:28 +0000)
committeralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 01:28:27 +0000 (01:28 +0000)
        Reviewed by Darin, Mitz.

        fixed <rdar://5130762> mousedowns in different locations increase the clickcount incorrectly

        the clickcount should not increase if the last click was at a different location.  it's a new click.

        * DumpRenderTree/mac/DumpRenderTree.mm:
        (runTest):
        * DumpRenderTree/mac/EventSendingController.h:
        * DumpRenderTree/mac/EventSendingController.mm:
        (-[EventSendingController mouseDown]):
        (-[EventSendingController mouseUp]):

LayoutTests:

        Reviewed by Darin, Mitz.

        updating expected results after fixing clickcount for
        <rdar://5130762> mousedowns in different locations increase the clickcount incorrectly

        * fast/forms/focus-selection-input-expected.txt:
        * fast/forms/focus-selection-textarea-expected.txt:
        * platform/mac/fast/events/objc-event-api-expected.txt:
        * platform/mac/fast/inline/dirtyLinesForInline-expected.txt:
        * platform/mac/fast/text/textIteratorNilRenderer-expected.txt:
        * platform/mac/svg/custom/pointer-events-image-expected.txt:
        * platform/mac/svg/custom/pointer-events-path-expected.txt:
        * platform/mac/svg/custom/pointer-events-text-expected.txt:
        * platform/mac/svg/custom/text-hit-test-expected.txt:

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/focus-selection-input-expected.txt
LayoutTests/fast/forms/focus-selection-textarea-expected.txt
LayoutTests/platform/mac/fast/events/objc-event-api-expected.txt
LayoutTests/platform/mac/fast/inline/dirtyLinesForInline-expected.txt
LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.txt
LayoutTests/platform/mac/svg/custom/pointer-events-image-expected.txt
LayoutTests/platform/mac/svg/custom/pointer-events-path-expected.txt
LayoutTests/platform/mac/svg/custom/pointer-events-text-expected.txt
LayoutTests/platform/mac/svg/custom/text-hit-test-expected.txt
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/EventSendingController.h
WebKitTools/DumpRenderTree/mac/EventSendingController.mm

index 1399409b4b673fd8a15b5520adc25e22bffebea1..59f14a4399f67642e0aa11ba52d8c598dc413143 100644 (file)
@@ -1,3 +1,20 @@
+2008-01-03  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Darin, Mitz.
+
+        updating expected results after fixing clickcount for 
+        <rdar://5130762> mousedowns in different locations increase the clickcount incorrectly
+
+        * fast/forms/focus-selection-input-expected.txt:
+        * fast/forms/focus-selection-textarea-expected.txt:
+        * platform/mac/fast/events/objc-event-api-expected.txt:
+        * platform/mac/fast/inline/dirtyLinesForInline-expected.txt:
+        * platform/mac/fast/text/textIteratorNilRenderer-expected.txt:
+        * platform/mac/svg/custom/pointer-events-image-expected.txt:
+        * platform/mac/svg/custom/pointer-events-path-expected.txt:
+        * platform/mac/svg/custom/pointer-events-text-expected.txt:
+        * platform/mac/svg/custom/text-hit-test-expected.txt:
+
 2008-01-03  Darin Adler  <darin@apple.com>
 
         Reviewed by Mitz.
 2008-01-03  Darin Adler  <darin@apple.com>
 
         Reviewed by Mitz.
index 3921fb47f138662dbcf249330d826f666e25e636..374bfcab7c8ff4b0db91acae87b41dad1eb49d41 100644 (file)
@@ -7,7 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV to 0 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV to 0 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > LABEL > BODY > HTML > #document to 5 of #text > LABEL > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > BODY > HTML > #document to 5 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 713e3ac5f4d230b19deb11405b5286c6a60a4a8e..2892a076ccf03039281a5660b129d25c8e3103a0 100644 (file)
@@ -7,7 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV to 0 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV to 0 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > LABEL > BODY > HTML > #document to 5 of #text > LABEL > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > BODY > HTML > #document to 5 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 9000c65b07e5c51a67dc367195a70d5cb0aa1b02..5a17fef98211f9fec81cb58b44aeb87830665324 100644 (file)
@@ -230,7 +230,7 @@ event type:      mousedown
   eventPhase:    3
   bubbles:       1
   cancelable:    1
   eventPhase:    3
   bubbles:       1
   cancelable:    1
-  detail:        2
+  detail:        1
   view:          OK (document: OK)
   button:        0
   clientX:       400
   view:          OK (document: OK)
   button:        0
   clientX:       400
@@ -248,7 +248,7 @@ event type:      mouseup
   eventPhase:    3
   bubbles:       1
   cancelable:    1
   eventPhase:    3
   bubbles:       1
   cancelable:    1
-  detail:        2
+  detail:        1
   view:          OK (document: OK)
   button:        0
   clientX:       400
   view:          OK (document: OK)
   button:        0
   clientX:       400
@@ -261,20 +261,7 @@ event type:      click
   eventPhase:    3
   bubbles:       1
   cancelable:    1
   eventPhase:    3
   bubbles:       1
   cancelable:    1
-  detail:        2
-  view:          OK (document: OK)
-  button:        0
-  clientX:       400
-  clientY:       150
-  screenX:       -9600
-  screenY:       -9850
-  modifier keys: c:0 s:0 a:0 m:0
-event type:      dblclick
-  target:        <div>
-  eventPhase:    3
-  bubbles:       1
-  cancelable:    1
-  detail:        2
+  detail:        1
   view:          OK (document: OK)
   button:        0
   clientX:       400
   view:          OK (document: OK)
   button:        0
   clientX:       400
@@ -300,7 +287,7 @@ event type:      mousedown
   eventPhase:    3
   bubbles:       1
   cancelable:    1
   eventPhase:    3
   bubbles:       1
   cancelable:    1
-  detail:        3
+  detail:        2
   view:          OK (document: OK)
   button:        0
   clientX:       400
   view:          OK (document: OK)
   button:        0
   clientX:       400
@@ -364,7 +351,7 @@ event type:      mouseup
   eventPhase:    3
   bubbles:       1
   cancelable:    1
   eventPhase:    3
   bubbles:       1
   cancelable:    1
-  detail:        3
+  detail:        2
   view:          OK (document: OK)
   button:        0
   clientX:       1
   view:          OK (document: OK)
   button:        0
   clientX:       1
index ba8d6279e4a90ef42ed792b90b21f1fb6798681b..ffb3a79aa51038a8e1d02252e0b7bedad40eecbc 100644 (file)
@@ -30,5 +30,4 @@ layer at (11,99) size 110x13
   RenderBlock (positioned) {SPAN} at (11,99) size 110x13
     RenderText {#text} at (0,0) size 110x13
       text run at (0,0) width 110: "this is the about us page"
   RenderBlock (positioned) {SPAN} at (11,99) size 110x13
     RenderText {#text} at (0,0) size 110x13
       text run at (0,0) width 110: "this is the about us page"
-selection start: position 0 of child 0 {#text} of child 1 {P} of child 1 {BODY} of child 0 {HTML} of document
-selection end:   position 0 of child 1 {TABLE} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+caret: position 127 of child 0 {#text} of child 1 {P} of child 1 {BODY} of child 0 {HTML} of document
index 6c8a2a28cb76b55af965808c534f0332fe9c1975..680800379c3f4ae69e9f14981278b6f9438ca621 100644 (file)
@@ -31,5 +31,4 @@ layer at (0,0) size 800x600
           RenderBR {BR} at (392,0) size 0x18
 layer at (204,13) size 281x13
   RenderBlock {DIV} at (3,3) size 281x13
           RenderBR {BR} at (392,0) size 0x18
 layer at (204,13) size 281x13
   RenderBlock {DIV} at (3,3) size 281x13
-selection start: position 0 of child 0 {#text} of child 1 {TD} of child 0 {TR} of child 1 {TBODY} of child 1 {TABLE} of child 1 {FORM} of child 1 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
-selection end:   position 0 of child 2 {TD} of child 0 {TR} of child 1 {TBODY} of child 1 {TABLE} of child 1 {FORM} of child 1 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
+caret: position 1 of child 0 {#text} of child 1 {TD} of child 0 {TR} of child 1 {TBODY} of child 1 {TABLE} of child 1 {FORM} of child 1 {CENTER} of child 1 {BODY} of child 0 {HTML} of document
index 8f306f8c5344ce994dafe950cdc8062f44b267bf..dfe952ad1aeab078cb184845cf3e01469bb83d99 100644 (file)
@@ -324,5 +324,4 @@ layer at (0,0) size 800x600
       RenderSVGText {text} at (504,576) size 28x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 28x18
           chunk 1 text run 1 at (504.00,576.00) startOffset 0 endOffset 4 width 28.00: "miss"
       RenderSVGText {text} at (504,576) size 28x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 28x18
           chunk 1 text run 1 at (504.00,576.00) startOffset 0 endOffset 4 width 28.00: "miss"
-selection start: position 0 of child 0 {#text} of child 3 {text} of child 0 {svg} of document
-selection end:   position 0 of child 5 {text} of child 0 {svg} of document
+caret: position 19 of child 0 {#text} of child 3 {text} of child 0 {svg} of document
index 8249a04b6378c6817227b95b321372bc527328f7..853d206e53e3c7d774db92a4e0506b78f3f32282 100644 (file)
@@ -556,5 +556,4 @@ layer at (0,0) size 800x600
       RenderSVGText {text} at (504,596) size 28x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 28x18
           chunk 1 text run 1 at (504.00,596.00) startOffset 0 endOffset 4 width 28.00: "miss"
       RenderSVGText {text} at (504,596) size 28x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 28x18
           chunk 1 text run 1 at (504.00,596.00) startOffset 0 endOffset 4 width 28.00: "miss"
-selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
-selection end:   position 0 of child 7 {text} of child 0 {svg} of document
+caret: position 19 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
index ab5299e81017fe54b45c935e46fb660a4998f853..2f229b3f45902d44d899b92b6262e7c599544e58 100644 (file)
@@ -468,5 +468,4 @@ layer at (0,0) size 800x600
       RenderSVGText {text} at (504,576) size 28x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 28x18
           chunk 1 text run 1 at (504.00,576.00) startOffset 0 endOffset 4 width 28.00: "miss"
       RenderSVGText {text} at (504,576) size 28x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 28x18
           chunk 1 text run 1 at (504.00,576.00) startOffset 0 endOffset 4 width 28.00: "miss"
-selection start: position 0 of child 0 {#text} of child 3 {text} of child 0 {svg} of document
-selection end:   position 0 of child 5 {text} of child 0 {svg} of document
+caret: position 19 of child 0 {#text} of child 3 {text} of child 0 {svg} of document
index 82cef4ff2f48c719c9f1a7b33c1c556f9a064e61..bce1435d918b9f398d7d98d8a126970ce4838808 100644 (file)
@@ -12,5 +12,4 @@ layer at (0,0) size 800x600
       RenderSVGText {text} at (90,130) size 43x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 43x18
           chunk 1 text run 1 at (90.00,130.00) startOffset 0 endOffset 6 width 43.00: "Passed"
       RenderSVGText {text} at (90,130) size 43x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 43x18
           chunk 1 text run 1 at (90.00,130.00) startOffset 0 endOffset 6 width 43.00: "Passed"
-selection start: position 0 of child 0 {#text} of child 1 {text} of child 3 {g} of child 0 {svg} of document
-selection end:   position 5 of child 0 {#text} of child 1 {text} of child 3 {g} of child 0 {svg} of document
+caret: position 0 of child 0 {#text} of child 1 {text} of child 3 {g} of child 0 {svg} of document
index a77cdc3a50b08be94d7c8e0ae812896a9dac0615..de0ccccf77b530771a64ead315c1a107f25d6abe 100644 (file)
@@ -1,3 +1,18 @@
+2008-01-03  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Darin, Mitz.
+
+        fixed <rdar://5130762> mousedowns in different locations increase the clickcount incorrectly
+
+        the clickcount should not increase if the last click was at a different location.  it's a new click.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (runTest):
+        * DumpRenderTree/mac/EventSendingController.h:
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController mouseDown]):
+        (-[EventSendingController mouseUp]):
+
 2008-01-03  Darin Adler  <darin@apple.com>
 
         Reviewed by Adam.
 2008-01-03  Darin Adler  <darin@apple.com>
 
         Reviewed by Adam.
index 4f96928ab33f5b0be3aaa221bd28c23ba7864067..08d481acf435fb3f320b0ec6e101cb35dcda86cd 100644 (file)
@@ -834,7 +834,8 @@ static void runTest(const char *pathOrURL)
 
     if ([WebHistory optionalSharedHistory])
         [WebHistory setOptionalSharedHistory:nil];
 
     if ([WebHistory optionalSharedHistory])
         [WebHistory setOptionalSharedHistory:nil];
-    lastMousePosition = NSMakePoint(0, 0);
+    lastMousePosition = NSZeroPoint;
+    lastClickPosition = NSZeroPoint;
 
     if (currentTest != nil)
         CFRelease(currentTest);
 
     if (currentTest != nil)
         CFRelease(currentTest);
index d9e1783c6fbac6ed6a893a888704c0316aaa0364..28d038527ea914fda7fb3222f586594a007afdcf 100644 (file)
@@ -50,3 +50,4 @@
 @end
 
 extern NSPoint lastMousePosition;
 @end
 
 extern NSPoint lastMousePosition;
+extern NSPoint lastClickPosition;
\ No newline at end of file
index 28b17620b87b7da699d5ed4b4d023cca2fdda32b..8f6a1540edf564bf1b20b2fc07163872a5e1b6b5 100644 (file)
@@ -41,6 +41,7 @@
 extern "C" void _NSNewKillRingSequence();
 
 NSPoint lastMousePosition;
 extern "C" void _NSNewKillRingSequence();
 
 NSPoint lastMousePosition;
+NSPoint lastClickPosition;
 NSArray *webkitDomEventNames;
 NSMutableArray *savedMouseEvents; // mouse events sent between mouseDown and mouseUp are stored here, and then executed at once.
 BOOL replayingSavedEvents;
 NSArray *webkitDomEventNames;
 NSMutableArray *savedMouseEvents; // mouse events sent between mouseDown and mouseUp are stored here, and then executed at once.
 BOOL replayingSavedEvents;
@@ -182,7 +183,8 @@ BOOL replayingSavedEvents;
 - (void)mouseDown
 {
     [[[mainFrame frameView] documentView] layout];
 - (void)mouseDown
 {
     [[[mainFrame frameView] documentView] layout];
-    if ([self currentEventTime] - lastClick >= 1)
+    if (([self currentEventTime] - lastClick >= 1) ||
+        !NSEqualPoints(lastMousePosition, lastClickPosition))
         clickCount = 1;
     else
         clickCount++;
         clickCount = 1;
     else
         clickCount++;
@@ -246,6 +248,7 @@ BOOL replayingSavedEvents;
     [targetView mouseUp:event];
     down = NO;
     lastClick = [event timestamp];
     [targetView mouseUp:event];
     down = NO;
     lastClick = [event timestamp];
+    lastClickPosition = lastMousePosition;
     if (draggingInfo) {
         WebView *webView = [mainFrame webView];
         
     if (draggingInfo) {
         WebView *webView = [mainFrame webView];