Changeset 169650 in webkit
- Timestamp:
- Jun 6, 2014, 10:41:36 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r169649 r169650 1 2014-06-06 Simon Fraser <simon.fraser@apple.com> 2 3 Latched scrolling tests are flakey on Mavericks 4 https://bugs.webkit.org/show_bug.cgi?id=133578 5 <rdar://problem/17180591> 6 7 Reviewed by Brent Fulgham. 8 9 Fix these tests to not dispatch events outside the window, and correct some of the wording 10 in the tests. 11 12 * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt: 13 * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt: 14 * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html: 15 * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html: 16 * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html: 17 * platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html: 18 * platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html: 19 * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html: 20 * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html: 21 * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt: 22 * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt: 23 * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html: 24 * platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html: 25 1 26 2014-06-06 Alex Christensen <achristensen@webkit.org> 2 27 -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-expected.txt
r168244 r169650 53 53 54 54 TEST COMPLETE 55 div display height = 48556 Mouse moved to (28, 610)57 Page before: 0, div before: 45158 Page after: 0, div after: 45155 div display height = 350 56 Mouse moved to (28, 475) 57 Page before: 0, div before: 586 58 Page after: 0, div after: 666 59 59 PASS Page did not receive wheel events. 60 60 (GraphicsLayer -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler-expected.txt
r168244 r169650 53 53 54 54 TEST COMPLETE 55 div display height = 48556 Mouse moved to (28, 610)57 Page before: 0, div before: 45158 Page after: 0, div after: 45155 div display height = 350 56 Mouse moved to (28, 475) 57 Page before: 0, div before: 586 58 Page after: 0, div after: 666 59 59 PASS Page did not receive wheel events. 60 Document was initial target for 0of the wheel events.60 Document was initial target for 4 of the wheel events. 61 61 (GraphicsLayer 62 62 (anchor 0.00 0.00) -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div-with-handler.html
r169311 r169650 72 72 73 73 function scrollTest() { 74 // See where our IFrame lives:75 74 pageScrollPositionBefore = document.body.scrollTop; 76 75 … … 84 83 debug("div display height = " + Math.round(divTarget.clientHeight)); 85 84 var startPosY = Math.round(divTarget.offsetTop) + Math.round(divTarget.clientHeight) - 42; // One wheel turn before end. 86 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame85 eventSender.mouseMoveTo(startPosX, startPosY); 87 86 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 88 87 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 110 109 var message = document.createElement('div'); 111 110 message.innerHTML = "<p>This test is better run under DumpRenderTree. To manually test it, place the mouse pointer<br/>" 112 + "at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the<br/>" 113 + "down past the div.<br/><br/>" 114 + "You should not see the row of END labels if this test is successful.</p>"; 111 + "near the bottom of the scrollable region, and then use the mouse wheel or a two-finger swipe to scroll up.<br/></br/>" 112 + "The page should not scroll.</p>"; 115 113 messageLocation.appendChild(message); 116 114 } … … 124 122 <div class="scrollable_region"> 125 123 <h3>Scrollable Region</h3> 126 <div id="target" style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'>124 <div id="target" style='overflow-y: auto; overflow-x: hidden; height: 350px;'> 127 125 <table class="table" style='width: 99%'> 128 126 <tr><th>Count</th><th>DATA</th><th>Rev Count</th></tr> -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-div.html
r169311 r169650 64 64 65 65 function scrollTest() { 66 // See where our IFrame lives:67 66 pageScrollPositionBefore = document.body.scrollTop; 68 67 … … 76 75 debug("div display height = " + Math.round(divTarget.clientHeight)); 77 76 var startPosY = Math.round(divTarget.offsetTop) + Math.round(divTarget.clientHeight) - 42; // One wheel turn before end. 78 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame77 eventSender.mouseMoveTo(startPosX, startPosY); 79 78 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 80 79 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 102 101 var message = document.createElement('div'); 103 102 message.innerHTML = "<p>This test is better run under DumpRenderTree. To manually test it, place the mouse pointer<br/>" 104 + "at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the<br/>" 105 + "down past the div.<br/><br/>" 106 + "You should not see the row of END labels if this test is successful.</p>"; 103 + "near the bottom of the scrollable region and scroll up.<br/><br/>" 104 + "The page should not scroll.</p>"; 107 105 messageLocation.appendChild(message); 108 106 } … … 116 114 <div class="scrollable_region"> 117 115 <h3>Scrollable Region</h3> 118 <div id="target" style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'>116 <div id="target" style='overflow-y: auto; overflow-x: hidden; max-height: 350px;'> 119 117 <table class="table" style='width: 99%'> 120 118 <tr><th>Count</th><th>DATA</th><th>Rev Count</th></tr> -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe-with-handler.html
r169311 r169650 72 72 73 73 function scrollTest() { 74 // See where our IFrame lives:75 74 pageScrollPositionBefore = document.body.scrollTop; 76 75 … … 81 80 // Scroll the #source until we reach the #target. 82 81 var startPosX = Math.round(divTarget.offsetLeft) + 20; 83 var startPosY = Math.round(divTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame84 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame82 var startPosY = Math.round(divTarget.offsetTop) - 42; 83 eventSender.mouseMoveTo(startPosX, startPosY); 85 84 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 86 85 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 110 109 + "at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the<br/>" 111 110 + "down past the div.<br/><br/>" 112 + " You should not see the row of END labels if this test is successful.</p>";111 + "The scrollable region should not scroll.</p>"; 113 112 messageLocation.appendChild(message); 114 113 } … … 122 121 <div class="scrollable_region"> 123 122 <h3>Scrollable Region</h3> 124 <div id="target" style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'>123 <div id="target" style='overflow-y: auto; overflow-x: hidden; height: 350px;'> 125 124 <table class="table" style='width: 99%'> 126 125 <tr><th>Count</th><th>DATA</th><th>Rev Count</th></tr> -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-div-latched-mainframe.html
r169311 r169650 64 64 65 65 function scrollTest() { 66 // See where our IFrame lives:67 66 pageScrollPositionBefore = document.body.scrollTop; 68 67 … … 73 72 // Scroll the #source until we reach the #target. 74 73 var startPosX = Math.round(divTarget.offsetLeft) + 20; 75 var startPosY = Math.round(divTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame76 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame74 var startPosY = Math.round(divTarget.offsetTop) - 42; 75 eventSender.mouseMoveTo(startPosX, startPosY); 77 76 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 78 77 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 102 101 + "at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the<br/>" 103 102 + "down past the div.<br/><br/>" 104 + " You should not see the row of END labels if this test is successful.</p>";103 + "The scrollable region should not scroll.</p>"; 105 104 messageLocation.appendChild(message); 106 105 } … … 114 113 <div class="scrollable_region"> 115 114 <h3>Scrollable Region</h3> 116 <div id="target" style='overflow-y: auto; overflow-x: hidden; max-height: 485px;'>115 <div id="target" style='overflow-y: auto; overflow-x: hidden; height: 350px;'> 117 116 <table class="table" style='width: 99%'> 118 117 <tr><th>Count</th><th>DATA</th><th>Rev Count</th></tr> -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-iframe-latched-mainframe.html
r169311 r169650 36 36 37 37 function scrollTest() { 38 // See where our IFrame lives:39 38 pageScrollPositionBefore = document.body.scrollTop; 40 39 iFrameScrollPositionBefore = window.frames['target'].document.body.scrollTop; … … 45 44 var startPosX = iframeTarget.offsetLeft + 20; 46 45 var startPosY = iframeTarget.offsetTop - 42; // Slightly more than one wheel scroll away from the IFrame 47 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame46 eventSender.mouseMoveTo(startPosX, startPosY); 48 47 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 49 48 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 72 71 message.innerHTML = "<p>This test is better run under DumpRenderTree. To manually test it, place the mouse pointer<br/>" 73 72 + "at the top of the page, and then use the mouse wheel or a two-finger swipe to scroll the<br/>" 74 + "down past the IFrame.<br/><br/>"75 + " You should not see the row of END labels if this test is successful.</p>";73 + "down past the iframe.<br/><br/>" 74 + "The iframe should not scroll.</p>"; 76 75 messageLocation.appendChild(message); 77 76 } … … 83 82 Put mouse here and flick downwards 84 83 </div> 85 <iframe id="target" name="target" style="border:solid 1px green; height: 500px; width: 500px;"84 <iframe id="target" name="target" style="border:solid 1px green; height: 300px; width: 500px;" 86 85 src= "data:text/html, 87 86 <div id='notToBeScrolled' style='height: 1000px; width: 1000px;'> -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe-with-handler.html
r169311 r169650 72 72 73 73 function scrollTest() { 74 // See where our IFrame lives:75 74 pageScrollPositionBefore = document.body.scrollTop; 76 75 … … 81 80 // Scroll the #source until we reach the #target. 82 81 var startPosX = Math.round(selectTarget.offsetLeft) + 20; 83 var startPosY = Math.round(selectTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame84 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame82 var startPosY = Math.round(selectTarget.offsetTop) - 42; 83 eventSender.mouseMoveTo(startPosX, startPosY); 85 84 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 86 85 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-mainframe.html
r169311 r169650 64 64 65 65 function scrollTest() { 66 // See where our IFrame lives:67 66 pageScrollPositionBefore = document.body.scrollTop; 68 67 … … 73 72 // Scroll the #source until we reach the #target. 74 73 var startPosX = Math.round(selectTarget.offsetLeft) + 20; 75 var startPosY = Math.round(selectTarget.offsetTop) - 42; // Slightly more than one wheel scroll away from the IFrame76 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame74 var startPosY = Math.round(selectTarget.offsetTop) - 42; 75 eventSender.mouseMoveTo(startPosX, startPosY); 77 76 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 78 77 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-expected.txt
r168244 r169650 1 Put mouse here and flick downwards1 Put mouse near the bottom of the select and scroll downwards. 2 2 Scrollable Select 3 3 -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler-expected.txt
r168244 r169650 1 Put mouse here and flick downwards1 Put mouse near the bottom of the select and scroll downwards. 2 2 Scrollable Select 3 3 -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select-with-handler.html
r169311 r169650 72 72 73 73 function scrollTest() { 74 // See where our IFrame lives:75 74 pageScrollPositionBefore = document.body.scrollTop; 76 75 … … 80 79 selectScrollPositionBefore = selectTarget.scrollTop; 81 80 82 // Scroll the #source until we reach the #target.83 81 var startPosX = Math.round(selectTarget.offsetLeft) + 20; 84 82 debug("div display height = " + Math.round(selectTarget.clientHeight)); 85 var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42; // One wheel turn before end.86 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame83 var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42; 84 eventSender.mouseMoveTo(startPosX, startPosY); 87 85 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 88 86 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 120 118 <div id="parent" style="height: 2000px; width: 2000px;"> 121 119 <div id="source" style="height: 100px; width: 500px;"> 122 Put mouse here and flick downwards120 Put mouse near the bottom of the select and scroll downwards. 123 121 </div> 124 122 <div class="scrollable_region"> -
trunk/LayoutTests/platform/mac-wk2/tiled-drawing/fast-scroll-select-latched-select.html
r169311 r169650 64 64 65 65 function scrollTest() { 66 // See where our IFrame lives:67 66 pageScrollPositionBefore = document.body.scrollTop; 68 67 … … 75 74 var startPosX = Math.round(selectTarget.offsetLeft) + 20; 76 75 debug("div display height = " + Math.round(selectTarget.clientHeight)); 77 var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42; // One wheel turn before end.78 eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame76 var startPosY = Math.round(selectTarget.offsetTop) + Math.round(selectTarget.clientHeight) - 42; 77 eventSender.mouseMoveTo(startPosX, startPosY); 79 78 debug("Mouse moved to (" + startPosX + ", " + startPosY + ")"); 80 79 eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none', true); … … 112 111 <div id="parent" style="height: 2000px; width: 2000px;"> 113 112 <div id="source" style="height: 100px; width: 500px;"> 114 Put mouse here and flick downwards113 Put mouse near the bottom of the select and scroll downwards. 115 114 </div> 116 115 <div class="scrollable_region"> -
trunk/Tools/ChangeLog
r169614 r169650 1 2014-06-06 Simon Fraser <simon.fraser@apple.com> 2 3 Latched scrolling tests are flakey on Mavericks 4 https://bugs.webkit.org/show_bug.cgi?id=133578 5 <rdar://problem/17180591> 6 7 Reviewed by Brent Fulgham. 8 9 The latched scrolling tests rely on synthetic mousewheel events whose coordinates can 10 be wrong on machines with more than one screen. This is because we use 11 [NSScreen mainScreen] when computing the global coordinates of the events, but 12 [NSScreen mainScreen] returns the screen with the key window, not the first screen. 13 14 So replace calls to [NSScreen mainScreen] with [[NSScreen screens] firstObject]. Also 15 add comments clarifying why the coordinate math works (which is not obvious given 16 the events have no target window). 17 18 Some scrolling tests also dispatched events outside the 800x600 test window, so 19 fix those tests, and add logging that will appear in test output when this happens. 20 21 * DumpRenderTree/mac/DumpRenderTree.mm: 22 (createWebViewAndOffscreenWindow): 23 * DumpRenderTree/mac/EventSendingController.mm: 24 (-[EventSendingController mouseScrollByX:andY:continuously:]): 25 (-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]): 26 * WebKitTestRunner/mac/EventSenderProxy.mm: 27 (WTR::EventSenderProxy::mouseMoveTo): 28 (WTR::EventSenderProxy::mouseScrollBy): 29 (WTR::EventSenderProxy::continuousMouseScrollBy): 30 (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases): 31 1 32 2014-06-05 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 33 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r169505 r169650 711 711 DumpRenderTreeWindow *window = [[DumpRenderTreeWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; 712 712 713 [window setColorSpace:[[ NSScreen mainScreen] colorSpace]];713 [window setColorSpace:[[[NSScreen screens] firstObject] colorSpace]]; 714 714 [window setCollectionBehavior:NSWindowCollectionBehaviorStationary]; 715 715 [[window contentView] addSubview:webView]; -
trunk/Tools/DumpRenderTree/mac/EventSendingController.mm
r167650 r169650 668 668 } 669 669 670 - (void)mouseScrollByX:(int)x andY:(int)y continuously:(BOOL)c 671 { 672 #if !PLATFORM(IOS) 673 CGScrollEventUnit unit = c ?kCGScrollEventUnitPixel:kCGScrollEventUnitLine;670 - (void)mouseScrollByX:(int)x andY:(int)y continuously:(BOOL)continuously 671 { 672 #if !PLATFORM(IOS) 673 CGScrollEventUnit unit = continuously ? kCGScrollEventUnitPixel : kCGScrollEventUnitLine; 674 674 CGEventRef cgScrollEvent = CGEventCreateScrollWheelEvent(NULL, unit, 2, y, x); 675 675 676 // CGEvent locations are in global display coordinates. 677 CGPoint lastGlobalMousePosition = { 678 lastMousePosition.x, 679 [[NSScreen mainScreen] frame].size.height - lastMousePosition.y 680 }; 676 // Set the CGEvent location in flipped coords relative to the first screen, which 677 // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has 678 // no associated window. See <rdar://problem/17180591>. 679 CGPoint lastGlobalMousePosition = CGPointMake(lastMousePosition.x, [[[NSScreen screens] firstObject] frame].size.height - lastMousePosition.y); 681 680 CGEventSetLocation(cgScrollEvent, lastGlobalMousePosition); 682 681 … … 736 735 CGEventRef cgScrollEvent = CGEventCreateScrollWheelEvent(NULL, kCGScrollEventUnitLine, 2, y, x); 737 736 738 // CGEvent locations are in global display coordinates. 739 CGPoint lastGlobalMousePosition = CGPointMake(lastMousePosition.x, [[NSScreen mainScreen] frame].size.height - lastMousePosition.y); 737 // Set the CGEvent location in flipped coords relative to the first screen, which 738 // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has 739 // no associated window. See <rdar://problem/17180591>. 740 CGPoint lastGlobalMousePosition = CGPointMake(lastMousePosition.x, [[[NSScreen screens] firstObject] frame].size.height - lastMousePosition.y); 740 741 CGEventSetLocation(cgScrollEvent, lastGlobalMousePosition); 741 742 CGEventSetIntegerValueField(cgScrollEvent, kCGScrollWheelEventIsContinuous, 1); -
trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
r168961 r169650 221 221 [targetView mouseMoved:event]; 222 222 [NSApp _setCurrentEvent:nil]; 223 } else { 224 CGPoint windowLocation = [event locationInWindow]; 225 WTFLogAlways("mouseMoveTo failed to find a target view at %f,%f\n", windowLocation.x, windowLocation.y); 223 226 } 224 227 } … … 444 447 RetainPtr<CGEventRef> cgScrollEvent = adoptCF(CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x)); 445 448 446 // CGEvent locations are in global display coordinates. 447 CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[NSScreen mainScreen] frame].size.height - m_position.y); 449 // Set the CGEvent location in flipped coords relative to the first screen, which 450 // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has 451 // no associated window. See <rdar://problem/17180591>. 452 CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[[NSScreen screens] firstObject] frame].size.height - m_position.y); 448 453 CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition); 449 454 … … 453 458 [targetView scrollWheel:event]; 454 459 [NSApp _setCurrentEvent:nil]; 460 } else { 461 NSPoint location = [event locationInWindow]; 462 WTFLogAlways("mouseScrollByWithWheelAndMomentumPhases failed to find the target view at %f,%f\n", location.x, location.y); 455 463 } 456 464 } … … 458 466 void EventSenderProxy::continuousMouseScrollBy(int x, int y, bool paged) 459 467 { 460 // FIXME: Implement this.468 WTFLogAlways("EventSenderProxy::continuousMouseScrollBy is not implemented\n"); 461 469 return; 462 470 } … … 470 478 RetainPtr<CGEventRef> cgScrollEvent = adoptCF(CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x)); 471 479 472 // CGEvent locations are in global display coordinates. 473 CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[NSScreen mainScreen] frame].size.height - m_position.y); 480 // Set the CGEvent location in flipped coords relative to the first screen, which 481 // compensates for the behavior of +[NSEvent eventWithCGEvent:] when the event has 482 // no associated window. See <rdar://problem/17180591>. 483 CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[[NSScreen screens] firstObject] frame].size.height - m_position.y); 474 484 CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition); 475 485 … … 478 488 CGEventSetIntegerValueField(cgScrollEvent.get(), kCGScrollWheelEventMomentumPhase, momentum); 479 489 480 NSEvent* event = [NSEvent eventWithCGEvent: 490 NSEvent* event = [NSEvent eventWithCGEvent:cgScrollEvent.get()]; 481 491 482 492 // Our event should have the correct settings: 483 if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest: [event locationInWindow]]) { 484 [NSApp _setCurrentEvent: event]; 485 [targetView scrollWheel: event]; 486 [NSApp _setCurrentEvent: nil]; 493 if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]) { 494 [NSApp _setCurrentEvent:event]; 495 [targetView scrollWheel:event]; 496 [NSApp _setCurrentEvent:nil]; 497 } else { 498 CGPoint windowLocation = [event locationInWindow]; 499 WTFLogAlways("mouseScrollByWithWheelAndMomentumPhases failed to find the target view at %f,%f\n", windowLocation.x, windowLocation.y); 487 500 } 488 501 }
Note:
See TracChangeset
for help on using the changeset viewer.