4 <title>Touch Adjustment : Adjust context-menu to selectable text - bug
94101</title>
5 <script src=
"../resources/ahem.js"></script>
6 <script src=
"../resources/js-test.js"></script>
7 <script src=
"resources/touchadjustment.js"></script>
25 <p id=p1
><span id=span1
>Text text text.
</span>
28 <p id='description'
></p>
29 <div id='console'
></div>
32 // Set up shortcut access to elements
34 ['sandbox', 'p1', 'span1'].forEach(function(a
) {
35 e
[a
] = document
.getElementById(a
);
38 function testAdjustedTouches()
40 // Set editing-behaviour to win, so context-menu gesture does not trigger selections.
41 internals
.settings
.setEditingBehavior('win');
42 // Check the context-menu is not adjusted to the selectable text.
43 testTouchPointContextMenu(touchPoint(100, 30, 20), null, true);
44 // Set editing-behaviour mac, so context-menu gesture triggers selections.
45 internals
.settings
.setEditingBehavior('mac');
46 // Check the context-menu is adjusted to the selectable text.
47 testTouchPointContextMenu(touchPoint(100, 30, 20), "'Text text text.'", true);
52 if (window
.testRunner
&& window
.internals
&& internals
.touchNodeAdjustedToBestContextMenuNode
) {
53 description('Test touch adjustment for context-menu gestures with automatic select behaviour.');
54 testAdjustedTouches();
55 e
.sandbox
.style
.display
= 'none';