Title: [157292] trunk
Revision
157292
Author
[email protected]
Date
2013-10-10 23:18:44 -0700 (Thu, 10 Oct 2013)

Log Message

contentEditable with "position:relative" paragraphs is buggy
https://bugs.webkit.org/show_bug.cgi?id=33950

Patch by Santosh Mahto <[email protected]> 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:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (157291 => 157292)


--- trunk/LayoutTests/ChangeLog	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/LayoutTests/ChangeLog	2013-10-11 06:18:44 UTC (rev 157292)
@@ -1,3 +1,30 @@
+2013-10-10  Santosh Mahto  <[email protected]>
+
+        contentEditable with "position:relative" paragraphs is buggy
+        https://bugs.webkit.org/show_bug.cgi?id=33950
+
+        Reviewed by Darin Adler.
+
+        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:
+
 2013-10-10  Alexey Proskuryakov  <[email protected]>
 
         Layout Test fast/css/font-face-download-error.html is flaky

Modified: trunk/LayoutTests/editing/deleting/5546763-expected.txt (157291 => 157292)


--- trunk/LayoutTests/editing/deleting/5546763-expected.txt	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/LayoutTests/editing/deleting/5546763-expected.txt	2013-10-11 06:18:44 UTC (rev 157292)
@@ -5,7 +5,7 @@
 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 #text > DIV > DIV > BODY > HTML > #document to 3 of #text > A > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > A > DIV > DIV > BODY > HTML > #document
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 2 of 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
+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
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 This tests for a crash when deleting a selection that starts before the first child of a block and ends after the last child (which must be a link) of another block. There shouldn't be any content in the editable region below.

Added: trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element-expected.txt (0 => 157292)


--- trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element-expected.txt	2013-10-11 06:18:44 UTC (rev 157292)
@@ -0,0 +1,21 @@
+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
+
+BeforeDeletion:
+| <p>
+|   "1"
+| <p>
+|   id="paragraphToDelete"
+|   "2<#selection-caret>"
+| <p>
+|   "3"
+| <p>
+|   "4"
+
+AfterDeletion:
+| <p>
+|   "1"
+| <br>
+| <p>
+|   "3"
+| <p>
+|   "4"

Added: trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element.html (0 => 157292)


--- trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element.html	                        (rev 0)
+++ trunk/LayoutTests/editing/deleting/deleting-relative-positioned-special-element.html	2013-10-11 06:18:44 UTC (rev 157292)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src=""
+    <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>

Modified: trunk/LayoutTests/editing/unsupported-content/table-delete-001.html (157291 => 157292)


--- trunk/LayoutTests/editing/unsupported-content/table-delete-001.html	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/LayoutTests/editing/unsupported-content/table-delete-001.html	2013-10-11 06:18:44 UTC (rev 157292)
@@ -6,57 +6,19 @@
     border: 2px solid red; 
     font-size: 24px; 
 }
-.explanation { 
-    border: 4px solid blue; 
-    padding: 16px; 
-    font-size: 18px; 
-    margin-bottom: 10px;
-}
-.scenario:first-line { font-weight: bold; font-size: 24px; }
-.expected:first-line { font-weight: bold; font-size: 24px; }
-.results { margin-bottom: 10px; border: 2px solid green; font-size: 24px; }
 </style>
+
 <script src="" language="_javascript_" type="text/_javascript_" ></script>
+<script src=""
 
-<script>
-
-function editingTest() {
-    moveSelectionForwardByLineCommand();
-    for (i = 0; i < 18; i++)
-        extendSelectionForwardByCharacterCommand();
-    deleteCommand();
-}
-
-</script>
-
 <title>Editing Test</title> 
 </head> 
 <body>
 
-<div class="explanation">
-<div class="scenario">
-Tests: 
-<br>
-Our ability to "edit around" content the HTML editing code does not yet handle very well.
-<br><i>For this test: </i>Select and delete a table.
-</div>
-<br>
-<div class="expected">
-Expected Results:
-<br>
-The content in the red box must exactly match the content in the green box (except for the border color).
-<br><i>For this test: </i>Only table should get deleted.
-Surrounding content that is not selected should (obviously) not be affected.
-</div>
-</div>
-
-<div class="results">
-beforeafter
-</div>
-
 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
 <div id="test" class="editing">
