Bug 12874 - execCommand FontSize -webkit-xxx-large instead of passed px value
: execCommand FontSize -webkit-xxx-large instead of passed px value
: WebKit
HTML Editing
: 523.x (Safari 3)
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To:
  Show dependency treegraph
Reported: 2007-02-23 19:09 PST by
Modified: 2010-10-06 17:46 PST (History)



You need to log in before you can comment on or make changes to this bug.

Description From 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 From 2007-03-06 16:33:33 PST -------
We changed this operation to match the spec:
------- Comment #2 From 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 From 2010-10-06 17:46:28 PST -------
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.