Open Bug 428896 Opened 16 years ago Updated 3 years ago

JS error if 'styleWithCSS' is set to false on a page that has no editable area defined

Categories

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

x86
Windows XP
defect

Tracking

()

People

(Reporter: imoician, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008041206 Minefield/3.0pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008041206 Minefield/3.0pre

JS error if 'styleWithCSS' is set to false on a page that has no editable area defined

Reproducible: Always

Steps to Reproduce:
1.
Load this page in FF3:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
function init() {
document.execCommand('styleWithCSS', false, false);
}
</script>
</head>

<body onload="init()">
  <div>some text here</div>
</body>
</html>
2.
3.
Actual Results:  
uncaught exception JS error is given
Component: General → Editor
Product: Firefox → Core
Version: unspecified → Trunk
QA Contact: general → editor
Much simpler test:

data:text/html,<!doctype html>
no exception
<script>
try { document.execCommand("stylewithcss", false, false) }
catch(e) { document.body.textContent = 'exception' }
</script>

Result is "exception", should be "no exception".  This should be fixed by associating the CSS styling flag with the document, per spec, not with a command manager.  IE, WebKit, and Opera don't have this bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.

If you have reason to believe this is wrong, 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.