[Webkit-unassigned] [Bug 218798] -webkit-text-fill-color:currentColor not working on disabled inputs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 12 01:59:11 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=218798

Antti Koivisto <koivisto at iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Antti Koivisto <koivisto at iki.fi> ---
This appears to work as designed. The behavior change Safari 13->14 is a progression from handling currentColor correctly.

The logic is that the disabled color is a lightened (or darkened, depending on the background color) version of the original color. In this case it produces a lighter shade of blue. The color change is only applied to the inner shadow element so it is not visible via getComputedStyle.

As you note you can disable the behavior by specifying the color explicitly using -webkit-text-fill-color. Using currentColor there does nothing as it is the default value (and currentColor is then resolved against the modified color in the inner element).

Here is the full color change logic:

Color RenderTheme::disabledTextColor(const Color& textColor, const Color& backgroundColor) const
{
    // The explicit check for black is an optimization for the 99% case (black on white).
    // This also means that black on black will turn into grey on black when disabled.
    Color disabledColor;
    if (equalIgnoringSemanticColor(textColor, Color::black) || backgroundColor.alphaAsFloat() < minDisabledColorAlphaValue || textColor.luminance() < backgroundColor.luminance())
        disabledColor = textColor.lightened();
    else
        disabledColor = textColor.darkened();

    // If there's not very much contrast between the disabled color and the background color,
    // just leave the text color alone. We don't want to change a good contrast color scheme so that it has really bad contrast.
    // If the contrast was already poor, then it doesn't do any good to change it to a different poor contrast color scheme.
    if (contrastRatio(disabledColor.toSRGBALossy<float>(), backgroundColor.toSRGBALossy<float>()) < minColorContrastValue)
        return textColor;

    return disabledColor;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210112/9bef5718/attachment.htm>


More information about the webkit-unassigned mailing list