OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../../resources/js-test.js"></script> |
| 5 <link rel="stylesheet" href="../resources/touch-hover-active-tests.css"> |
| 6 <style> |
| 7 #box { |
| 8 width: 300px; |
| 9 height: 50px; |
| 10 } |
| 11 |
| 12 #overflowBox { |
| 13 width: 300px; |
| 14 height: 600px; |
| 15 } |
| 16 |
| 17 #container { |
| 18 width: 300px; |
| 19 height: 50px; |
| 20 overflow-y: scroll; |
| 21 overflow-x: hidden; |
| 22 margin: 10px 0 10px 0; |
| 23 } |
| 24 |
| 25 #frame { |
| 26 width: 200px; |
| 27 height: 50px; |
| 28 } |
| 29 </style> |
| 30 </head> |
| 31 <body> |
| 32 |
| 33 <select id="combobox" class="touch-interactive"> |
| 34 <option value="1"> One </option> |
| 35 <option value="2"> Two </option> |
| 36 <option value="3"> Three </option> |
| 37 <option value="4"> Four </option> |
| 38 <option value="5"> Five </option> |
| 39 <option value="6"> Six </option> |
| 40 <option value="7"> Sever </option> |
| 41 <option value="8"> Eight </option> |
| 42 <option value="9"> Nine </option> |
| 43 <option value="10"> Ten </option> |
| 44 <option value="11"> Eleven </option> |
| 45 <option value="12"> Twelve </option> |
| 46 <option value="13"> Thirteen </option> |
| 47 <option value="14"> Fourteen </option> |
| 48 <option value="15"> Fifteen </option> |
| 49 <option value="16"> Sixteen </option> |
| 50 <option value="17"> Seventeen </option> |
| 51 <option value="18"> Eighteen </option> |
| 52 <option value="19"> Nineteen </option> |
| 53 <option value="20"> Twenty </option> |
| 54 </select> |
| 55 |
| 56 <select id="listbox" class="touch-interactive" multiple="5"> |
| 57 <option value="1"> One </option> |
| 58 <option value="2"> Two </option> |
| 59 <option value="3"> Three </option> |
| 60 <option value="4"> Four </option> |
| 61 <option value="5"> Five </option> |
| 62 <option value="6"> Six </option> |
| 63 <option value="7"> Sever </option> |
| 64 <option value="8"> Eight </option> |
| 65 <option value="9"> Nine </option> |
| 66 <option value="10"> Ten </option> |
| 67 </select> |
| 68 |
| 69 <input type="text" id="textbox" class="touch-interactive" value="The input eleme
nt represents a typed data field, usually with a form control to allow the user
to edit the data."/> |
| 70 |
| 71 <textarea id="textarea" class="touch-interactive" rows="3"> |
| 72 The textarea element represents a multiline plain text edit control for the elem
ent's raw value. The contents of the control represent the control's default val
ue. |
| 73 |
| 74 The raw value of a textarea control must be initially the empty string. |
| 75 </textarea> |
| 76 |
| 77 <iframe id="frame" src="resources/gesture-tap-down-iframe.html"></iframe> |
| 78 |
| 79 <p id="description"></p> |
| 80 <p>See http://crbug.com/316974 for details</p> |
| 81 |
| 82 <div id="console" style="clear:both; float: left"></div> |
| 83 |
| 84 <script src="../resources/touch-hover-active-tests.js"></script> |
| 85 <script> |
| 86 var combobox = document.getElementById("combobox"); |
| 87 var listbox = document.getElementById("listbox"); |
| 88 var textbox = document.getElementById("textbox"); |
| 89 var textarea = document.getElementById("textarea"); |
| 90 var frame = document.getElementById("frame"); |
| 91 var frameBody; |
| 92 |
| 93 if (window.internals) { |
| 94 internals.settings.setViewportEnabled(true); |
| 95 internals.settings.setViewportMetaEnabled(true); |
| 96 } |
| 97 |
| 98 description("Tests gesture tapdown behaviour on different form elements."); |
| 99 |
| 100 function runTests() |
| 101 { |
| 102 if (!window.eventSender) { |
| 103 debug('This test requires DRT.'); |
| 104 return; |
| 105 } |
| 106 |
| 107 if (!eventSender.gestureTapDown |
| 108 || !eventSender.gestureShowPress) { |
| 109 debug('Gesture events are not supported by this platform'); |
| 110 return; |
| 111 } |
| 112 |
| 113 // Insert meta tag after viewport has been enabled via internals |
| 114 var meta = document.createElement('meta'); |
| 115 meta.name = 'viewport'; |
| 116 meta.content = 'width=device-width, initial-scale=1, user-scalable=no'; |
| 117 document.head.appendChild(meta); |
| 118 |
| 119 // Frame should be ready now |
| 120 frameBody = frame.contentDocument.body; |
| 121 |
| 122 debug("Scroll and Pinch are disabled on the page"); |
| 123 hasEarlyShowPress("getHoverActiveState(combobox)", elementCenter(combobox),
true); |
| 124 hasEarlyShowPress("getHoverActiveState(listbox)", elementCenter(listbox), fa
lse); |
| 125 hasEarlyShowPress("getHoverActiveState(textbox)", elementCenter(textbox), fa
lse); |
| 126 hasEarlyShowPress("getHoverActiveState(textarea)", elementCenter(textarea),
false); |
| 127 hasEarlyShowPress("getHoverActiveState(frameBody)", elementCenter(frame), fa
lse); |
| 128 } |
| 129 |
| 130 window.onload = runTests; |
| 131 </script> |
| 132 </body> |
| 133 </html> |
| 134 |
OLD | NEW |