OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Touch Adjustment : Shadow DOM Element Search Cancel Button - bug 9189
4</title> | 4 <title>Touch Adjustment : Shadow DOM Element Search Cancel Button - bug 9189
4</title> |
5 <script src="../resources/js-test.js"></script> | 5 <script src="../resources/js-test.js"></script> |
6 <script src="resources/touchadjustment.js"></script> | 6 <script src="resources/touchadjustment.js"></script> |
7 <style> | 7 <style> |
8 input[type='search'] { | 8 input[type='search'] { |
9 -webkit-appearance: none; | 9 -webkit-appearance: none; |
10 -webkit-box-sizing: border-box; | 10 -webkit-box-sizing: border-box; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 var textContentBounds; | 42 var textContentBounds; |
43 var touchBounds; | 43 var touchBounds; |
44 var targetBounds; | 44 var targetBounds; |
45 var targetContainsPoint; | 45 var targetContainsPoint; |
46 var touchContainsPoint; | 46 var touchContainsPoint; |
47 | 47 |
48 function runTouchTests() { | 48 function runTouchTests() { |
49 document.addEventListener('click', function() {}, false); | 49 document.addEventListener('click', function() {}, false); |
50 | 50 |
51 element = document.getElementById('target'); | 51 element = document.getElementById('target'); |
| 52 element.focus(); |
52 | 53 |
53 inputBounds = findAbsoluteBounds(element); | 54 inputBounds = findAbsoluteBounds(element); |
54 | 55 |
55 var touchRadius = 20; | 56 var touchRadius = 20; |
56 var offset = touchRadius / 2; | 57 var offset = touchRadius / 2; |
57 | 58 |
58 // Center of cancel button. | 59 // Center of cancel button. |
59 var midX = inputBounds.left + inputBounds.width - 11; | 60 var midX = inputBounds.left + inputBounds.width - 11; |
60 var midY = inputBounds.top + inputBounds.height / 2; | 61 var midY = inputBounds.top + inputBounds.height / 2; |
61 | 62 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 { | 113 { |
113 if (window.testRunner && window.internals && internals.touchNodeAdjusted
ToBestClickableNode) { | 114 if (window.testRunner && window.internals && internals.touchNodeAdjusted
ToBestClickableNode) { |
114 description('Test touch adjustment on a search field with a visible
cancel button.'); | 115 description('Test touch adjustment on a search field with a visible
cancel button.'); |
115 runTouchTests(); | 116 runTouchTests(); |
116 } | 117 } |
117 } | 118 } |
118 runTests(); | 119 runTests(); |
119 </script> | 120 </script> |
120 </body> | 121 </body> |
121 </html> | 122 </html> |
OLD | NEW |