Changeset 267476 in webkit
- Timestamp:
- Sep 23, 2020, 8:50:44 AM (6 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 19 edited
-
ChangeLog (modified) (1 diff)
-
editing/deleting/delete-block-merge-contents-025.html (modified) (1 diff)
-
editing/deleting/delete-blockquote-large-offsets.html (modified) (1 diff)
-
editing/execCommand/format-block-typing-style.html (modified) (1 diff)
-
editing/execCommand/insert-nested-lists-in-table.html (modified) (1 diff)
-
editing/execCommand/outdent-selection.html (modified) (1 diff)
-
editing/input/select-all-clear-input-method.html (modified) (1 diff)
-
editing/inserting/insert-list-during-node-removal-crash.html (modified) (1 diff)
-
editing/inserting/insert-list-in-table-assert.html (modified) (1 diff)
-
editing/inserting/insert-list-in-table-cell-04.html (modified) (1 diff)
-
editing/inserting/insert-list-in-table-cell-08.html (modified) (1 diff)
-
editing/inserting/page-zoom-font-size.html (modified) (1 diff)
-
editing/inserting/replace-at-visible-boundary.html (modified) (1 diff)
-
editing/pasteboard/dataTransfer-setData-getData.html (modified) (1 diff)
-
editing/pasteboard/drag-drop-to-data-url.html (modified) (1 diff)
-
editing/pasteboard/paste-blockquote-into-blockquote-2.html (modified) (1 diff)
-
editing/pasteboard/paste-blockquote-into-blockquote-3.html (modified) (1 diff)
-
editing/pasteboard/paste-blockquote-into-blockquote.html (modified) (1 diff)
-
editing/pasteboard/paste-table-cells.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267474 r267476 1 2020-09-23 Darin Adler <darin@apple.com> 2 3 Selection API: Update more tests that depend on WebKit's legacy non-standard behavior to set up the selection 4 https://bugs.webkit.org/show_bug.cgi?id=216844 5 6 Reviewed by Ryosuke Niwa. 7 8 Discovered a batch of editing tests that accidentally rely on non-standard selection 9 behavior to set up the tests. In many cases, the tests were clearly written wrong, like 10 using character offsets but a container that is not a text node. These changes keep the 11 tests testing the same things they are today. 12 13 * editing/deleting/delete-block-merge-contents-025.html: Use the actual number of child 14 nodes rather than 2000000000. 15 * editing/deleting/delete-blockquote-large-offsets.html: Ditto. The "large offsets" in 16 the title of this bug might simply be something that can't actually be done in practice, 17 setting an offset that is much higher than the actual number of children. The old code 18 simply clamped the high value. 19 20 * editing/execCommand/format-block-typing-style.html: Use a 1 as an offset so we are 21 past the child text element, rather than 5, which was presumably an attempt at setting 22 an offset to a particular character, but using the wrong container node. 23 24 * editing/execCommand/insert-nested-lists-in-table.html: Use a computed offset instead 25 of a hardcoded, and too high, value of 3. 26 27 * editing/execCommand/outdent-selection.html: Use a 1 instead of a 2 for an offset on 28 a container node that has only one child. 29 * editing/input/select-all-clear-input-method.html: Use a 3 instead of a 5 for an 30 offset in a container that's a text node containing 3 characters. 31 32 * editing/inserting/insert-list-during-node-removal-crash.html: This one is a little 33 different. The code selected the entire document and used the deleteFromDocument method. 34 That function is specified to not do an end-user "editing" delete, but to literally 35 delete all the nodes. That includes all the script nodes. To fix the test, just select 36 the contents of the body of the document. 37 38 * editing/inserting/insert-list-in-table-assert.html: Use a 0 instead of a 1 39 for an offset inside an empty style element. 40 * editing/inserting/insert-list-in-table-cell-04.html: Use a 1 instead of a 2 41 as the offest for the end of the element, given the element had only one child. 42 * editing/inserting/insert-list-in-table-cell-08.html: Ditto. 43 * editing/inserting/page-zoom-font-size.html: Ditto, 1 instead of 12. 44 45 * editing/inserting/replace-at-visible-boundary.html: Select the image by setting end 46 points before and after it, rather than trying to set offsets inside the image with 47 offsets of 0 and 1, since 1 is an illegal offset in an image with no children. 48 49 * editing/pasteboard/dataTransfer-setData-getData.html: Use a 1 instead of a 4 50 for an offset inside the dragme element, which has one child, which was presumably 51 an attempt at setting an offset to a particular character, but using the wrong 52 container node. 53 * editing/pasteboard/drag-drop-to-data-url.html: Ditto. 54 55 * editing/pasteboard/paste-blockquote-into-blockquote-2.html: Use an offset of 1 56 instead of 3 inside the block element which has no children, which was presumably 57 an attempt at setting an offset to a particular character, but using the wrong 58 container node. 59 60 * editing/pasteboard/paste-blockquote-into-blockquote-3.html: Use a range to set 61 the selection after the endContent <br> element rather than trying to use an 62 offset of 1 inside that element, which has no children. 63 64 * editing/pasteboard/paste-blockquote-into-blockquote.html: Use an offset of 1 65 instead of 3 inside the block element which has no children, which was presumably 66 an attempt at setting an offset to a particular character, but using the wrong 67 container node. 68 69 * editing/pasteboard/paste-table-cells.html: Use an offset of 1 instead of 3 70 inside the table, so the selection is after the table body. Presumably the error 71 is that someone thought that the table row elements were each children of the table. 72 1 73 2020-09-23 Philippe Normand <pnormand@igalia.com> 2 74 -
trunk/LayoutTests/editing/deleting/delete-block-merge-contents-025.html
r120173 r267476 10 10 <div contenteditable="true" id="div"><hkern><span contenteditable="false"><dl>000A0<script> 11 11 var sel = window.getSelection(); 12 sel.setPosition(div, 2000000000);12 sel.setPosition(div, div.childNodes.length); 13 13 document.execCommand("Delete"); 14 14 </script> -
trunk/LayoutTests/editing/deleting/delete-blockquote-large-offsets.html
r120173 r267476 10 10 testRunner.dumpAsText(); 11 11 12 window.getSelection().setPosition(document.getElementById('blockquote'), 2000000000);12 window.getSelection().setPosition(document.getElementById('blockquote'), document.getElementById('blockquote').childNodes.length); 13 13 document.execCommand("Delete"); 14 14 -
trunk/LayoutTests/editing/execCommand/format-block-typing-style.html
r74601 r267476 9 9 10 10 var test = document.getElementById('test'); 11 window.getSelection().setPosition(test, 5);11 window.getSelection().setPosition(test, 1); 12 12 13 13 document.execCommand('Bold', false, null); -
trunk/LayoutTests/editing/execCommand/insert-nested-lists-in-table.html
r237976 r267476 32 32 Markup.dump("editor", "After inserting a nested list below the outer list"); 33 33 34 getSelection().setPosition(garply.childNodes[0], 3);34 getSelection().setPosition(garply.childNodes[0], garply.childNodes[0].childNodes.length); 35 35 document.execCommand("InsertNestedOrderedList"); 36 36 Markup.dump("editor", "After inserting another list under a table cell"); -
trunk/LayoutTests/editing/execCommand/outdent-selection.html
r88699 r267476 28 28 var p2 = document.getElementById("item2"); 29 29 s.setPosition(p1, 0); 30 s.setBaseAndExtent(p1, 0, p2, 2);30 s.setBaseAndExtent(p1, 0, p2, 1); 31 31 document.execCommand("Outdent", false, ""); 32 32 Markup.description("This test uses the execCommand to Outdent the text below.\n" + -
trunk/LayoutTests/editing/input/select-all-clear-input-method.html
r120173 r267476 12 12 var container = document.getElementById('container'); 13 13 container.firstChild.focus(); 14 getSelection().setPosition(container.firstChild.firstChild, 5);14 getSelection().setPosition(container.firstChild.firstChild, 3); 15 15 if (window.textInputController) { 16 16 Markup.description(document.getElementsByTagName('p')[0].textContent); -
trunk/LayoutTests/editing/inserting/insert-list-during-node-removal-crash.html
r259027 r267476 17 17 window.onload = () => { 18 18 TD.addEventListener("DOMNodeRemovedFromDocument", DomNodeEventHandler); 19 document.execCommand("selectAll", false);20 window.getSelection().deleteFromDocument();19 getSelection().setBaseAndExtent(document.body, 0, document.body, document.body.childNodes.length); 20 getSelection().deleteFromDocument(); 21 21 } 22 22 </script> -
trunk/LayoutTests/editing/inserting/insert-list-in-table-assert.html
r259899 r267476 6 6 7 7 window.onload = () => { 8 window.getSelection().setBaseAndExtent(TH,1,STYLE, 1);8 window.getSelection().setBaseAndExtent(TH,1,STYLE,0); 9 9 document.execCommand("insertUnorderedList", false); 10 10 -
trunk/LayoutTests/editing/inserting/insert-list-in-table-cell-04.html
r219914 r267476 7 7 8 8 var e = document.getElementById("element"); 9 setSelectionCommand(e, 0, e, 2);9 setSelectionCommand(e, 0, e, 1); 10 10 Markup.dump('container', 'Before'); 11 11 -
trunk/LayoutTests/editing/inserting/insert-list-in-table-cell-08.html
r219914 r267476 7 7 8 8 var e = document.getElementById("element"); 9 setSelectionCommand(e, 0, e, 2);9 setSelectionCommand(e, 0, e, 1); 10 10 Markup.dump('container', 'Before'); 11 11 -
trunk/LayoutTests/editing/inserting/page-zoom-font-size.html
r71252 r267476 12 12 var target = document.getElementById("test"); 13 13 var selection = window.getSelection(); 14 selection.setPosition(target, 1 2);14 selection.setPosition(target, 1); 15 15 document.execCommand("insertHTML", false, "<span style='font-size: 16px' class='Apple-style-span'>This font is size 16px.</span>"); 16 16 -
trunk/LayoutTests/editing/inserting/replace-at-visible-boundary.html
r120173 r267476 24 24 25 25 // Now try inserting HTML over the image. 26 execSetSelectionCommand(image, 0, image, 1); 26 var imageRange = new Range; 27 imageRange.selectNode(image); 28 execSetSelectionCommand(imageRange.startContainer, imageRange.startOffset, imageRange.endContainer, imageRange.endOffset); 27 29 document.execCommand("inserthtml", false, "<span id='red' style='color:red'>red text</span>"); 28 30 -
trunk/LayoutTests/editing/pasteboard/dataTransfer-setData-getData.html
r223195 r267476 57 57 function dragOntoDragTarget() { 58 58 var e = document.getElementById("dragme"); 59 window.getSelection().setBaseAndExtent(e, 0, e, 4);59 window.getSelection().setBaseAndExtent(e, 0, e, 1); 60 60 x = e.offsetLeft + 10; 61 61 y = e.offsetTop + e.offsetHeight / 2; -
trunk/LayoutTests/editing/pasteboard/drag-drop-to-data-url.html
r120173 r267476 28 28 function dragDropIt() { 29 29 var e = document.getElementById("dragme"); 30 window.getSelection().setBaseAndExtent(e, 0, e, 4);30 window.getSelection().setBaseAndExtent(e, 0, e, 1); 31 31 x = e.offsetLeft + 10; 32 32 y = e.offsetTop + e.offsetHeight / 2; -
trunk/LayoutTests/editing/pasteboard/paste-blockquote-into-blockquote-2.html
r87775 r267476 20 20 var block = document.getElementById("block"); 21 21 22 sel.setPosition(block, 3);22 sel.setPosition(block, 1); 23 23 document.execCommand("InsertHTML", false, "<span><blockquote type='cite'><blockquote type='cite'><div>Two</div><div>Three</div></blockquote></blockquote></span>"); 24 24 Markup.description("This tests pasting a nested blockquote into a blockquote. " -
trunk/LayoutTests/editing/pasteboard/paste-blockquote-into-blockquote-3.html
r86817 r267476 24 24 var sel = window.getSelection(); 25 25 var endContent = document.getElementById("endContent"); 26 sel.setPosition(endContent, 1); 26 var range = new Range; 27 range.selectNode(endContent); 28 sel.setPosition(range.endContainer, range.endOffset); 27 29 document.execCommand("InsertHTML", false, "<blockquote type='cite'><div>two</div></blockquote>"); 28 30 -
trunk/LayoutTests/editing/pasteboard/paste-blockquote-into-blockquote.html
r92580 r267476 18 18 var block = document.getElementById("block"); 19 19 20 sel.setPosition(block, 3);20 sel.setPosition(block, 1); 21 21 document.execCommand("InsertHTML", false, "<span><blockquote type='cite'><div>Two</div><div>Three</div></blockquote></span>"); 22 22 -
trunk/LayoutTests/editing/pasteboard/paste-table-cells.html
r144956 r267476 28 28 var t1 = document.getElementById("test1"); 29 29 var t2 = document.getElementById("test2"); 30 setSelectionCommand(t1, 0, t2, 3);30 setSelectionCommand(t1, 0, t2, 1); 31 31 copyCommand(); 32 32 Markup.dump('root', 'After copy');
Note:
See TracChangeset
for help on using the changeset viewer.