OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
5 <link rel="stylesheet" type="text/css" href="resources/extend-selection.css" /> | 5 <link rel="stylesheet" type="text/css" href="resources/extend-selection.css" /> |
6 <script src="resources/extend-selection.js"></script> | 6 <script src="resources/extend-selection.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <pre id="console"></pre> | 9 <pre id="console"></pre> |
10 <script> | 10 <script> |
11 if (window.internals) | |
12 internals.settings.setEditingBehavior("mac"); | |
13 | |
14 function runSelectionTestsWithGranularityForEnclosingBlock(testNodes, granularit
y) | 11 function runSelectionTestsWithGranularityForEnclosingBlock(testNodes, granularit
y) |
15 { | 12 { |
16 for (var i = 0; i < testNodes.length; ++i) { | 13 for (var i = 0; i < testNodes.length; ++i) { |
17 getSelection().setPosition(testNodes[i], 0); | 14 getSelection().setPosition(testNodes[i], 0); |
18 | 15 |
19 log("Test " + (i + 1) + ", LTR:\n"); | 16 log("Test " + (i + 1) + ", LTR:\n"); |
20 log(" Extending right: "); | 17 log(" Extending right: "); |
21 extendAndLogSelectionWithinBlock("right", granularity, "mac"); | 18 extendAndLogSelectionWithinBlock("right", granularity, "win"); |
22 | 19 |
23 log(" Extending left: "); | 20 log(" Extending left: "); |
24 extendAndLogSelectionWithinBlock("left", granularity, "mac"); | 21 extendAndLogSelectionWithinBlock("left", granularity, "win"); |
25 } | 22 } |
26 } | 23 } |
27 | 24 |
| 25 if (window.internals) |
| 26 internals.settings.setEditingBehavior("win"); |
28 log("\n\n\nExtending by character\n"); | 27 log("\n\n\nExtending by character\n"); |
29 runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "
character"); | 28 runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "
character"); |
30 | 29 |
31 log("\n\n\n\n\nExtending by word\n"); | 30 log("\n\n\n\n\nExtending by word\n"); |
32 runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "
word"); | 31 runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "
word"); |
33 </script> | 32 </script> |
34 </body> | 33 </body> |
OLD | NEW |