Bug 115510 - Disabled textarea with transparent background-color does not render certain grey tones (foreground color) correctly
Summary: Disabled textarea with transparent background-color does not render certain g...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.8
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2013-05-02 03:36 PDT by Jens Nehlmeier
Modified: 2023-07-22 03:25 PDT (History)
11 users (show)

See Also:


Attachments
Textarea with wrong rendered foreground color (1.58 KB, text/html)
2013-05-02 03:36 PDT, Jens Nehlmeier
no flags Details
Safari 16 display some disabled textarea different from other browsers (2.15 MB, image/png)
2022-09-30 15:45 PDT, Ahmad Saleem
no flags Details
STP174 vs Safari 16.5.1 vs Chrome Canary 117 (610.08 KB, image/png)
2023-07-22 03:25 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Nehlmeier 2013-05-02 03:36:13 PDT
Created attachment 200306 [details]
Textarea with wrong rendered foreground color

The summary pretty much speaks for itself.

If you do not specify a foreground color for disabled textareas, Webkit will lighten up the current foreground color to visualize the disabled status. 

Adding "background-color:transparent" to such a disabled textarea alters the behavior for certain grey tones. For example "color: #55555;" works as expected but "color: #A0A0A0"  results in nearly white text to be rendered instead of a light grey tone.

So with "background-color:transparent" WebKit does some wrong color calculations during rendering.

I have attached a demo that illustrates the problem. It contains a set of 4 textareas with different foreground colors. This set is repeated 4 times (enabled/disabled with and without background-color:transparent) and in the last set the last two textareas behave wrong (color is too bright).

Discovered using Safari on Mac OS 10.7 & 10.8, as well as Webkit Nightly for Mac.
Comment 1 Radar WebKit Bug Importer 2013-05-02 13:47:30 PDT
<rdar://problem/13795885>
Comment 2 Craig Kovatch 2020-06-24 20:50:54 PDT
Interesting workaround for this -- WebKit interprets `transparent` as `rgba(0,0,0,0)`. If you set background-color to `rgba(255,255,255,0)` instead of `transparent`, results are as-expected.
Comment 3 Craig Kovatch 2020-06-24 20:52:06 PDT
This bug is also present on <input> elements
Comment 4 Ahmad Saleem 2022-09-30 15:45:29 PDT
Created attachment 462736 [details]
Safari 16 display some disabled textarea different from other browsers

As can be seen from attached, Safari 16 do differ in disabled textarea and in few cases, in background-color: transparent as well.

We should align with other browsers and make it better. Thanks!
Comment 5 Ahmad Saleem 2022-09-30 15:49:03 PDT
Chrome has following in UA Stylesheet for disabled:

textarea:disabled {
  border-color: rgba(118, 118, 118, 0.3);

and

textarea:disabled {
    cursor: default;
    background-color: -internal-light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3));
    color: -internal-light-dark(#545454, #aaaaaa);
Comment 6 Karl Dubost 2023-02-01 15:39:23 PST
Thanks Ahmad.
In terms of readability the case with transparent is pretty bad.
Comment 7 Ahmad Saleem 2023-07-22 03:25:34 PDT
Created attachment 467088 [details]
STP174 vs Safari 16.5.1 vs Chrome Canary 117

@Karl - I think it is just duplicate of another bug you fixed to make 'disabled' textarea content more readable.