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 <script src="../assert_selection.js"></script> | 4 <script src="../assert_selection.js"></script> |
5 <script> | 5 <script> |
6 // This tests for a bug in GMail's Editor, they try to extract the contents | 6 // This tests for a bug in GMail's Editor, they try to extract the contents |
7 // of a range that has had it's contents removed from the document by an | 7 // of a range that has had it's contents removed from the document by an |
8 // editing command. Since the bug 43017 requires WebKit does not remove | 8 // editing command. Since the bug 43017 requires WebKit does not remove |
9 // anchor elements, div should be empty after the extraction. We currently | 9 // anchor elements, div should be empty after the extraction. We currently |
10 // leave anchor element in the div due to the Bug 47916. | 10 // leave anchor element in the div due to the Bug 47916. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 selection.document.execCommand('selectAll'); | 44 selection.document.execCommand('selectAll'); |
45 selection.document.execCommand('removeFormat'); | 45 selection.document.execCommand('removeFormat'); |
46 var result = range.extractContents(); | 46 var result = range.extractContents(); |
47 var element = selection.document.createElement('div'); | 47 var element = selection.document.createElement('div'); |
48 element.appendChild(result); | 48 element.appendChild(result); |
49 assert_equals(element.innerHTML, | 49 assert_equals(element.innerHTML, |
50 'dog<a href="http://example.com/">food</a>'); | 50 'dog<a href="http://example.com/">food</a>'); |
51 }, | 51 }, |
52 [ | 52 [ |
53 '<div contenteditable id="div">', | 53 '<div contenteditable id="div">', |
54 '^<a href="http://example.com/">|</a>', | 54 '|<a href="http://example.com/"></a>', |
55 '</div>', | 55 '</div>', |
56 ].join('')), | 56 ].join('')), |
57 'Range#extractContents() extracts A with anchor text but leaves A.'); | 57 'Range#extractContents() extracts A with anchor text but leaves A.'); |
58 </script> | 58 </script> |
OLD | NEW |