execCommand justifycenter dont work

RESOLVED DUPLICATE of bug 414526

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 414526
6 years ago
6 years ago

People

(Reporter: zkizzik, Unassigned)

Tracking

7 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
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.
(Reporter)

Comment 1

6 years ago
in google chrome and ie 8 work but ff 7.0.1 not work.

Comment 2

6 years ago
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.

Comment 3

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 414526
You need to log in before you can comment on or make changes to this bug.