Bug 258725 - Stop resolving border's current color to some hardcoded value
Summary: Stop resolving border's current color to some hardcoded value
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 256528 (view as bug list)
Depends on:
Blocks: 261847
  Show dependency treegraph
 
Reported: 2023-06-30 06:31 PDT by Vitaly Dyackhov
Modified: 2023-09-20 19:48 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Dyackhov 2023-06-30 06:31:12 PDT
In `Color RenderStyle::colorResolvingCurrentColor(CSSPropertyID colorProperty, bool visitedLink) const` we currently return some hardcoded value for border colors:
```
auto result = unresolvedColorForProperty(colorProperty, visitedLink);

if (result.isCurrentColor()) {
    auto borderStyle = [&] {
        switch (colorProperty) {
        case CSSPropertyBorderLeftColor:
            return borderLeftStyle();
        case CSSPropertyBorderRightColor:
            return borderRightStyle();
        case CSSPropertyBorderTopColor:
            return borderTopStyle();
        case CSSPropertyBorderBottomColor:
            return borderBottomStyle();
        default:
            return BorderStyle::None;
        }
    }();

    if (!visitedLink && (borderStyle == BorderStyle::Inset || borderStyle == BorderStyle::Outset || borderStyle == BorderStyle::Ridge || borderStyle == BorderStyle::Groove))
        return { SRGBA<uint8_t> { 238, 238, 238 } };

    return visitedLink ? visitedLinkColor() : color();
}

```

I can't think of any good reason for doing this.

The result can be unexpected for web developers.
Comment 1 Vitaly Dyackhov 2023-06-30 06:35:45 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15447
Comment 2 Radar WebKit Bug Importer 2023-07-07 06:32:16 PDT
<rdar://problem/111905474>
Comment 3 Ahmad Saleem 2023-07-14 12:06:07 PDT
*** Bug 256528 has been marked as a duplicate of this bug. ***
Comment 4 EWS 2023-07-18 11:12:53 PDT
Committed 266134@main (0aa032e26bbd): <https://commits.webkit.org/266134@main>

Reviewed commits have been landed. Closing PR #15447 and removing active labels.
Comment 5 Simon Fraser (smfr) 2023-07-18 13:26:32 PDT
Do we understand why this code was added in the first place?
Comment 6 Simon Fraser (smfr) 2023-09-20 19:48:23 PDT
This caused https://bugs.webkit.org/show_bug.cgi?id=261847