Changeset 132929 in webkit
- Timestamp:
- Oct 30, 2012 11:44:42 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r132924 r132929 1 2012-10-30 Rick Byers <rbyers@chromium.org> 2 3 [touchadjustment] touch-links-longpress tests passes incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=96810 5 6 Reviewed by Antonio Gomes. 7 8 Fix touch-links-longpress test to be consistent with touch-links-active. 9 Now it's actually touching where we intended - at the center of the 10 touch region identified instead of the top/left corner. Also pass 11 the width/height of the touch to EventSender in order to enable touch 12 adjustment. 13 14 Also adds checks to verify that our touches are actually landing on 15 or outside the element we're targetting as desired. 16 17 * touchadjustment/resources/touchadjustment.js: 18 (findAbsoluteBounds): Update to support both inline and block nodes (clientHeight is 0 for inline nodes) 19 * touchadjustment/touch-links-active.html: Use updated findAbsoluteBounds 20 * touchadjustment/touch-links-longpress.html: 21 1 22 2012-10-30 Dan Bernstein <mitz@apple.com> 2 23 -
trunk/LayoutTests/platform/qt/TestExpectations
r132923 r132929 449 449 touchadjustment/touch-links-active.html 450 450 451 # Don't have width/height on GestureLongPress necessary to enable adjustment 452 touchadjustment/touch-links-longpress.html 453 451 454 # ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING) is disabled 452 455 fast/dom/timer-throttling-hidden-page.html -
trunk/LayoutTests/touchadjustment/resources/touchadjustment.js
r128999 r132929 1 /* function for finding the absolute bounds of a node */1 /* function for finding the absolute bounds of a node (both inline and block) */ 2 2 function findAbsoluteBounds(node) 3 3 { 4 var bounds = {left: 0, top: 0}; 5 bounds.width = node.clientWidth; 6 bounds.height = node.clientHeight; 7 do { 8 bounds.left += node.offsetLeft; 9 bounds.top += node.offsetTop; 10 } while (node = node.offsetParent); 11 return bounds; 4 var bounds = node.getBoundingClientRect(); 5 return { 6 left: bounds.left, 7 top: bounds.top, 8 width: bounds.right - bounds.left, 9 height: bounds.bottom - bounds.top 10 }; 12 11 } 13 12 -
trunk/LayoutTests/touchadjustment/touch-links-active.html
r128999 r132929 64 64 } 65 65 66 // FIXME: Why doesn't the approach in findAbsoluteBounds work correctly here?67 // I'll investigate/fix along with http://wkb.ug/9681068 function getBounds(node)69 {70 var bounds = node.getBoundingClientRect();71 return {72 left: bounds.left,73 top: bounds.top,74 width: bounds.right - bounds.left,75 height: bounds.bottom - bounds.top76 };77 }78 79 66 function testDirectTouch(element) 80 67 { 81 68 // Touch directly in the center of the element. 82 var touchpoint = offsetTouchPoint( getBounds(element), 'center', 0, 20, 30);69 var touchpoint = offsetTouchPoint(findAbsoluteBounds(element), 'center', 0, 20, 30); 83 70 if (document.elementFromPoint(touchpoint.x, touchpoint.y) != element) 84 71 testFailed('Direct touch ended up on some other element'); … … 100 87 { 101 88 // Touch just right of the element. 102 var touchpoint = offsetTouchPoint( getBounds(element), 'right', 10, 30, 20);89 var touchpoint = offsetTouchPoint(findAbsoluteBounds(element), 'right', 10, 30, 20); 103 90 if (isDescendantOf(element, document.elementFromPoint(touchpoint.x, touchpoint.y))) 104 91 testFailed('Indirect touch ended up still on top of the element'); -
trunk/LayoutTests/touchadjustment/touch-links-longpress.html
r124642 r132929 37 37 { 38 38 if (eventSender.gestureLongPress) 39 eventSender.gestureLongPress(touchpoint. left, touchpoint.top);39 eventSender.gestureLongPress(touchpoint.x, touchpoint.y, touchpoint.width, touchpoint.height); 40 40 else 41 41 debug("gestureLongPress not implemented by this platform."); … … 46 46 // Touch directly in the center of the element. 47 47 var touchpoint = offsetTouchPoint(findAbsoluteBounds(element), 'center', 0, 20, 30); 48 if (document.elementFromPoint(touchpoint.x, touchpoint.y) != element) 49 testFailed('Direct touch ended up on some other element'); 48 50 testLongPress(touchpoint); 49 51 } … … 53 55 // Touch just right of the element. 54 56 var touchpoint = offsetTouchPoint(findAbsoluteBounds(element), 'right', 10, 30, 20); 57 if (isDescendantOf(element, document.elementFromPoint(touchpoint.x, touchpoint.y))) 58 testFailed('Indirect touch ended up still on top of the element'); 55 59 testLongPress(touchpoint); 60 } 61 62 function isDescendantOf(parent, child) 63 { 64 var n = child; 65 while(n) { 66 if(n==parent) 67 return true; 68 n = n.parentNode; 69 } 70 return false; 56 71 } 57 72 -
trunk/Tools/ChangeLog
r132925 r132929 1 2012-10-30 Rick Byers <rbyers@chromium.org> 2 3 [touchadjustment] touch-links-longpress tests passes incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=96810 5 6 Reviewed by Antonio Gomes. 7 8 Add support for suppling width/height information for longpress 9 gesture (as for other gestures like tapDown) for the purposes 10 of touch adjustment. 11 12 * DumpRenderTree/chromium/TestRunner/src/EventSender.cpp: 13 (WebTestRunner): 14 (WebTestRunner::EventSender::gestureEvent): 15 1 16 2012-10-29 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp
r132781 r132929 1201 1201 event.x = point.x; 1202 1202 event.y = point.y; 1203 if (arguments.size() >= 4) { 1204 event.data.tapDown.width = static_cast<float>(arguments[2].toDouble()); 1205 event.data.tapDown.height = static_cast<float>(arguments[3].toDouble()); 1206 } 1203 1207 break; 1204 1208 case WebInputEvent::GestureTwoFingerTap:
Note: See TracChangeset
for help on using the changeset viewer.