Closed Bug 694783 Opened 13 years ago Closed 13 years ago

execCommand justifycenter dont work

Categories

(Firefox :: General, defect)

7 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 414526

People

(Reporter: zkizzik, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Build ID: 20110928134238

Steps to reproduce:

execCommand with justifycenter dont work.
<a href="#" onclick="document.execCommand('justifycenter', false, null); return false;">test</a>
<div contenteditable="true" spellcheck="false" unselectable="off">test</div>

Error console:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: http://js.nicedit.com/nicEdit-latest.js :: <TOP_LEVEL> :: line 38"  data: no]

Example: http://nicedit.com/demos.php try center text.


Actual results:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: http://js.nicedit.com/nicEdit-latest.js :: <TOP_LEVEL> :: line 38"  data: no]


Expected results:

Center the div edit with contenteditable = true.
in google chrome and ie 8 work but ff 7.0.1 not work.
Based on the documentation at https://developer.mozilla.org/en/rich-text_editing_in_mozilla I created the following example that is WFM

<html>

<head>
<title>Bug 694783</title>
</head>


<body contentEditable="true">

<a href="#" onclick="document.execCommand('justifycenter', false, null); return false;">test</a>
<div contenteditable="true" spellcheck="false" unselectable="off">test</div>
</body>
</html>

The above works for me on the latest nightly.

Please provide a public URL or reduced test case that exhibits this issue.
Works for me on Firefox8.0beta

Fixed range;
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=9349ae9094f6&tochange=b497df3f79fc

Fixed by Bug 414526.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.