Open Bug 500690 Opened 15 years ago Updated 3 years ago

redo after an nsIHTMLEditor.insertElementAtSelection() failed

Categories

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

x86
Windows XP
defect

Tracking

()

People

(Reporter: sylvain.spinelli, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)

The transaction created by the nsIHTMLEditor.insertElementAtSelection() failed on redo action.

Reproducible: Always

Steps to Reproduce:
1. create a xul page :
-------------------------------------
<?xml version="1.0"?> 
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="bug_redo_after_insertElementAtSelection"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="init();">
	<script>
		var vEditorNode;
		var vEditorHtml;
		function init(){
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			vEditorNode = document.getElementById("editor");
     		vEditorNode.makeEditable("html", false);
     		vEditorHtml = vEditorNode.getHTMLEditor(vEditorNode.contentWindow);
		}
		function insertElement(pTagName){
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			vEditorHtml.beginTransaction();
			var vNode = vEditorNode.contentDocument.createElement(pTagName);
			vNode.appendChild(vEditorNode.contentDocument.createTextNode(pTagName));
			vEditorHtml.insertElementAtSelection(vNode, true);
			vEditorHtml.endTransaction();
		}
		function undo(){
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			vEditorHtml.undo(1);
		}
		function redo(){
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				vEditorHtml.redo(1);
			} catch(e) {
				alert(e);
				throw e;
			}
		}
	</script>
	<toolbar>
		<toolbarbutton oncommand="insertElement('b');" label="Step 1: 'b'"/>
		<toolbarbutton oncommand="insertElement('i');" label="Step 2: 'i'"/>
		<toolbarbutton oncommand="undo();" label="Step 3: 3Undo"/>
		<toolbarbutton oncommand="redo();" label="Step 4: Redo"/>
	</toolbar>
	<editor id="editor" flex="1" src="about:blank" style="background-color:white;"/>
</window> 
-------------------------------

2. Open this page in Firefox from chrome or file system
3. click on button step 1 and 2 and 3 and 4 : the redo action failed with an exception.
Actual Results:  
An exception occurred.

Expected Results:  
The redo action should work.
Regression range: http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=2006-03-07+02%3A00&maxdate=2006-03-07+14%3A00
Most important bug in this range with a lot of fallout is Bug 234455.
Blocks: 234455
Component: General → Editor
Keywords: regression
Product: Firefox → Core
QA Contact: general → editor
Version: unspecified → Trunk
Status: UNCONFIRMED → NEW
Ever confirmed: true

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.

Attachment

General

Created:
Updated:
Size: