Changeset 233885 in webkit
- Timestamp:
- Jul 17, 2018 1:48:49 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r233882 r233885 1 2018-07-17 Javier Fernandez <jfernandez@igalia.com> 2 3 Delete content of a single cell table should not delete the whole table 4 https://bugs.webkit.org/show_bug.cgi?id=173117 5 6 Reviewed by Ryosuke Niwa. 7 8 Tests to verify that single-cell tables are not deleted when their 9 last character is deleted, unless it was previously selected by 10 the user. 11 12 Changes two expected files to adapt them to the new logic. 13 14 * LayoutTests/editing/deleting/deleting-relative-positioned-special-element-expected.txt: The paragraph is not deleted, even if it's empty. The paragraphs above are not merged, which was the goal of the test. 15 * editing/deleting/delete-last-char-in-table-expected.txt: The table is not removed, even if it's empty. The formatted elements are deleted, which was the goal of the test. 16 * editing/deleting/backspace-delete-last-char-in-table-expected.txt: Added. 17 * editing/deleting/backspace-delete-last-char-in-table.html: Added. 18 * editing/deleting/forward-delete-last-char-in-table-expected.txt: Added. 19 * editing/deleting/forward-delete-last-char-in-table.html: Added. 20 * editing/deleting/select-and-delete-last-char-in-table-expected.txt: Added. 21 * editing/deleting/select-and-delete-last-char-in-table.html: Added. 22 1 23 2018-07-16 Simon Fraser <simon.fraser@apple.com> 2 24 -
trunk/LayoutTests/editing/deleting/delete-last-char-in-table-expected.txt
r87466 r233885 3 3 4 4 PASS 5 execDeleteCommand: < br>5 execDeleteCommand: <table style="border-collapse:collapse"><tbody><tr><td id="cursor"><br></td></tr></tbody></table> -
trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element-expected.txt
r231630 r233885 15 15 | <p> 16 16 | "1" 17 | <#selection-caret> 18 | <br> 17 | <p> 18 | id="paragraphToDelete" 19 | <#selection-caret> 20 | <br> 19 21 | <p> 20 22 | "3" -
trunk/Source/WebCore/ChangeLog
r233883 r233885 1 2018-07-17 Javier Fernandez <jfernandez@igalia.com> 2 3 Delete content of a single cell table should not delete the whole table 4 https://bugs.webkit.org/show_bug.cgi?id=173117 5 6 Reviewed by Ryosuke Niwa. 7 8 We should not extend selection looking for special elements if the 9 delete operation has been triggered by a caret based selection. 10 11 This change is based on a recent [1] resolution of the Editing TF, 12 which acknowledges that behavior of single-cell tables must be the 13 same that multi-cell tables and even if the last character is 14 deleted, we should not delete the whole table structure. 15 16 A different case would be when the user actively selects the whole 17 content of a table; in this case, as we do in multi-cell tables, 18 the structure of single-cell tables should be deleted together 19 with the content. 20 21 [1] https://github.com/w3c/editing/issues/163 22 23 Tests: editing/deleting/backspace-delete-last-char-in-table.html 24 editing/deleting/forward-delete-last-char-in-table.html 25 editing/deleting/select-and-delete-last-char-in-table.html 26 27 * editing/TypingCommand.cpp: 28 (WebCore::TypingCommand::deleteKeyPressed): 29 (WebCore::TypingCommand::forwardDeleteKeyPressed): 30 1 31 2018-07-16 Megan Gardner <megan_gardner@apple.com> 2 32 -
trunk/Source/WebCore/editing/TypingCommand.cpp
r225117 r233885 650 650 VisibleSelection selectionToDelete; 651 651 VisibleSelection selectionAfterUndo; 652 bool expandForSpecialElements = !endingSelection().isCaret(); 652 653 653 654 switch (endingSelection().selectionType()) { … … 761 762 if (m_openedByBackwardDelete) 762 763 setStartingSelection(selectionAfterUndo); 763 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete );764 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete, /* mergeBlocksAfterDelete*/ true, /* replace*/ false, expandForSpecialElements, /*sanitizeMarkup*/ true); 764 765 setSmartDelete(false); 765 766 typingAddedToOpenCommand(DeleteKey); … … 775 776 VisibleSelection selectionToDelete; 776 777 VisibleSelection selectionAfterUndo; 778 bool expandForSpecialElements = !endingSelection().isCaret(); 777 779 778 780 switch (endingSelection().selectionType()) { … … 863 865 // make undo select what was deleted 864 866 setStartingSelection(selectionAfterUndo); 865 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete );867 CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete, /* mergeBlocksAfterDelete*/ true, /* replace*/ false, expandForSpecialElements, /*sanitizeMarkup*/ true); 866 868 setSmartDelete(false); 867 869 typingAddedToOpenCommand(ForwardDeleteKey);
Note: See TracChangeset
for help on using the changeset viewer.