Bug 12874 - execCommand FontSize -webkit-xxx-large instead of passed px value
Summary: execCommand FontSize -webkit-xxx-large instead of passed px value
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2007-02-23 19:09 PST by Peer Bremer
Modified: 2010-10-06 17:46 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Peer Bremer 2007-02-23 19:09:05 PST
document.execCommand("FontSize", false, str);

Before passing "10px" to this function produced:

<SPAN class="Apple-style-span" style="font-size: 10px;">Text</SPAN>

Now this gives me no matter what I pass:
<span class="Apple-style-span" style="font-size: -webkit-xxx-large;">Text</span>

compactible format, with much less control unless there is another web kit command to pass a font size with a point or pixel value.
Comment 1 Justin Garcia 2007-03-06 16:33:33 PST
We changed this operation to match the spec:
Comment 2 Kai Bansner 2008-01-08 17:05:19 PST
I just did a little testing with the lastest nightly. You can set the font-size using .execCommand('FontSize' and values 1-7, but .queryCommandValue('FontSize') returns the font-size in pixels... 

Not consistent units! Is there a way to convert the result of .queryCommandValue('FontSize') to the corresponding 1-7 value in order to increment font size?

Comment 3 Emerick Rogul 2010-10-06 17:46:28 PDT
I think this bug should be reopened.  Comment #1 indicates that the behavior was changed to match Microsoft's spec.  The provided link is dead, but I believe the following link replaces it:


Based on the information in that spec, I should be able to specify 14pt or 14px (among a number of other types).  However, WebKit just converts these to -webkit-xxx-large.