Bug 133420 (currentColor) - `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently
Summary: `currentColor` computes to the same colour on all elements, even if 'color' i...
Alias: currentColor
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Benjamin Poulain
URL: http://jsfiddle.net/RDf4m/2/
Depends on:
Reported: 2014-05-31 07:00 PDT by Chauncey McAskill
Modified: 2015-03-29 20:11 PDT (History)
2 users (show)

See Also:

Patch (34.20 KB, patch)
2015-03-28 23:15 PDT, Benjamin Poulain
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chauncey McAskill 2014-05-31 07:00:36 PDT
I've linked the test case on JSFiddle in the URL field above. The following URL is a StackOverflow thread explaining the situation in detail :


Essentially under Safari 6 and up (Safari 5, is unaffected), the `currentColor` CSS keyword computes to the same colour (the first colour it initially computes) on all subsequent elements and pseudo-elements. Notably on border and background colour properties.

The keyword will sometimes compute to the proper colours depending on browser re-paints, can't quite reproduce.

This issue is related to :
- https://bugs.webkit.org/show_bug.cgi?id=80454
- https://bugs.webkit.org/show_bug.cgi?id=117776
- https://bugs.webkit.org/show_bug.cgi?id=95083
Comment 1 Benjamin Poulain 2015-03-28 23:15:23 PDT
Created attachment 249678 [details]
Comment 2 Darin Adler 2015-03-29 16:40:22 PDT
Comment on attachment 249678 [details]

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

> Source/WebCore/css/StyleResolver.cpp:264
> +            const StyleProperties::PropertyReference current = properties.propertyAt(i);

I suggest auto here. Also, the const doesn’t add anything.

> Source/WebCore/css/StyleResolver.cpp:1718
> +    for (const auto& matchedProperties : matchResult.matchedProperties()) {

I don’t think you needed to add this const here. I believe would be const automatically.
Comment 3 Benjamin Poulain 2015-03-29 20:11:33 PDT
Committed r182130: <http://trac.webkit.org/changeset/182130>