OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test touch adjustment to a non-rectilinear element.</title> | 4 <title>Test touch adjustment to a non-rectilinear element.</title> |
5 <script src="../fast/js/resources/js-test-pre.js"></script> | 5 <script src="../fast/js/resources/js-test-pre.js"></script> |
6 <script src="resources/touchadjustment.js"></script> | 6 <script src="resources/touchadjustment.js"></script> |
7 <style> | 7 <style> |
8 body { margin: 0px; padding: 0px; } | 8 body { margin: 0px; padding: 0px; } |
9 #container { | 9 #container { |
10 -webkit-box-sizing: border-box; | 10 -webkit-box-sizing: border-box; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 adjustedPoint = adjustTouchPoint(touchPoint(70, 20, 20, 40)) | 91 adjustedPoint = adjustTouchPoint(touchPoint(70, 20, 20, 40)) |
92 shouldBeWithin(adjustedPoint, touchPoint(70, 20, 20, 40)); | 92 shouldBeWithin(adjustedPoint, touchPoint(70, 20, 20, 40)); |
93 } | 93 } |
94 | 94 |
95 function runTests() | 95 function runTests() |
96 { | 96 { |
97 document.addEventListener('click', function() {}, false); | 97 document.addEventListener('click', function() {}, false); |
98 if (window.testRunner && window.internals && internals.touchNodeAdjusted
ToBestClickableNode) { | 98 if (window.testRunner && window.internals && internals.touchNodeAdjusted
ToBestClickableNode) { |
99 description(document.title); | 99 description(document.title); |
| 100 // Mouse events only work after an initial layout |
| 101 document.body.offsetLeft; |
100 testDirectTouches(); | 102 testDirectTouches(); |
101 testAdjustedTouches(); | 103 testAdjustedTouches(); |
102 testAdjustedPoints() | 104 testAdjustedPoints() |
103 e.container.style.display = 'none'; | 105 e.container.style.display = 'none'; |
104 } | 106 } |
105 } | 107 } |
106 runTests(); | 108 runTests(); |
107 </script> | 109 </script> |
108 <script src="../fast/js/resources/js-test-post.js"></script> | 110 <script src="../fast/js/resources/js-test-post.js"></script> |
109 | 111 |
110 </body> | 112 </body> |
111 </html> | 113 </html> |
OLD | NEW |