-before<table border="1">
+First
+<table border="1">
 <tr>
 <td>1</td>
 <td>2</td>
@@ -73,12 +35,22 @@
 <td>9</td>
 </tr>
 </table>
-after
+Second
 </div>
 </div>
 
 <script>
-runEditingTest();
+    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.')
+
+    var element = document.getElementById("test");
+    getSelection().collapse(element, 0);
+    moveSelectionForwardByLineCommand();
+    for (i = 0; i < 18; i++)
+        extendSelectionForwardByCharacterCommand();
+    Markup.dump('root', 'BeforeDeletion');
+
+    deleteCommand();
+    Markup.dump('root', 'AfterDeletion');
 </script>
 
 </body>

Modified: trunk/LayoutTests/editing/unsupported-content/table-delete-003.html (157291 => 157292)


--- trunk/LayoutTests/editing/unsupported-content/table-delete-003.html	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/LayoutTests/editing/unsupported-content/table-delete-003.html	2013-10-11 06:18:44 UTC (rev 157292)
@@ -6,59 +6,18 @@
     border: 2px solid red; 
     font-size: 24px; 
 }
-.explanation { 
-    border: 4px solid blue; 
-    padding: 16px; 
-    font-size: 18px; 
-    margin-bottom: 10px;
-}
-.scenario:first-line { font-weight: bold; font-size: 24px; }
-.expected:first-line { font-weight: bold; font-size: 24px; }
-.results { margin-bottom: 10px; border: 2px solid green; font-size: 24px; }
 </style>
+
 <script src="" language="_javascript_" type="text/_javascript_" ></script>
+<script src=""
 
-<script>
-
-function editingTest() {
-    for (i = 0; i < 9; i++)
-        extendSelectionForwardByLineCommand();
-    extendSelectionForwardByCharacterCommand();
-    deleteCommand();
-}
-
-</script>
-
 <title>Editing Test</title> 
 </head> 
 <body>
 
-<div class="explanation">
-<div class="scenario">
-Tests: 
-<br>
-Our ability to "edit around" content the HTML editing code does not yet handle very well.
-<br><i>For this test: </i>Select and delete a list and some surrounding content.
-</div>
-<br>
-<div class="expected">
-Expected Results:
-<br>
-The content in the red box must exactly match the content in the green box (except for the border color).
-<br><i>For this test: </i>Only selected content should get deleted. 
-Surrounding content that is not selected should (obviously) not be affected.
-<br><b>There is a bug: the caret ends up in the wrong position, it should be in the empty paragraph.
-</div>
-</div>
-
-<div class="results">
-<br>
-after
-</div>
-
 <div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
 <div id="test" class="editing">
-before
+First
 <table border="1">
 <tr>
 <td>1</td>
@@ -76,12 +35,22 @@
 <td>9</td>
 </tr>
 </table>
-after
+Second
 </div>
 </div>
 
 <script>
-runEditingTest();
+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.')
+
+    var element = document.getElementById("test");
+    getSelection().collapse(element, 0);
+    for (i = 0; i < 9; i++)
+        extendSelectionForwardByLineCommand();
+    extendSelectionForwardByCharacterCommand();
+    Markup.dump('root', 'BeforeDeletion');
+
+    deleteCommand();
+    Markup.dump('root', 'AfterDeletion');
 </script>
 
 </body>

Modified: trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-001-expected.txt (157291 => 157292)


--- trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-001-expected.txt	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-001-expected.txt	2013-10-11 06:18:44 UTC (rev 157292)
@@ -1,71 +1,87 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-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
-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
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x250 [border: (4px solid #0000FF)]
-        RenderBlock {DIV} at (20,20) size 744x72
-          RenderText {#text} at (0,0) size 67x28
-            text run at (0,0) width 67: "Tests: "
-          RenderBR {BR} at (0,0) size 0x0
-          RenderText {#text} at (0,28) size 663x22
-            text run at (0,28) width 663: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well. "
-          RenderBR {BR} at (663,45) size 0x0
-          RenderInline {I} at (0,0) size 99x22
-            RenderText {#text} at (0,50) size 99x22
-              text run at (0,50) width 99: "For this test: "
-          RenderText {#text} at (99,50) size 181x22
-            text run at (99,50) width 181: "Select and delete a table."
-        RenderBlock (anonymous) at (20,92) size 744x22
-          RenderBR {BR} at (0,0) size 0x22
-        RenderBlock {DIV} at (20,114) size 744x116
-          RenderText {#text} at (0,0) size 189x28
-            text run at (0,0) width 189: "Expected Results: "
-          RenderBR {BR} at (189,22) size 0x0
-          RenderText {#text} at (0,28) size 709x44
-            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"
-            text run at (0,50) width 53: "color). "
-          RenderBR {BR} at (53,67) size 0x0
-          RenderInline {I} at (0,0) size 99x22
-            RenderText {#text} at (0,72) size 99x22
-              text run at (0,72) width 99: "For this test: "
-          RenderText {#text} at (99,72) size 663x44
-            text run at (99,72) width 564: "Only table should get deleted. Surrounding content that is not selected should"
-            text run at (0,94) width 201: "(obviously) not be affected."
-      RenderBlock {DIV} at (0,260) size 784x32 [border: (2px solid #008000)]
-        RenderText {#text} at (2,2) size 107x28
-          text run at (2,2) width 107: "beforeafter"
-      RenderBlock {DIV} at (0,302) size 784x60
-        RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
-          RenderText {#text} at (2,2) size 62x28
-            text run at (2,2) width 62: "before"
-          RenderBR {BR} at (64,24) size 0x0
-          RenderText {#text} at (2,30) size 45x28
-            text run at (2,30) width 45: "after"
-caret: position 0 of child 2 {#text} of child 1 {DIV} of child 5 {DIV} of body
+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.
+
+BeforeDeletion:
+| "
+"
+| <div>
+|   class="editing"
+|   id="test"
+|   "
+First
+"
+|   <table>
+|     border="1"
+|     "
+"
+|     <tbody>
+|       <tr>
+|         "
+"
+|         <td>
+|           "<#selection-anchor>1"
+|         "
+"
+|         <td>
+|           "2"
+|         "
+"
+|         <td>
+|           "3"
+|         "
+"
+|       "
+"
+|       <tr>
+|         "
+"
+|         <td>
+|           "4"
+|         "
+"
+|         <td>
+|           "5"
+|         "
+"
+|         <td>
+|           "6"
+|         "
+"
+|       "
+"
+|       <tr>
+|         "
+"
+|         <td>
+|           "7"
+|         "
+"
+|         <td>
+|           "8"
+|         "
+"
+|         <td>
+|           "9"
+|         "
+"
+|       "
+"
+|   <#selection-focus>
+|   "
+Second
+"
+| "
+"
+
+AfterDeletion:
+| "
+"
+| <div>
+|   class="editing"
+|   id="test"
+|   "
+First<#selection-caret>"
+|   <br>
+|   "Second
+"
+| "
+"

Modified: trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-003-expected.txt (157291 => 157292)


--- trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-003-expected.txt	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/LayoutTests/platform/mac/editing/unsupported-content/table-delete-003-expected.txt	2013-10-11 06:18:44 UTC (rev 157292)
@@ -1,75 +1,85 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > B > BODY > HTML > #document to 3 of DIV > B > BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-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
-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
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x272 [border: (4px solid #0000FF)]
-        RenderBlock {DIV} at (20,20) size 744x72
-          RenderText {#text} at (0,0) size 67x28
-            text run at (0,0) width 67: "Tests: "
-          RenderBR {BR} at (0,0) size 0x0
-          RenderText {#text} at (0,28) size 663x22
-            text run at (0,28) width 663: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well. "
-          RenderBR {BR} at (663,45) size 0x0
-          RenderInline {I} at (0,0) size 99x22
-            RenderText {#text} at (0,50) size 99x22
-              text run at (0,50) width 99: "For this test: "
-          RenderText {#text} at (99,50) size 392x22
-            text run at (99,50) width 392: "Select and delete a list and some surrounding content."
-        RenderBlock (anonymous) at (20,92) size 744x22
-          RenderBR {BR} at (0,0) size 0x22
-        RenderBlock {DIV} at (20,114) size 744x138
-          RenderText {#text} at (0,0) size 189x28
-            text run at (0,0) width 189: "Expected Results: "
-          RenderBR {BR} at (189,22) size 0x0
-          RenderText {#text} at (0,28) size 709x44
-            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"
-            text run at (0,50) width 53: "color). "
-          RenderBR {BR} at (53,67) size 0x0
-          RenderInline {I} at (0,0) size 99x22
-            RenderText {#text} at (0,72) size 99x22
-              text run at (0,72) width 99: "For this test: "
-          RenderText {#text} at (99,72) size 744x44
-            text run at (99,72) width 304: "Only selected content should get deleted. "
-            text run at (403,72) width 341: "Surrounding content that is not selected should"
-            text run at (0,94) width 206: "(obviously) not be affected. "
-          RenderBR {BR} at (206,111) size 0x0
-          RenderInline {B} at (0,0) size 718x22
-            RenderText {#text} at (0,116) size 718x22
-              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."
-        RenderBlock (anonymous) at (20,252) size 744x0
-          RenderInline {B} at (0,0) size 0x0
-            RenderText {#text} at (0,0) size 0x0
-      RenderBlock (anonymous) at (0,282) size 784x0
-        RenderInline {B} at (0,0) size 0x0
-          RenderText {#text} at (0,0) size 0x0
-      RenderBlock (anonymous) at (0,282) size 784x130
-        RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #008000)]
-          RenderBR {BR} at (2,2) size 0x28
-          RenderText {#text} at (2,30) size 50x28
-            text run at (2,30) width 50: "after"
-        RenderBlock {DIV} at (0,70) size 784x60
-          RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
-            RenderBR {BR} at (2,2) size 0x28
-            RenderText {#text} at (2,30) size 50x28
-              text run at (2,30) width 50: "after"
-      RenderBlock (anonymous) at (0,412) size 784x0
-        RenderInline {B} at (0,0) size 0x0
-caret: position 0 of child 1 {#text} of child 1 {DIV} of child 3 {DIV} of child 2 {B} of body
+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.
+
+BeforeDeletion:
+| "
+"
+| <div>
+|   class="editing"
+|   id="test"
+|   "
+<#selection-anchor>First
+"
+|   <table>
+|     border="1"
+|     "
+"
+|     <tbody>
+|       <tr>
+|         "
+"
+|         <td>
+|           "1"
+|         "
+"
+|         <td>
+|           "2"
+|         "
+"
+|         <td>
+|           "3"
+|         "
+"
+|       "
+"
+|       <tr>
+|         "
+"
+|         <td>
+|           "4"
+|         "
+"
+|         <td>
+|           "5"
+|         "
+"
+|         <td>
+|           "6"
+|         "
+"
+|       "
+"
+|       <tr>
+|         "
+"
+|         <td>
+|           "7"
+|         "
+"
+|         <td>
+|           "8"
+|         "
+"
+|         <td>
+|           "9<#selection-focus>"
+|         "
+"
+|       "
+"
+|   "
+Second
+"
+| "
+"
+
+AfterDeletion:
+| "
+"
+| <div>
+|   class="editing"
+|   id="test"
+|   <#selection-caret>
+|   <br>
+|   "Second
+"
+| "
+"

Modified: trunk/Source/WebCore/ChangeLog (157291 => 157292)


--- trunk/Source/WebCore/ChangeLog	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/Source/WebCore/ChangeLog	2013-10-11 06:18:44 UTC (rev 157292)
@@ -1,3 +1,23 @@
+2013-10-10  Santosh Mahto  <[email protected]>
+
+        contentEditable with "position:relative" paragraphs is buggy
+        https://bugs.webkit.org/show_bug.cgi?id=33950
+
+        Reviewed by Darin Adler.
+
+        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
+
 2013-10-10  Brendan Long  <[email protected]>
 
         Track controls show metadata and chapter tracks

Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (157291 => 157292)


--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp	2013-10-11 06:17:10 UTC (rev 157291)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp	2013-10-11 06:18:44 UTC (rev 157292)
@@ -134,7 +134,9 @@
         
         if (!startSpecialContainer && !endSpecialContainer)
             break;
-            
+
+        m_mergeBlocksAfterDelete = false;
+
         if (VisiblePosition(start) != m_selectionToDelete.visibleStart() || VisiblePosition(end) != m_selectionToDelete.visibleEnd())
             break;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to