Open Bug 529955 Opened 15 years ago Updated 3 years ago

Copy paste of table results in nested <tr> which causes table border to disappear.

Categories

(Core :: DOM: Editor, defect, P5)

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: michaelthomas, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/8.04 (hardy) Firefox/3.0.11

Copy and pasting of a table via highlighting the table cells results in incorrect HTML being pasted.

Note that this problem does not occur if you select the table as part of a larger selection including surrounding text.

Reproducible: Always

Steps to Reproduce:
1. Go to the midas demo: http://www.mozilla.org/editor/midasdemo/
2. Click the "Insert Table" button.
3. Select 1 row and 2 columns, table gets inserted.
4. Highlight both cells of the table by clicking in the first cell and dragging to the second.
5. Ctrl+C
6. Move the cursor below the existing table.
7. Ctrl+V

Actual Results:  
The table is copied, but the cell borders are missing. Inspecting the pasted table reveals the following HTML:

<table border="1" cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <tr>
        <td><br></td>
        <td><br></td>
      </tr>
    </tr>
  </tbody>
</table>


Expected Results:  
The pasted table should be identical to the copied table.
The problematic TR get added consistently no matter how table cells are selected,  please give proper priority to this bug as it has affected all WYSIWYG editors like CKEditor, and it's not yet affected other browsers.

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.