Bug 14736 - Safari implementation of text-shadow off by 1px
Summary: Safari implementation of text-shadow off by 1px
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.css3.info/selectors-test/t...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-23 15:00 PDT by David Storey
Modified: 2007-12-14 11:38 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Storey 2007-07-23 15:00:46 PDT
This issue is causing us problems now we (Opera) support text-shadow.  It will likely cause iCab and KHTML similar problems.

Text with text shadow on this page and others that use an offset of 2px 2px displays like double text in Opera.  Our analysis is as follows:

"1. Safari always uses antialiased text, where Opera on my laptop uses no antialiasing, but has a very thin (1px) font line. This means Safari blurs the shadow too as part of the antialias, making it rest against the text, where Opera shows it separate. Gogi antialiases as well.

"2. They (the site) ask for a 2px 2px offset, which Opera dutifully does. Safari uses 1px 1px, so there is no gap between the text and the shadow, where there is in Opera.

"safari has a weird formula for shadow offset:
offset = ( offset/abs(offset) ) * ( abs(offset)-1 )

so:
3 -> 2
2 -> 1
1 -> 0
0 -> 0
-1 -> 0
-2 -> 1
-3 -> 2

due to the 1px error in Safari, fixing this issue for Opera (and to render as the author intends it to look) and making the offset 1px 1px would make the shadow disappear in Safari.  

With the current implementation one can either make it look correct in Opera and broken in Safari or work correctly in Safari and broken in Opera.  

any chance of getting this 1px error fixed in Safari 3?
Comment 1 mitz 2007-07-23 15:10:37 PDT
(In reply to comment #0)
> "safari has a weird formula for shadow offset:
> offset = ( offset/abs(offset) ) * ( abs(offset)-1 )

Is that from WebKit source code?

See also bug 12943.
Comment 2 David Storey 2007-07-23 15:26:53 PDT
It is from our QA analysis.  I'm not sure if they got it from the source, but I'd guess from testing the issue.  I can check with them if needed however.

Comment 3 David Storey 2007-07-24 02:20:05 PDT
The analysis was pseudo-code to describe the issue, not the actual source.  It may not be 100% correct but it is the gist of the problem
Comment 4 mitz 2007-07-24 02:47:33 PDT
(In reply to comment #3)
> The analysis was pseudo-code to describe the issue, not the actual source.  It
> may not be 100% correct but it is the gist of the problem

Thanks for clarifying that. I suspect that like bug 12943, this behavior stems from an issue with the Core Graphics framework in Tiger. If that is the case and the analysis is sound, perhaps a workaround could be implemented based on it.
Comment 5 Pascal 2007-11-13 15:00:11 PST
Just to note, this Bug is also present in Leopard 10.5 and therefore affects not only Safari but all WebKit-using Applictions... and gives me a headache as a Widget developer...
Comment 6 mitz 2007-12-14 11:38:54 PST
Fixed in <http://trac.webkit.org/projects/webkit/changeset/28714>.