Open Bug 976862 Opened 7 years ago Updated 5 years ago

contenteditable div is duplicated when MSWord content is copied/pasted when div is inside a dd tag


(Core :: DOM: Editor, defect)

15 Branch
Windows 7
Not set



Tracking Status
firefox27 --- affected
firefox28 --- affected
firefox29 --- affected
firefox30 --- affected
firefox-esr24 --- affected


(Reporter: maryregeena.b, Unassigned)



(Keywords: regression)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140212131424

Steps to reproduce:

Go to my fiddle -

Open MSWord and type is something and copy the content and paste it in the div in this fiddle.

Actual results:

Clones the dd and div tags with the same attributes of the element

Expected results:

paste in the same div.
Use Ctrl+Shft+V for paste as plain text(without formatting)
Hi Alice, I want with the formatting as in other browsers.
Is this a regression?
Regression window(m-i)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120501015541
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120501031242

Regressed by:Bug 748303
Blocks: 748303
Component: DOM: Core & HTML → Editor
Ever confirmed: true
Keywords: regression
Version: 27 Branch → 15 Branch
Jet, can you please help us find an owner for this?  Thanks!
Flags: needinfo?(bugs)
In local build,
Last good: 7b44d184f51b
First bad: d2596504ce97
While there may be a change in behavior here (likely due to the fix for bug 748303,) I don't think we're any less correct per spec now (:ayg, can you confirm?) Visually, the results are formatted as expected from MS Word (unlike when pasted into Google Chrome.) It also looks like we synthesize less code for the markup than Blink as well. In other words, LGTM.
Flags: needinfo?(bugs) → needinfo?(ayg)
I don't have MS Word on my computer.  I tried with WordPad, but I didn't notice anything unexpected in Firefox.  I just typed some text in WordPad, copied it, selected "Hello" on the paste, and pasted.  I got the text replacing "Hello" just as I would expect, no duplication of elements.  Is this specific to Word, or can it be reproduced without it?  Is there some specific text that must be typed to reproduce the bug?

If the div or dd is being duplicated in the test-case, then that would be a pretty bad bug.  I don't have any idea how d2596504ce97 might have caused it, though -- that was a cleanup patch and shouldn't have caused any behavior changes.  I briefly glanced over the patch just now and have no idea what might have done it.
Flags: needinfo?(ayg)
@Aryeh, Yes you need MS Word. Wordpad removes the formatting when copied. MS Word content with formatting makes the dd,div clone in firefox. 

Any text in MS Word "hello" or anything even without bold or italic.
Severity: normal → major
You need to log in before you can comment on or make changes to this bug.