Closed Bug 619449 Opened 14 years ago Closed 14 years ago

Pasting colspanned table from FF4.0b7 into tinyMCE causes html code corruption

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: emartin, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7

When pasting a table containing colspanned cells into tinyMCE from FF4.0b7, the behind-the-scenes HTML becomes badly corrupted

Reproducible: Always

Steps to Reproduce:
1. View the attached file SampleTables.html in FF4.0b7.
2. In a second tab open the tinyMCE Full example at http://tinymce.moxiecode.com/examples/full.php.
3. Using the mouse, dragging from SE to NW select the lower table contents in SampleTables.html. Copy to the clipboard using Ctrl+C.
4. In the tinyMCE sample textarea, click after the word "Google" and press Enter to make a new line. Then paste in the table using Ctrl+V.

The table should appear correctly in the tinyMCE textarea.

5. Drag the mouse from after the word "Google" in order to select the newly-pasted table. Press Delete to delete it.
6. Using the mouse, dragging from SE to NW select the upper table contents in SampleTables.html. Copy to the clipboard using Ctrl+C.
7. In the tinyMCE sample textarea, make a new line as in #4. Then paste in the table using Ctrl+V.

What appears in the tinyMCE textarea is totally messed up:
There are five copies of the first two table rows showing, followed by one copy of the third row.
If you click the HTML icon to view the source code, it appears that there's a lot more trouble behind the scenes. There is more than one copy of the original tinyMCE sample text. There are broken <p> tags of the form <p [some non-ASCII character] <p>. There are broken classed <p> tags of the form <p c class="nomargin">.

This does not happen with FF3.6.13 or IE7 or IE8 or Chrome 8.0.552.215. So it must be something about FF4.0b7's clipboard handling that is causing tinyMCE to malfunction.
Actual Results:  
Rows of the table are duplicated and the underlying HTML is significantly corrupted.

Expected Results:  
A correctly formatted table should appear and the underlying HTML should be correct.

The tinyMCE developer suspects that this may be a side-effect of recent changes in the Firefox clipboard logic.
No SampleTables.html was attached?

Does this occur in the latest nightly:
http://nightly.mozilla.org/

And also with a clean profile:
https://wiki.mozilla.org/QA/Triage#How_to_Help_with_Regressions_--_Finding_Regression_Windows

Thanks!
Sorry for forgetting to attach this from the start
Works for me using Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20101215 Firefox/4.0b9pre ID:20101215030322

Can you try the things suggested in comment 1 and see if it still exists please.

Also, would it be possible to attach a screenshot showing broken - thanks!
I have tried it with Mozilla/5.0 (Windows NT 5.1; rv:2.0b9pre) Gecko/20101215 Firefox/4.0b9pre and the described behavior does NOT occur.
Ok, so it looks like this has already been fixed.

However for completeness, I've tracked down the original regression range:

Last good nightly: 2010-10-13 
First bad nightly: 2010-10-14
Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f6e81dd5a125&tochange=ad0a0be8be74

The fix range appears to be between 2010-12-02 and 2010-12-03, with a pushlog of:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=baa5ae44f0ba&tochange=0ff6d5984287

Since the fix range is before Firefox 4 beta 8 branched, it should be fixed in the next beta release.

As for which of the changesets that caused the issue/then fixed it, not really sure - but there were some JS regexp changes in there, which might be used by TinyMCE to pattern match the pasted text.

Marking as worksforme, please reopen if it crops up again - thanks!
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Ok, just spotted a similar bug of which this might be a dupe:
Bug 608718

Leaving as worksforme rather than duplicate since the STR are different.
Depends on: 608718
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: