RESOLVED LATER 20321
font sizes in design mode
https://bugs.webkit.org/show_bug.cgi?id=20321
Summary font sizes in design mode
Philip Tucker
Reported 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?
Attachments
Justin Garcia
Comment 1 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.
Ahmad Saleem
Comment 2 2022-06-27 17:06:57 PDT
I think following test case do provide bit of coverage for fontsize via execCommand but not when they are defined as "x-small" etc. Link - https://github.com/WebKit/WebKit/blob/main/LayoutTests/editing/execCommand/query-font-size.html But if I take the test case and make it JSfiddle as below: https://jsfiddle.net/1z9etd8k/1/ In Line 92 to 94, I added these "x-small" etc. and got output value of 3 in Safari 15.5 on macOS 12.4, which is same as Chrome Canary 105. But Firefox Nightly 103, does not produce any output for these new additions. Further, Firefox also not produce any output for Manual CSS font-size tests. I might be doing it completely wrong but I think updating the test and raising this as part of InterOp 2022 for "execCommand" could be good. If I am testing incorrectly or screwed-up on test case update then ignore my comment. Thanks!
Ryosuke Niwa
Comment 3 2022-06-27 21:43:34 PDT
Google docs no longer uses content editable. We can consider better spec'ing fontSize but let's not reuse this bug for that.
Note You need to log in before you can comment on or make changes to this bug.