Bug 18459 - text-shadow is not implemented
Summary: text-shadow is not implemented
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: George Staikos
URL: http://www.css3.info/preview/text-sha...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-13 09:41 PDT by Benjamin Meyer
Modified: 2010-08-16 08:19 PDT (History)
2 users (show)

See Also:


Attachments
Add text-shadow to the Qt port (4.85 KB, patch)
2008-06-19 11:39 PDT, Jonathon Jongsma (jonner)
no flags Details | Formatted Diff | Diff
minor cleanup to make the platform shadow functions empty (2.29 KB, patch)
2008-06-23 08:57 PDT, Jonathon Jongsma (jonner)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Meyer 2008-04-13 09:41:03 PDT
http://www.css3.info/preview/text-shadow/

or goto http://goldoptimusprime.com/ and the title "Transformers Gold Masterpiece Optimus Prime" should have a text shadow
Comment 1 Jonathon Jongsma (jonner) 2008-06-17 20:58:29 PDT
Just thought I'd leave a note that I'm currently working on this
Comment 2 Jonathon Jongsma (jonner) 2008-06-19 11:39:17 PDT
Created attachment 21843 [details]
Add text-shadow to the Qt port

Here's a potential Fix.  I also noticed that there's a commented-out function GraphicsContext::drawTextShadow() that seems to be out-of-date.  I assume this was written when text-shadows were done differently inside WebCore (before it supported multiple text-shadows perhaps?).  Anyway, my patch seems to roughly match what other ports do for text shadows.  I didn't remove the commented-out function yet since it seems to have a blur implementation and my patch doesn't support blurring yet.
Comment 3 Simon Hausmann 2008-06-23 06:17:52 PDT
In principle I agree with the patch :). I think however it would be nice to have a hasShadow() function in GraphicsContext that quickly determines whether a shadow is needed. Right now the condition is duplicated in this patch in some places as well as in the cairo GraphicsContext. What do you think?

Also a port of the old blurring code would be nice, as well as making setPlatformShadow empty, since all the information is now also stored in the common state in GraphicsContext::setShadow.


Comment 4 Jonathon Jongsma (jonner) 2008-06-23 06:30:31 PDT
Yes, I agree that a hasShadow() function would be useful.  I'll look into that.

Regarding the blur code -- I was planning on landing a plain text shadow first and then working on adding blur support as a separate patch.  If you'd like them all together, I can try to work on porting that code as part of this patch as well.
Comment 5 Simon Hausmann 2008-06-23 08:40:57 PDT
Actually, a separate patch for the hasShadow() as well as the blur is fine with me. And this patch looks good to me :)
Comment 6 Jonathon Jongsma (jonner) 2008-06-23 08:57:01 PDT
Created attachment 21883 [details]
minor cleanup to make the platform shadow functions empty

Here's a mini-patch that addresses the one other comment you had -- removing the functionality from the platform shadow functions.  For the other comments (hasShadow() and the blur implementations), I'll open new bugs.
Comment 7 Simon Hausmann 2008-06-24 03:36:46 PDT
Comment on attachment 21843 [details]
Add text-shadow to the Qt port

Landed in r34763
Comment 8 Simon Hausmann 2008-06-24 03:59:50 PDT
Comment on attachment 21883 [details]
minor cleanup to make the platform shadow functions empty

Looks good to me, landed in r34764 along with the removal of the TextShadow structure in GraphicsContextQt.
Comment 9 Simon Hausmann 2008-06-24 04:00:11 PDT
Comment on attachment 21883 [details]
minor cleanup to make the platform shadow functions empty

Clearing r+ since the patch is in.
Comment 10 Ariya Hidayat 2010-08-16 08:12:40 PDT
Comment on attachment 21843 [details]
Add text-shadow to the Qt port

BTW, any reason why the clip needs to be extended if there is shadow?
Comment 11 Jonathon Jongsma (jonner) 2010-08-16 08:19:23 PDT
It's been so long since I did this that I don't remember exactly (in fact, I haven't worked on WebKit at all in quite some time).  My guess is that when I was implementing this, the text shadow fell outside of the clip area and so was not drawn unless I expanded the clip.  But as I said, I don't remember this patch very well.  Is it causing problems for you?