Bug 20321 - font sizes in design mode
Summary: font sizes in design mode
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2008-08-07 13:35 PDT by Philip Tucker
Modified: 2008-08-07 13:39 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 Philip Tucker 2008-08-07 13:35:07 PDT
I'm an engineer on Google Documents. We're running into an issue with HTML font translations in Safari, and I was wondering if you could shed some light.

In Safari, in design mode, if we call execCommand('fontSize', size), where size is 1...7, we get:

<span class="Apple-style-span" style="font-size: x-small;">8</span>
<span class="Apple-style-span" style="font-size: small;">10</span>
<span class="Apple-style-span" style="font-size: medium;">12</span>
<span class="Apple-style-span" style="font-size: large;">14</span>
<span class="Apple-style-span" style="font-size: x-large;">18</span>
<span class="Apple-style-span" style="font-size: xx-large;">24</span>
<span class="Apple-style-span" style="font-size: -webkit-xxx-large;">36</span>

No xx-small, and -webkit-xxx-large for the largest size.

The problem is, these font sizes (xx-small ... xx-large) render differently between IE  (which maps xx-small -> 1, x-small -> 2 ... xx-large -> 7) and both Firefox and Safari (which maps xx-small -> 1, x-small -> 1, small -> 2, ... xx-large -> ???). Do you know why this discrepancy exists? Is there a better way to apply font sizes that is more consistent across browsers?
Comment 1 Justin Garcia 2008-08-07 13:39:03 PDT
Hey it looks like we implemented this wrong.  It looks like all of the browsers use a font tag with size="n", even if they've been told to styleWithCSS.