Open Bug 322115 Opened 19 years ago Updated 3 years ago

Drag and Drop aswell as Cut and Paste dysfunctional. JS error.

Categories

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

1.8 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

It seems copy and paste of fckeditor does not work as expected. Elements can be cut out of the wysiwyg interface, but cannot be inserted again. Drag and Drop of elements is also affected.

The JavaScript console reported an error, maybe connected to this issue:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMNSHTMLDocument.execCommand]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: ...some intraned url.../fckeditorcode_gecko_2.js :: anonymous :: line 15"  data: no] 



Reproducible: Couldn't Reproduce

Actual Results:  
ctrl-x: Element in wysiwyg view gets cut out
ctrl-v: Element does not appear
js error message appears

Expected Results:  
usual cut and paste behavior

it's a frameset, rendered in quirks mode, UTF-8, text/html
Sounds like bug 309731. Could you attach or paste the line in the JS that's causing this?
Assignee: nobody → mozeditor
Component: General → Editor
Product: Firefox → Core
QA Contact: general
Version: unspecified → 1.8 Branch
Here is line 15 (yes, all of it ;-) from fckeditorcode_gecko_2.js. Hope this helps.

FCK.RedirectNamedCommands=new Object();FCK.ExecuteNamedCommand=function(A,B){FCKUndo.SaveUndoStep();if (FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,true,B);FCK.Events.FireEvent('OnSelectionChange');};FCKUndo.SaveUndoStep();};FCK.GetNamedCommandState=function(A){try{if (!FCK.EditorDocument.queryCommandEnabled(A)) return FCK_TRISTATE_DISABLED;else return FCK.EditorDocument.queryCommandState(A)?FCK_TRISTATE_ON:FCK_TRISTATE_OFF;}catch (e){return FCK_TRISTATE_OFF;};};FCK.GetNamedCommandValue=function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==FCK_TRISTATE_DISABLED) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';};FCK.PasteFromWord=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');};FCK.Preview=function(){var A=FCKConfig.ScreenWidth*0.8;var B=FCKConfig.ScreenHeight*0.7;var C=(FCKConfig.ScreenWidth-A)/2;var D=window.open(FCKConfig.PreviewURL, null, null);/*var E;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) E=FCK.GetXHTML().replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);else E=FCK.GetXHTML();}else{E=FCKConfig.DocType+'<html dir="'+FCKConfig.ContentLangDirection+'">'+'<head><title>'+FCKLang.Preview+'</title>'+'<link href="'+FCKConfig.EditorAreaCSS+'" rel="stylesheet" type="text/css" />'+FCK.TempBaseTag+'</head><body>'+FCK.GetXHTML()+'</body></html>';};D.document.write(E);D.document.close();*/};FCK.SwitchEditMode=function(){var A=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);document.getElementById('eWysiwyg').style.display=A?'none':'';document.getElementById('eSource').style.display=A?'':'none';if (A){if (FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();document.getElementById('eSourceField').value=(FCKConfig.EnableXHTML&&FCKConfig.EnableSourceXHTML?FCK.GetXHTML(FCKConfig.FormatSource):FCK.GetHTML(FCKConfig.FormatSource));}else FCK.SetHTML(FCK.GetHTML(),true);FCK.EditMode=A?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCKToolbarSet.RefreshModeState();FCK.Focus();};FCK.CreateElement=function(A){var e=FCK.EditorDocument.createElement(A);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('__FCKTempLabel',1);this.InsertElement(e);var A=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i<A.length;i++){if (A[i].getAttribute('__FCKTempLabel')){A[i].removeAttribute('__FCKTempLabel');return A[i];};};return null;};
The call to execCommand(A,true,B) would do it (see URL). Mozilla doesn't accept true as the second param, maybe it should fail silently?
QA Contact: editor
Assignee: mozeditor → nobody

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.