Bug 11889 - Support stroking and filling of text in HTML using CSS
Summary: Support stroking and filling of text in HTML using CSS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-20 01:55 PST by Dave Hyatt
Modified: 2006-12-20 13:13 PST (History)
1 user (show)

See Also:


Attachments
Patch to implement this functionality (24.79 KB, patch)
2006-12-20 01:56 PST, Dave Hyatt
no flags Details | Formatted Diff | Diff
Add a layout test and fix a couple of bugs mitz noticed (158.82 KB, patch)
2006-12-20 02:26 PST, Dave Hyatt
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2006-12-20 01:55:25 PST
Four new properties:

text-fill-color - Set the color to use when filling text.  If not set uses color.
text-stroke-color - Set the color to use when stroking text.  If not set uses color.
text-stroke-width - Set the width of the stroke.  If 0, no stroke happens.  Can take thin/medium/thick keywords to allow for a width that will auto-scale with the font size.
text-stroke - Shorthand for both text-stroke-* properties
Comment 1 Dave Hyatt 2006-12-20 01:56:56 PST
Created attachment 11928 [details]
Patch to implement this functionality

Here it is.  Note that this is vaguely similar to a draft CSS3 property called text-outline, but I wanted to impelment a text-stroke property just for our engine that will match precisely the CG behavior for text stroking.
Comment 2 Dave Hyatt 2006-12-20 02:26:16 PST
Created attachment 11929 [details]
Add a layout test and fix a couple of bugs mitz noticed

Added a layout test.
Comment 3 mitz 2006-12-20 02:44:46 PST
Comment on attachment 11929 [details]
Add a layout test and fix a couple of bugs mitz noticed

r=me
+            int strokeOverflow = rt->style()->textStrokeWidth() / 2 + 1;

Should be the other way around (add then divide).
Comment 4 Mark Rowe (bdash) 2006-12-20 11:23:33 PST
This was landed by Dave in r18340.
Comment 5 Ian 'Hixie' Hickson 2006-12-20 13:13:17 PST
Might be worth considering repurposing the SVG properties here, on the long term.