haikuwebkit/LayoutTests/editing/deleting/deleting-relative-positione...

22 lines
700 B
HTML
Raw Permalink Normal View History

contentEditable with "position:relative" paragraphs is buggy https://bugs.webkit.org/show_bug.cgi?id=33950 Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-10-10 Reviewed by Darin Adler. Source/WebCore: When paragraph is positioned(relative/absolute/fixed) then deleting that paragraph cause wrong merging of other(below) paragraphs. This is happening because positioned element is treated as special element and on deletion complete paragraph element is removed. The ranges become paragraph. This issue happens when all the content of special element are deleted. So the merging of paragraph is avoided in this scenario. Test: editing/deleting/deleting-relative-positioned-special-element.html * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::initializeStartEnd):Avoid merging block when special candidate are included in deletion range LayoutTests: LayoutTests: Added a testcase to verify that when paragraph is relative positioned then deleting the all content of paragraph should not incorrectly collapse the others(below) paragraphs. And Rebaseline the test expectation. * editing/deleting/5546763-expected.txt: Updated. * editing/deleting/deleting-relative-positioned-special-element-expected.txt: Added. * editing/deleting/deleting-relative-positioned-special-element.html: Added. * editing/unsupported-content/table-delete-001.html: Adjusted to dump as markup. * editing/unsupported-content/table-delete-003.html: Adjusted to dump as markup. Below tests had wrong cursor position previously now corrected and both expected file has been changed to markup dump. * platform/mac/editing/unsupported-content/table-delete-001-expected.txt: * platform/mac/editing/unsupported-content/table-delete-003-expected.txt: Canonical link: https://commits.webkit.org/140761@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-11 06:18:44 +00:00
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/dump-as-markup.js"></script>
<style> p { position: relative; } </style>
</head>
<body>
<div id="container" contenteditable><p>1</p><p id="paragraphToDelete">2</p><p>3</p><p>4</p></div>
<script>
Markup.description('This test is for a bug when delete commands is applied on paragraph with positioning other than static then the below paragraph are incorrectly collapsed, 3 & 4 should not be merged as 43');
getSelection().collapse(paragraphToDelete, 1);
Markup.dump('container', 'BeforeDeletion');
document.execCommand("Delete", false, null);
Markup.dump('container', 'AfterDeletion');
</script>
<body>
</html>