OLD | NEW |
1 <head> | 1 <head> |
2 <style> | 2 <style> |
3 ::selection { background-color: red; } | 3 ::selection { background-color: red; } |
4 </style> | 4 </style> |
5 <script type="text/javascript" charset="utf-8"> | 5 <script type="text/javascript" charset="utf-8"> |
6 function runTest() | 6 function runTest() |
7 { | 7 { |
8 sel.empty(); | 8 sel.empty(); |
9 } | 9 } |
10 </script> | 10 </script> |
11 </head> | 11 </head> |
12 <body onload="runTest()"> | 12 <body onload="runTest()"> |
13 <div><div id="target" style="display: inline-block; width: 100px; height: 50px;"
></div><br></div> | 13 <div><div id="target" style="display: inline-block; width: 100px; height: 50px;"
></div><br></div> |
14 <script> | 14 <script> |
15 var sel = getSelection(); | 15 var sel = getSelection(); |
16 var target = document.getElementById("target"); | 16 var target = document.getElementById("target"); |
17 | 17 |
18 sel.setBaseAndExtent(target, 0, target.parentElement.nextSibling, 0); | 18 sel.setBaseAndExtent(target, 0, target.parentElement.nextSibling, 0); |
19 document.body.offsetTop; | 19 document.body.offsetTop; |
20 target.style.height = "100px"; | 20 target.style.height = "100px"; |
21 </script> | 21 </script> |
OLD | NEW |