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; | |
102 testDirectTouches(); | 100 testDirectTouches(); |
103 testAdjustedTouches(); | 101 testAdjustedTouches(); |
104 testAdjustedPoints() | 102 testAdjustedPoints() |
105 e.container.style.display = 'none'; | 103 e.container.style.display = 'none'; |
106 } | 104 } |
107 } | 105 } |
108 runTests(); | 106 runTests(); |
109 </script> | 107 </script> |
110 <script src="../fast/js/resources/js-test-post.js"></script> | 108 <script src="../fast/js/resources/js-test-post.js"></script> |
111 | 109 |
112 </body> | 110 </body> |
113 </html> | 111 </html> |
OLD | NEW |