If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

NEW
Unassigned

Status

()

Core
Editor
10 years ago
6 years ago

People

(Reporter: Ionut MOICIANU, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

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

Updated

10 years ago
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
You need to log in before you can comment on or make changes to this bug.