Changeset 157292 in webkit


Ignore:
Timestamp:
Oct 10, 2013 11:18:44 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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:
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157291 r157292  
     12013-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
    1282013-10-10  Alexey Proskuryakov  <ap@apple.com>
    229
  • trunk/LayoutTests/editing/deleting/5546763-expected.txt

    r96257 r157292  
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    77EDITING 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 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
     8EDITING 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
    99EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1010EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
  • trunk/LayoutTests/editing/unsupported-content/table-delete-001.html

    r12359 r157292  
    77    font-size: 24px;
    88}
    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; }
    189</style>
     10
    1911<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>
    3113
    3214<title>Editing Test</title>
     
    3416<body>
    3517
    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 beforeafter
    55 </div>
    56 
    5718<div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
    5819<div id="test" class="editing">
    59 before<table border="1">
     20First
     21<table border="1">
    6022<tr>
    6123<td>1</td>
     
    7436</tr>
    7537</table>
    76 after
     38Second
    7739</div>
    7840</div>
    7941
    8042<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');
    8254</script>
    8355
  • trunk/LayoutTests/editing/unsupported-content/table-delete-003.html

    r22057 r157292  
    77    font-size: 24px;
    88}
    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; }
    189</style>
     10
    1911<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>
    3113
    3214<title>Editing Test</title>
     
    3416<body>
    3517
    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 after
    57 </div>
    58 
    5918<div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
    6019<div id="test" class="editing">
    61 before
     20First
    6221<table border="1">
    6322<tr>
     
    7736</tr>
    7837</table>
    79 after
     38Second
    8039</div>
    8140</div>
    8241
    8342<script>
    84 runEditingTest();
     43Markup.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');
    8554</script>
    8655
  • 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
     1For 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
     3BeforeDeletion:
     4| "
     5"
     6| <div>
     7|   class="editing"
     8|   id="test"
     9|   "
     10First
     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|   "
     70Second
     71"
     72| "
     73"
     74
     75AfterDeletion:
     76| "
     77"
     78| <div>
     79|   class="editing"
     80|   id="test"
     81|   "
     82First<#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
     1For 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
     3BeforeDeletion:
     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|   "
     69Second
     70"
     71| "
     72"
     73
     74AfterDeletion:
     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  
     12013-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
    1212013-10-10  Brendan Long  <b.long@cablelabs.com>
    222
  • trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp

    r157018 r157292  
    135135        if (!startSpecialContainer && !endSpecialContainer)
    136136            break;
    137            
     137
     138        m_mergeBlocksAfterDelete = false;
     139
    138140        if (VisiblePosition(start) != m_selectionToDelete.visibleStart() || VisiblePosition(end) != m_selectionToDelete.visibleEnd())
    139141            break;
Note: See TracChangeset for help on using the changeset viewer.