execCommand formatBlock does not insert <DIV> elements

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
9 years ago
7 years ago

People

(Reporter: hdn, Unassigned)

Tracking

unspecified
x86_64
Windows 7
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

1001 bytes, text/html
Details
(Reporter)

Description

9 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Build Identifier: 3.7a2pre

Calls to document.execCommand('formatBlock', false, '<div>') returns true but nothing happens. No <div> element is inserted.

Reproducible: Always
(Reporter)

Comment 1

9 years ago
Created attachment 427316 [details]
Testcase

To reproduce: 
Open the attached file select some text and click the "Test <P> element" link. Everything works as expected. Refresh the page, select some text and click the "Test <DIV> element" link. Nothing happens.
(Reporter)

Comment 2

9 years ago
Quote: "Virtually all block style tags can be used"
https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#

Allthough it does not explicitly say that <DIV> elements are supported, I believe they qualify as reasonable block element to support. Otherwise the execCommand method should return false and not true.
Component: DOM: Core & HTML → Editor
QA Contact: general → editor
In Firefox 11.0, I get the following output:

"""
    Select this text and wrap in in a block element using the links below...
    

execCommand return value: true

HTML after:
<div>
    Select this text and wrap in in a block element using the links below...
    </div>
"""

So it seems like this has been fixed.  Please reopen if you can still reproduce.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
Duplicate of this bug: 316544
You need to log in before you can comment on or make changes to this bug.