Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#17195 closed defect (fixed)

[regression] Paste From Word Horribly Broken

Reported by: George Sexton Owned by: Douglas Hays
Priority: undecided Milestone: 1.8.5
Component: Editor Version: 1.8.4
Keywords: Cc:
Blocked By: Blocking:

Description

When I copy and paste from word, the content is pasted above the editor. The attached images show the issue. It seems to happen with all versions of IE, and the content being pasted doesn't seem to matter

Attachments (3)

PasteFromWord1.png (115.6 KB) - added by George Sexton 6 years ago.
Screen Shot showing the word document
PasteFromWord2.png (69.6 KB) - added by George Sexton 6 years ago.
Screen Shot showing what it looks like when content is pasted into dialog
PasteFromWord3.png (55.7 KB) - added by George Sexton 6 years ago.
Screen Shot showing the content pasted in the page, and not into the editor.

Download all attachments as: .zip

Change History (18)

Changed 6 years ago by George Sexton

Attachment: PasteFromWord1.png added

Screen Shot showing the word document

Changed 6 years ago by George Sexton

Attachment: PasteFromWord2.png added

Screen Shot showing what it looks like when content is pasted into dialog

Changed 6 years ago by George Sexton

Attachment: PasteFromWord3.png added

Screen Shot showing the content pasted in the page, and not into the editor.

comment:1 Changed 6 years ago by George Sexton

FWIW, there were no issues using Dojo 1.6 with IE.

The same page works correctly when using Firefox, Safari, and Chrome.

comment:2 Changed 6 years ago by Jared Jurkiewicz

That is disturbing. There is no reason it should be inserting it into the main page like that. The insertHTML should be going into the document. What the heck. Paste From Word hasn't changed in Dojo for some time.

comment:3 Changed 6 years ago by Jared Jurkiewicz

I can confirm it happens, too. I just don't know why.

comment:4 Changed 6 years ago by Jared Jurkiewicz

Basically,

Format it again to make sure it is reasonably formatted as the regexp applies will have likely chewed up the formatting. content = dojox.html.format.prettyPrint(content);

Paste it in. this.editor.execCommand("inserthtml", content);

The execCommand is inserting into the wrong document/window.

comment:5 Changed 6 years ago by Jared Jurkiewicz

It is like:

var insertRange = this.document.selection.createRange();

this.document

Is wrong, as if editor is pointing at the page document, not the iframe document.

comment:6 Changed 6 years ago by Jared Jurkiewicz

There is something seriously demented going on here. PasteFromWord? hasn't changed, so it has to be editor itself that has somehow.

What disturbs me is IE does this:

_inserthtmlImpl: function(argument){

summary: This function implements the insertion of HTML content into a point on the page. argument: The content to insert, if any. tags: protected argument = this._preFilterContent(argument); var rv = true; if(has("ie")){

var insertRange = this.document.selection.createRange(); if(this.document.selection.type.toUpperCase() === 'CONTROL'){

var n = insertRange.item(0); while(insertRange.length){

insertRange.remove(insertRange.item(0));

} n.outerHTML = argument;

}else{

insertRange.pasteHTML(argument);

} insertRange.select(); insertRange.collapse(true);

}else if(has("mozilla") && !argument.length){

mozilla can not inserthtml an empty html to delete current selection so we delete the selection instead in this case this.selection.remove(); FIXME

}else{

rv = this.document.execCommand("inserthtml", false, argument);

} return rv;

},

The item in bold is what is getting fired. That insertRange comes from the document in the iframe (I verified), but it is shoving the output into the parent document. I ... have no idea why it is doing that now all of a sudden. Something had to have changed in the editor document mode.

Last edited 6 years ago by Jared Jurkiewicz (previous) (diff)

comment:7 Changed 6 years ago by Jared Jurkiewicz

Some related info:

http://www.ruby-forum.com/topic/142668

May be a focus issue.

comment:8 Changed 6 years ago by bill

Milestone: tbd1.8.5
Owner: set to Douglas Hays
Status: newassigned
Summary: Paste From Word Horribly Broken[regression] Paste From Word Horribly Broken
Version: 1.9.01.8.4

The problem in the ticket description started in d80440bcc97bf1dfc376d89a026e80d15f7ca5ac, from Doug's checkin, so initially assigning to him.

Before that though there was another regression where "paste from word" doesn't doesn't do anything. That's from my checkin 49339a0685729c69df92e91138788a6b50cdf2ef, so I'll work on that.

comment:9 Changed 6 years ago by Bill Keese <bill@…>

In a252025f2e3f016c78230130192e61a434142d33/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:10 Changed 6 years ago by Bill Keese <bill@…>

In 31a52d41e341c17bc87891edb6103e9162d06204/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:11 Changed 6 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In ebe072716a8de85cbdd93214eba520f6e0c4d2dd/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:12 Changed 6 years ago by Bill Keese <bill@…>

In a947b2d2493eb84861f440901edc6affcc9f84f8/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:13 Changed 6 years ago by Bill Keese <bill@…>

In 72e75caa24aa68f4c32c5025cae2e3658aac6c2b/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:14 Changed 6 years ago by George Sexton

This needs to be re-opened. There is an un-intended side effect here. I pulled the fix down from GIT and made a build using it. If I go to the editor, and there is no content, and I click on the tool bar and open the insert image dialog, focus remains on the editor, so any typed or copied paste ends up in the editor content, and not in the image dialog.

comment:15 Changed 6 years ago by bill

That works fine for me. On IE8 I opened test_LinkDialog.html, cleared the editor text, opened the "insert image" tooltip dialog, and pasted something in. As usual you'll need to attach a test case showing the failure, and precise instructions about how to reproduce.

Note: See TracTickets for help on using tickets.