It seems like everything is working as intended. See Bug 13490 on WebKit BugZilla.
EDIT: Support for styleWithCSS was added to WebKit's source in changeset 40560, on 03 February 2009.
That said, it seems like ever since then, no matter what, styleWithCSS
is always set to false
, whereas before the change, style commands were always applied with CSS, as if styleWithCSS
existed but was always set to true
.
I even tried rewriting your document.execCommand
line as follows, in accordance with the Mozilla documentation:
document.execCommand("styleWithCSS", true, null);
document.execCommand("bold", false, null);
These modified commands still work in Firefox, but not in either Chrome 5 or Safari 5 (both on Windows and installed today).
So, it would seem like this is a WebKit bug.