Bug 76490 - Missing NSForegroundColorAttributeName should be treated as black instead of transparent
Summary: Missing NSForegroundColorAttributeName should be treated as black instead of ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.7
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2012-01-17 15:53 PST by Enrica Casucci
Modified: 2012-01-18 10:44 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.51 KB, patch)
2012-01-17 16:00 PST, Enrica Casucci
darin: review+
Details | Formatted Diff | Diff
Patch with test (9.36 KB, patch)
2012-01-17 18:19 PST, Enrica Casucci
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2012-01-17 15:53:35 PST
The problem appears in Mail on Lion using the Fonts and Colors palette to customize colors and fonts.

* STEPS TO REPRODUCE
1. Create new message, write some text.
2. Select text, use color picker to change color to a color other than black.
3. With text still selected, use color picker to change color to black.

* RESULTS
Text becomes invisible/transparent. It should be black.

* REGRESSION
The Fonts and Color palette work as expected in previous version of Mac OSX.
Comment 1 Enrica Casucci 2012-01-17 15:53:48 PST
<rdar://problem/9460733>
Comment 2 Enrica Casucci 2012-01-17 15:55:47 PST
AppKit's behavior changed in Lion. If the NSForegroundColorAttributeName is solid black, it is removed from the attributes dictionary. WebKit used to treat the missing color as an indication of transparent color.
Comment 3 Enrica Casucci 2012-01-17 16:00:52 PST
Created attachment 122833 [details]
Patch
Comment 4 Enrica Casucci 2012-01-17 18:07:33 PST
Thanks for the review!
Dan pointed out that I should write a TestWebKitAPI test and has shown me how to do it.
I'll post another patch that has the test.
Comment 5 Enrica Casucci 2012-01-17 18:19:24 PST
Created attachment 122856 [details]
Patch with test
Comment 6 mitz 2012-01-17 18:38:30 PST
Comment on attachment 122856 [details]
Patch with test

View in context: https://bugs.webkit.org/attachment.cgi?id=122856&action=review

> Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm:28
> +#import <WebKit/DOMPrivate.h>

Is thIs needed?
Comment 7 Enrica Casucci 2012-01-18 10:05:33 PST
(In reply to comment #6)
> (From update of attachment 122856 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=122856&action=review
> 
> > Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm:28
> > +#import <WebKit/DOMPrivate.h>
> 
> Is thIs needed?

No, I've removed it. Thanks for pointing it out.
Comment 8 Enrica Casucci 2012-01-18 10:12:54 PST
http://trac.webkit.org/changeset/105291
Comment 9 Eric Vitiello 2012-01-18 10:44:49 PST
Just wanted to say thanks for fixing this. it drives me nuts.