Firefox throws Exception for the insertorderedlist command if <div contenteditable="true"> is within a table!

UNCONFIRMED
Unassigned

Status

()

Core
Editor
UNCONFIRMED
7 years ago
7 years ago

People

(Reporter: Simon, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0b10) Gecko/20100101 Firefox/4.0b10
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b10) Gecko/20100101 Firefox/4.0b10

Considering the following file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Demo</title>
    </head>
    <body>
        <table><tr><td>Text:</td><td>
            <div style="border: 1px solid; width: 300px; height: 300px;" contentEditable="true"></div> 
            <button onclick="document.execCommand('insertorderedlist', false, null);">List</button>
        </td></tr></table>
    </body>
</html>

Firefox throws the following error when the button is clicked:

Fehler: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: (...) :: onclick :: line 1"  data: no]

Reproducible: Always

Steps to Reproduce:
1. Copy the code above to a separate file
2. Load the file in Firefox
3. Enter the word "hello" in the black-framed box
4. Select the word "hello"
5. Click the button "List"
Actual Results:  
Fehler: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: (...) :: onclick :: line 1"  data: no]

Expected Results:  
The word "hello" should be displayed as a list-item

Also try this:
1. Write the word "hello".
2. Hit enter to get into the next line.
3. Enter the word "world" in the second line
4. Select the word "world"
5. Click the button "List"
It seems to work as long as the list is not inserted at the beginning of the div-element. Once we remove the surrounding <table> element. The list is created perfectly, even for elements in the first line.
Repro'd with Mozilla/5.0 (Windows NT 5.1; rv:2.0b11pre) Gecko/20110201 Firefox/4.0b11pre ID:20110201030339
Component: General → Editor
Keywords: testcase
Product: Firefox → Core
QA Contact: general → editor
Version: unspecified → Trunk
Created attachment 508781 [details]
Reporter's Testcase

Updated

7 years ago
Summary: Firefox throws Exception if <div contenteditable="true"> is within a table! → Firefox throws Exception for the insertorderedlist command if <div contenteditable="true"> is within a table!
You need to log in before you can comment on or make changes to this bug.