Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a4497016d608d8288e1921042b2ec71e6f538fe1
https://github.com/WebKit/WebKit/commit/a4497016d608d8288e1921042b2ec71e6f538fe1
Author: Tim Nguyen <[email protected]>
Date: 2023-09-21 (Thu, 21 Sep 2023)
Changed paths:
M Source/WebCore/display/css/DisplayBoxDecorationPainter.cpp
M Source/WebCore/rendering/BorderPainter.cpp
Log Message:
-----------
REGRESSION(266134@main): 3D border-style have very low contrast with very
dark border-color
https://bugs.webkit.org/show_bug.cgi?id=261847
rdar://115812372
Reviewed by Darin Adler.
266134@main made 3D border styles like groove, ridge, inset, and outset honor
the border-color instead of hardcoding a gray color.
Unfortunately, when a dark border-color is used, there is very little contrast
between the light border and the dark border.
To fix this, we follow Firefox's algorithm of special casing very dark colors
by contrasting 2 lightened versions of the border-color.
See Firefox's algorithm for reference:
https://searchfox.org/mozilla-central/rev/077fc34d03b85b09add26b5f99f1a3a3a72c8720/gfx/wr/webrender/res/cs_border_segment.glsl#112-132
* Source/WebCore/display/css/DisplayBoxDecorationPainter.cpp:
(WebCore::Display::BorderPainter::calculateBorderStyleColor):
* Source/WebCore/rendering/BorderPainter.cpp:
(WebCore::BorderPainter::calculateBorderStyleColor):
Canonical link: https://commits.webkit.org/268265@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes