| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <div contenteditable id="anchor"><select><option>One</option></select>blaa</div> | 4 <div contenteditable id="anchor"><select><option>One</option></select>blaa</div> |
| 5 <div id="log"></div> | 5 <div id="log"></div> |
| 6 <script> | 6 <script> |
| 7 test(function() { | 7 test(function() { |
| 8 var selection = window.getSelection(); | 8 var selection = window.getSelection(); |
| 9 var select = document.querySelector('select'); | 9 var select = document.querySelector('select'); |
| 10 selection.collapse(select, 0); | 10 selection.collapse(select, 0); |
| 11 | 11 |
| 12 var anchor = document.getElementById('anchor'); | 12 var anchor = document.getElementById('anchor'); |
| 13 assert_equals(selection.anchorNode, anchor, 'anchorNode'); | 13 assert_equals(selection.anchorNode, select, 'DOM anchorNode'); |
| 14 assert_equals(selection.anchorOffset, 0, 'anchorOffset'); | 14 assert_equals(selection.anchorOffset, 0, 'DOM anchorOffset'); |
| 15 assert_equals(selection.focusNode, anchor, 'focusNode'); | 15 assert_equals(selection.focusNode, select, 'DOM focusNode'); |
| 16 assert_equals(selection.focusOffset, 0, 'focusOffset'); | 16 assert_equals(selection.focusOffset, 0, 'DOM focusOffset'); |
| 17 }, 'can not place caret inside SELECT element'); | 17 |
| 18 assert_exists(window, 'internals'); |
| 19 assert_equals(internals.visibleSelectionAnchorNode, anchor, 'Canonicalized a
nchorNode'); |
| 20 assert_equals(internals.visibleSelectionAnchorOffset, 0, 'Canonicalized anch
orOffset'); |
| 21 assert_equals(internals.visibleSelectionFocusNode, anchor, 'Canonicalized fo
cusNode'); |
| 22 assert_equals(internals.visibleSelectionFocusOffset, 0, 'Canonicalized focus
Offset'); |
| 23 }, 'can not place canonicalized caret inside SELECT element'); |
| 18 </script> | 24 </script> |
| OLD | NEW |