| <!doctype html> |
| <style> |
| body { overflow:hidden; } |
| .editing { |
| border: solid red 50px; |
| font-size: 24px; |
| line-height: 48px; |
| padding: 24px; |
| margin: 64px; |
| width: 600px; |
| } |
| </style> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <div contenteditable class="editing"> |
| <br> |
| <br> |
| Four score and seven years ago our fathers brought forth, upon this |
| continent, a new nation, conceived in Liberty, and dedicated to the |
| proposition that all men are created equal. Now we are engaged in a |
| great civil war, testing whether that nation, or any nation, so |
| conceived, and so dedicated, can long endure. We are met here on a great |
| battlefield of that war. We have come to dedicate a portion of it as a |
| final resting place for those who here gave their lives that that nation |
| might live. It is altogether fitting and proper that we should do this. |
| Four score and seven years ago our fathers brought forth, upon this |
| continent, a new nation, conceived in Liberty, and dedicated to the |
| proposition that all men are created equal. |
| <br> |
| <br> |
| <div id="sample"></div> |
| </div> |
| <div id="log"></div> |
| <script> |
| test(function() { |
| var selection = window.getSelection(); |
| var sample = document.getElementById('sample'); |
| selection.collapse(sample, 0); |
| document.execCommand('selectAll'); |
| var editing = document.querySelector('.editing'); |
| assert_equals(selection.anchorNode, editing, 'anchorNode'); |
| assert_equals(selection.anchorOffset, 1, 'anchorOffset'); |
| assert_equals(selection.focusNode, editing, 'focusNode'); |
| assert_equals(selection.focusOffset, 6, 'focusOffset'); |
| }, 'overflow:hidden does not affect select-ability'); |
| </script> |