Bug 65361 - background color affects the font color in disabled textarea
Summary: background color affects the font color in disabled textarea
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-28 23:11 PDT by Ryosuke Niwa
Modified: 2011-10-12 02:13 PDT (History)
7 users (show)

See Also:


Attachments
demo (689 bytes, text/html)
2011-07-28 23:11 PDT, Ryosuke Niwa
no flags Details
proposed patch (1.63 KB, patch)
2011-09-28 04:59 PDT, Vineet Chaudhary (vineetc)
darin: review-
Details | Formatted Diff | Diff
Updated Patch (78.55 KB, patch)
2011-10-03 03:51 PDT, Vineet Chaudhary (vineetc)
darin: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
updated patch (81.26 KB, patch)
2011-10-04 03:09 PDT, Vineet Chaudhary (vineetc)
darin: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
updated patch (81.27 KB, patch)
2011-10-07 05:55 PDT, Vineet Chaudhary (vineetc)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-07-28 23:11:37 PDT
Created attachment 102333 [details]
demo

font color of disabled textarea is affected by the background color.  Namely, textarea with background-color: white and background-color: transparent result in different alpha values for the font color.
Comment 1 Vineet Chaudhary (vineetc) 2011-09-28 04:59:50 PDT
Created attachment 109005 [details]
proposed patch

Another solution to this could be tweaking minColorContrastValue this value but this could be too general.
Comment 2 Darin Adler 2011-09-28 09:41:18 PDT
Comment on attachment 109005 [details]
proposed patch

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

Checking specifically for the Color::transparent value is not right. The right way to check that something is transparent is to check its alpha channel only, not to explicitly check for a particular RGB as well as alpha. We could have a minimum alpha value. It's a good insight, though, that difference from white is meaningless for a transparent or mostly transparent color.

To refine the rule, I’m not sure if simply using lightening unconditionally is the right way to handle a transparent or translucent background color. It seems we’d want to figure out the likely color from behind the text to have a good chance of getting the behavior right.

> Source/WebCore/ChangeLog:10
> +        No new tests. (OOPS!)

Bug fixes need to come with test cases. That includes this one.
Comment 3 Vineet Chaudhary (vineetc) 2011-09-30 00:09:03 PDT
(In reply to comment #2)
> (From update of attachment 109005 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109005&action=review
> 
> Checking specifically for the Color::transparent value is not right. The right way to check that something is transparent is to check its alpha channel only, not to explicitly check for a particular RGB as well as alpha. We could have a minimum alpha value. It's a good insight, though, that difference from white is meaningless for a transparent or mostly transparent color.
> 
> To refine the rule, I’m not sure if simply using lightening unconditionally is the right way to handle a transparent or translucent background color. It seems we’d want to figure out the likely color from behind the text to have a good chance of getting the behavior right.

Yes we should check for backgroundColor.alpha() while setting the textColor, as below

backgroundColor.alpha() < 0.5  (0.5 or a value which we decide upon.)

Please provide your thought.

> 
> > Source/WebCore/ChangeLog:10
> > +        No new tests. (OOPS!)
> 
> Bug fixes need to come with test cases. That includes this one.
Comment 4 Darin Adler 2011-09-30 09:43:58 PDT
(In reply to comment #3)
> Yes we should check for backgroundColor.alpha() while setting the textColor, as below
> 
> backgroundColor.alpha() < 0.5  (0.5 or a value which we decide upon.)

Sounds OK. Not sure it will handle all cases well, but better than the current code or the current patch.
Comment 5 Vineet Chaudhary (vineetc) 2011-10-03 03:51:03 PDT
Created attachment 109462 [details]
Updated Patch

(In reply to comment #4)
> (In reply to comment #3)
> > Yes we should check for backgroundColor.alpha() while setting the textColor, as below
> > 
> > backgroundColor.alpha() < 0.5  (0.5 or a value which we decide upon.)
> 
> Sounds OK. Not sure it will handle all cases well, but better than the current code or the current patch.

Attached updated patch as per review comments.
Also extended test case input-disabled-color.html to check this behavior.
Comment 6 WebKit Review Bot 2011-10-03 04:16:47 PDT
Comment on attachment 109462 [details]
Updated Patch

Attachment 109462 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9928384

New failing tests:
fast/forms/input-disabled-color.html
Comment 7 Darin Adler 2011-10-03 07:46:18 PDT
Comment on attachment 109462 [details]
Updated Patch

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

> LayoutTests/ChangeLog:12
> +        * platform/gtk/fast/forms/input-disabled-color-expected.png:
> +        * platform/gtk/fast/forms/input-disabled-color-expected.txt:

Patch will need output for platforms other than GTK. Landing this with GTK results only will make all the bots red.
Comment 8 Vineet Chaudhary (vineetc) 2011-10-04 03:09:40 PDT
Created attachment 109601 [details]
updated patch

Please review the modified patch.
I think other ports needs to rebaseline to pass test case.
Comment 9 WebKit Review Bot 2011-10-06 18:12:34 PDT
Comment on attachment 109601 [details]
updated patch

Rejecting attachment 109601 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
out of 1 hunk FAILED -- saving rejects to file LayoutTests/platform/chromium/test_expectations.txt.rej
patching file LayoutTests/platform/gtk/fast/forms/input-disabled-color-expected.txt
patching file LayoutTests/platform/mac/test_expectations.txt
patching file LayoutTests/platform/qt/test_expectations.txt
patching file LayoutTests/platform/win/test_expectations.txt

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--reviewer', u'Darin Adler', u'--force']" exit_code: 1

Full output: http://queues.webkit.org/results/10009021
Comment 10 Vineet Chaudhary (vineetc) 2011-10-07 05:55:14 PDT
Created attachment 110131 [details]
updated patch

commit queue failed as LayoutTests/platform/chromium/test_expectations.txt got modified.
Attaching new patch for the same.
Comment 11 Darin Adler 2011-10-07 10:00:46 PDT
I don’t think this patch correctly skips the test on the Mac, since new-run-webkit-tests is not yet used on the Mac so test expectations are not used there.
Comment 12 Ryosuke Niwa 2011-10-07 10:07:42 PDT
(In reply to comment #11)
> I don’t think this patch correctly skips the test on the Mac, since new-run-webkit-tests is not yet used on the Mac so test expectations are not used there.

As far as I know, Mac port currently uses nrwt. Mac WebKit2 port doesn't, however.
Comment 13 WebKit Review Bot 2011-10-07 10:43:15 PDT
Comment on attachment 110131 [details]
updated patch

Clearing flags on attachment: 110131

Committed r96958: <http://trac.webkit.org/changeset/96958>
Comment 14 WebKit Review Bot 2011-10-07 10:43:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Ryosuke Niwa 2011-10-11 14:03:12 PDT
Mac rebaseline done in http://trac.webkit.org/changeset/97179.
Comment 16 Kent Tamura 2011-10-12 02:13:59 PDT
Chromium rebaseline: http://trac.webkit.org/changeset/97247