Changeset 157292 in webkit
- Timestamp:
- Oct 10, 2013 11:18:44 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r157291 r157292 1 2013-10-10 Santosh Mahto <santosh.ma@samsung.com> 2 3 contentEditable with "position:relative" paragraphs is buggy 4 https://bugs.webkit.org/show_bug.cgi?id=33950 5 6 Reviewed by Darin Adler. 7 8 LayoutTests: 9 10 Added a testcase to verify that when paragraph is relative positioned 11 then deleting the all content of paragraph should not incorrectly collapse the 12 others(below) paragraphs. 13 And Rebaseline the test expectation. 14 15 * editing/deleting/5546763-expected.txt: Updated. 16 * editing/deleting/deleting-relative-positioned-special-element-expected.txt: Added. 17 * editing/deleting/deleting-relative-positioned-special-element.html: Added. 18 * editing/unsupported-content/table-delete-001.html: Adjusted to dump 19 as markup. 20 * editing/unsupported-content/table-delete-003.html: Adjusted to dump 21 as markup. 22 23 Below tests had wrong cursor position previously now corrected and 24 both expected file has been changed to markup dump. 25 * platform/mac/editing/unsupported-content/table-delete-001-expected.txt: 26 * platform/mac/editing/unsupported-content/table-delete-003-expected.txt: 27 1 28 2013-10-10 Alexey Proskuryakov <ap@apple.com> 2 29 -
trunk/LayoutTests/editing/deleting/5546763-expected.txt
r96257 r157292 6 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 7 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > A > DIV > DIV > BODY > HTML > #document 8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 2 ofDIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 9 9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 10 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/editing/unsupported-content/table-delete-001.html
r12359 r157292 7 7 font-size: 24px; 8 8 } 9 .explanation {10 border: 4px solid blue;11 padding: 16px;12 font-size: 18px;13 margin-bottom: 10px;14 }15 .scenario:first-line { font-weight: bold; font-size: 24px; }16 .expected:first-line { font-weight: bold; font-size: 24px; }17 .results { margin-bottom: 10px; border: 2px solid green; font-size: 24px; }18 9 </style> 10 19 11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> 20 21 <script> 22 23 function editingTest() { 24 moveSelectionForwardByLineCommand(); 25 for (i = 0; i < 18; i++) 26 extendSelectionForwardByCharacterCommand(); 27 deleteCommand(); 28 } 29 30 </script> 12 <script src="../../resources/dump-as-markup.js"></script> 31 13 32 14 <title>Editing Test</title> … … 34 16 <body> 35 17 36 <div class="explanation">37 <div class="scenario">38 Tests:39 <br>40 Our ability to "edit around" content the HTML editing code does not yet handle very well.41 <br><i>For this test: </i>Select and delete a table.42 </div>43 <br>44 <div class="expected">45 Expected Results:46 <br>47 The content in the red box must exactly match the content in the green box (except for the border color).48 <br><i>For this test: </i>Only table should get deleted.49 Surrounding content that is not selected should (obviously) not be affected.50 </div>51 </div>52 53 <div class="results">54 beforeafter55 </div>56 57 18 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;"> 58 19 <div id="test" class="editing"> 59 before<table border="1"> 20 First 21 <table border="1"> 60 22 <tr> 61 23 <td>1</td> … … 74 36 </tr> 75 37 </table> 76 after 38 Second 77 39 </div> 78 40 </div> 79 41 80 42 <script> 81 runEditingTest(); 43 Markup.description('For this test Select and delete a table. Expected Results: Only table should get deleted.Surrounding content that is not selected should (obviously) not be affected.') 44 45 var element = document.getElementById("test"); 46 getSelection().collapse(element, 0); 47 moveSelectionForwardByLineCommand(); 48 for (i = 0; i < 18; i++) 49 extendSelectionForwardByCharacterCommand(); 50 Markup.dump('root', 'BeforeDeletion'); 51 52 deleteCommand(); 53 Markup.dump('root', 'AfterDeletion'); 82 54 </script> 83 55 -
trunk/LayoutTests/editing/unsupported-content/table-delete-003.html
r22057 r157292 7 7 font-size: 24px; 8 8 } 9 .explanation {10 border: 4px solid blue;11 padding: 16px;12 font-size: 18px;13 margin-bottom: 10px;14 }15 .scenario:first-line { font-weight: bold; font-size: 24px; }16 .expected:first-line { font-weight: bold; font-size: 24px; }17 .results { margin-bottom: 10px; border: 2px solid green; font-size: 24px; }18 9 </style> 10 19 11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script> 20 21 <script> 22 23 function editingTest() { 24 for (i = 0; i < 9; i++) 25 extendSelectionForwardByLineCommand(); 26 extendSelectionForwardByCharacterCommand(); 27 deleteCommand(); 28 } 29 30 </script> 12 <script src="../../resources/dump-as-markup.js"></script> 31 13 32 14 <title>Editing Test</title> … … 34 16 <body> 35 17 36 <div class="explanation">37 <div class="scenario">38 Tests:39 <br>40 Our ability to "edit around" content the HTML editing code does not yet handle very well.41 <br><i>For this test: </i>Select and delete a list and some surrounding content.42 </div>43 <br>44 <div class="expected">45 Expected Results:46 <br>47 The content in the red box must exactly match the content in the green box (except for the border color).48 <br><i>For this test: </i>Only selected content should get deleted.49 Surrounding content that is not selected should (obviously) not be affected.50 <br><b>There is a bug: the caret ends up in the wrong position, it should be in the empty paragraph.51 </div>52 </div>53 54 <div class="results">55 <br>56 after57 </div>58 59 18 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;"> 60 19 <div id="test" class="editing"> 61 before 20 First 62 21 <table border="1"> 63 22 <tr> … … 77 36 </tr> 78 37 </table> 79 after 38 Second 80 39 </div> 81 40 </div> 82 41 83 42 <script> 84 runEditingTest(); 43 Markup.description('For this test Select and delete a table. Expected Results:Only table should get deleted.Surrounding content that is not selected should (obviously) not be affected.') 44 45 var element = document.getElementById("test"); 46 getSelection().collapse(element, 0); 47 for (i = 0; i < 9; i++) 48 extendSelectionForwardByLineCommand(); 49 extendSelectionForwardByCharacterCommand(); 50 Markup.dump('root', 'BeforeDeletion'); 51 52 deleteCommand(); 53 Markup.dump('root', 'AfterDeletion'); 85 54 </script> 86 55 -
trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-001-expected.txt
r96264 r157292 1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document 2 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 12 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 15 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 16 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 17 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 18 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 19 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 20 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 21 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 22 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 23 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > TD > TR > TBODY > TABLE > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document 24 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 25 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 26 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 27 layer at (0,0) size 800x600 28 RenderView at (0,0) size 800x600 29 layer at (0,0) size 800x600 30 RenderBlock {HTML} at (0,0) size 800x600 31 RenderBody {BODY} at (8,8) size 784x584 32 RenderBlock {DIV} at (0,0) size 784x250 [border: (4px solid #0000FF)] 33 RenderBlock {DIV} at (20,20) size 744x72 34 RenderText {#text} at (0,0) size 67x28 35 text run at (0,0) width 67: "Tests: " 36 RenderBR {BR} at (0,0) size 0x0 37 RenderText {#text} at (0,28) size 663x22 38 text run at (0,28) width 663: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well. " 39 RenderBR {BR} at (663,45) size 0x0 40 RenderInline {I} at (0,0) size 99x22 41 RenderText {#text} at (0,50) size 99x22 42 text run at (0,50) width 99: "For this test: " 43 RenderText {#text} at (99,50) size 181x22 44 text run at (99,50) width 181: "Select and delete a table." 45 RenderBlock (anonymous) at (20,92) size 744x22 46 RenderBR {BR} at (0,0) size 0x22 47 RenderBlock {DIV} at (20,114) size 744x116 48 RenderText {#text} at (0,0) size 189x28 49 text run at (0,0) width 189: "Expected Results: " 50 RenderBR {BR} at (189,22) size 0x0 51 RenderText {#text} at (0,28) size 709x44 52 text run at (0,28) width 709: "The content in the red box must exactly match the content in the green box (except for the border" 53 text run at (0,50) width 53: "color). " 54 RenderBR {BR} at (53,67) size 0x0 55 RenderInline {I} at (0,0) size 99x22 56 RenderText {#text} at (0,72) size 99x22 57 text run at (0,72) width 99: "For this test: " 58 RenderText {#text} at (99,72) size 663x44 59 text run at (99,72) width 564: "Only table should get deleted. Surrounding content that is not selected should" 60 text run at (0,94) width 201: "(obviously) not be affected." 61 RenderBlock {DIV} at (0,260) size 784x32 [border: (2px solid #008000)] 62 RenderText {#text} at (2,2) size 107x28 63 text run at (2,2) width 107: "beforeafter" 64 RenderBlock {DIV} at (0,302) size 784x60 65 RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)] 66 RenderText {#text} at (2,2) size 62x28 67 text run at (2,2) width 62: "before" 68 RenderBR {BR} at (64,24) size 0x0 69 RenderText {#text} at (2,30) size 45x28 70 text run at (2,30) width 45: "after" 71 caret: position 0 of child 2 {#text} of child 1 {DIV} of child 5 {DIV} of body 1 For this test Select and delete a table. Expected Results: Only table should get deleted.Surrounding content that is not selected should (obviously) not be affected. 2 3 BeforeDeletion: 4 | " 5 " 6 | <div> 7 | class="editing" 8 | id="test" 9 | " 10 First 11 " 12 | <table> 13 | border="1" 14 | " 15 " 16 | <tbody> 17 | <tr> 18 | " 19 " 20 | <td> 21 | "<#selection-anchor>1" 22 | " 23 " 24 | <td> 25 | "2" 26 | " 27 " 28 | <td> 29 | "3" 30 | " 31 " 32 | " 33 " 34 | <tr> 35 | " 36 " 37 | <td> 38 | "4" 39 | " 40 " 41 | <td> 42 | "5" 43 | " 44 " 45 | <td> 46 | "6" 47 | " 48 " 49 | " 50 " 51 | <tr> 52 | " 53 " 54 | <td> 55 | "7" 56 | " 57 " 58 | <td> 59 | "8" 60 | " 61 " 62 | <td> 63 | "9" 64 | " 65 " 66 | " 67 " 68 | <#selection-focus> 69 | " 70 Second 71 " 72 | " 73 " 74 75 AfterDeletion: 76 | " 77 " 78 | <div> 79 | class="editing" 80 | id="test" 81 | " 82 First<#selection-caret>" 83 | <br> 84 | "Second 85 " 86 | " 87 " -
trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-003-expected.txt
r96264 r157292 1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > B > BODY > HTML > #document to 3 of DIV > B > BODY > HTML > #document 2 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 12 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > DIV > B > BODY > HTML > #document to 1 of #text > TD > TR > TBODY > TABLE > DIV > DIV > B > BODY > HTML > #document 15 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > B > BODY > HTML > #document to 0 of DIV > DIV > B > BODY > HTML > #document toDOMRange:range from 1 of DIV > DIV > B > BODY > HTML > #document to 1 of DIV > DIV > B > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 16 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 17 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 18 layer at (0,0) size 800x600 19 RenderView at (0,0) size 800x600 20 layer at (0,0) size 800x600 21 RenderBlock {HTML} at (0,0) size 800x600 22 RenderBody {BODY} at (8,8) size 784x584 23 RenderBlock {DIV} at (0,0) size 784x272 [border: (4px solid #0000FF)] 24 RenderBlock {DIV} at (20,20) size 744x72 25 RenderText {#text} at (0,0) size 67x28 26 text run at (0,0) width 67: "Tests: " 27 RenderBR {BR} at (0,0) size 0x0 28 RenderText {#text} at (0,28) size 663x22 29 text run at (0,28) width 663: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well. " 30 RenderBR {BR} at (663,45) size 0x0 31 RenderInline {I} at (0,0) size 99x22 32 RenderText {#text} at (0,50) size 99x22 33 text run at (0,50) width 99: "For this test: " 34 RenderText {#text} at (99,50) size 392x22 35 text run at (99,50) width 392: "Select and delete a list and some surrounding content." 36 RenderBlock (anonymous) at (20,92) size 744x22 37 RenderBR {BR} at (0,0) size 0x22 38 RenderBlock {DIV} at (20,114) size 744x138 39 RenderText {#text} at (0,0) size 189x28 40 text run at (0,0) width 189: "Expected Results: " 41 RenderBR {BR} at (189,22) size 0x0 42 RenderText {#text} at (0,28) size 709x44 43 text run at (0,28) width 709: "The content in the red box must exactly match the content in the green box (except for the border" 44 text run at (0,50) width 53: "color). " 45 RenderBR {BR} at (53,67) size 0x0 46 RenderInline {I} at (0,0) size 99x22 47 RenderText {#text} at (0,72) size 99x22 48 text run at (0,72) width 99: "For this test: " 49 RenderText {#text} at (99,72) size 744x44 50 text run at (99,72) width 304: "Only selected content should get deleted. " 51 text run at (403,72) width 341: "Surrounding content that is not selected should" 52 text run at (0,94) width 206: "(obviously) not be affected. " 53 RenderBR {BR} at (206,111) size 0x0 54 RenderInline {B} at (0,0) size 718x22 55 RenderText {#text} at (0,116) size 718x22 56 text run at (0,116) width 718: "There is a bug: the caret ends up in the wrong position, it should be in the empty paragraph." 57 RenderBlock (anonymous) at (20,252) size 744x0 58 RenderInline {B} at (0,0) size 0x0 59 RenderText {#text} at (0,0) size 0x0 60 RenderBlock (anonymous) at (0,282) size 784x0 61 RenderInline {B} at (0,0) size 0x0 62 RenderText {#text} at (0,0) size 0x0 63 RenderBlock (anonymous) at (0,282) size 784x130 64 RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #008000)] 65 RenderBR {BR} at (2,2) size 0x28 66 RenderText {#text} at (2,30) size 50x28 67 text run at (2,30) width 50: "after" 68 RenderBlock {DIV} at (0,70) size 784x60 69 RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)] 70 RenderBR {BR} at (2,2) size 0x28 71 RenderText {#text} at (2,30) size 50x28 72 text run at (2,30) width 50: "after" 73 RenderBlock (anonymous) at (0,412) size 784x0 74 RenderInline {B} at (0,0) size 0x0 75 caret: position 0 of child 1 {#text} of child 1 {DIV} of child 3 {DIV} of child 2 {B} of body 1 For this test Select and delete a table. Expected Results:Only table should get deleted.Surrounding content that is not selected should (obviously) not be affected. 2 3 BeforeDeletion: 4 | " 5 " 6 | <div> 7 | class="editing" 8 | id="test" 9 | " 10 <#selection-anchor>First 11 " 12 | <table> 13 | border="1" 14 | " 15 " 16 | <tbody> 17 | <tr> 18 | " 19 " 20 | <td> 21 | "1" 22 | " 23 " 24 | <td> 25 | "2" 26 | " 27 " 28 | <td> 29 | "3" 30 | " 31 " 32 | " 33 " 34 | <tr> 35 | " 36 " 37 | <td> 38 | "4" 39 | " 40 " 41 | <td> 42 | "5" 43 | " 44 " 45 | <td> 46 | "6" 47 | " 48 " 49 | " 50 " 51 | <tr> 52 | " 53 " 54 | <td> 55 | "7" 56 | " 57 " 58 | <td> 59 | "8" 60 | " 61 " 62 | <td> 63 | "9<#selection-focus>" 64 | " 65 " 66 | " 67 " 68 | " 69 Second 70 " 71 | " 72 " 73 74 AfterDeletion: 75 | " 76 " 77 | <div> 78 | class="editing" 79 | id="test" 80 | <#selection-caret> 81 | <br> 82 | "Second 83 " 84 | " 85 " -
trunk/Source/WebCore/ChangeLog
r157290 r157292 1 2013-10-10 Santosh Mahto <santosh.ma@samsung.com> 2 3 contentEditable with "position:relative" paragraphs is buggy 4 https://bugs.webkit.org/show_bug.cgi?id=33950 5 6 Reviewed by Darin Adler. 7 8 When paragraph is positioned(relative/absolute/fixed) then deleting 9 that paragraph cause wrong merging of other(below) paragraphs. This is 10 happening because positioned element is treated as special element and 11 on deletion complete paragraph element is removed. The ranges become 12 paragraph. This issue happens when all the content of special element 13 are deleted. So the merging of paragraph is avoided in this scenario. 14 15 Test: editing/deleting/deleting-relative-positioned-special-element.html 16 17 * editing/DeleteSelectionCommand.cpp: 18 (WebCore::DeleteSelectionCommand::initializeStartEnd):Avoid merging 19 block when special candidate are included in deletion range 20 1 21 2013-10-10 Brendan Long <b.long@cablelabs.com> 2 22 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r157018 r157292 135 135 if (!startSpecialContainer && !endSpecialContainer) 136 136 break; 137 137 138 m_mergeBlocksAfterDelete = false; 139 138 140 if (VisiblePosition(start) != m_selectionToDelete.visibleStart() || VisiblePosition(end) != m_selectionToDelete.visibleEnd()) 139 141 break;
Note: See TracChangeset
for help on using the changeset viewer.