OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Touch Adjustment : Adjust context-menu to selectable text - bug 94101
</title> | 4 <title>Touch Adjustment : Adjust context-menu to selectable text - bug 94101
</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 #sandbox { | 8 #sandbox { |
9 position: absolute; | 9 position: absolute; |
10 top: 0px; | 10 top: 0px; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Set editing-behaviour mac, so context-menu gesture triggers selection
s. | 43 // Set editing-behaviour mac, so context-menu gesture triggers selection
s. |
44 internals.settings.setEditingBehavior('mac'); | 44 internals.settings.setEditingBehavior('mac'); |
45 // Check the context-menu is adjusted to the selectable text. | 45 // Check the context-menu is adjusted to the selectable text. |
46 testTouchPointContextMenu(touchPoint(100, 30, 20), "'Text text text.'",
true); | 46 testTouchPointContextMenu(touchPoint(100, 30, 20), "'Text text text.'",
true); |
47 } | 47 } |
48 | 48 |
49 function runTests() | 49 function runTests() |
50 { | 50 { |
51 if (window.testRunner && window.internals && internals.touchNodeAdjusted
ToBestContextMenuNode) { | 51 if (window.testRunner && window.internals && internals.touchNodeAdjusted
ToBestContextMenuNode) { |
52 description('Test touch adjustment for context-menu gestures with au
tomatic select behaviour.'); | 52 description('Test touch adjustment for context-menu gestures with au
tomatic select behaviour.'); |
| 53 // Mouse events only work after an initial layout |
| 54 document.body.offsetLeft; |
53 testAdjustedTouches(); | 55 testAdjustedTouches(); |
54 e.sandbox.style.display = 'none'; | 56 e.sandbox.style.display = 'none'; |
55 } | 57 } |
56 } | 58 } |
57 runTests(); | 59 runTests(); |
58 </script> | 60 </script> |
59 | 61 |
60 <script src="../fast/js/resources/js-test-post.js"></script> | 62 <script src="../fast/js/resources/js-test-post.js"></script> |
61 | 63 |
62 </body> | 64 </body> |
63 </html> | 65 </html> |
OLD | NEW |