Bug 133420 (currentColor)

Summary: `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently
Product: WebKit Reporter: Chauncey McAskill <shimoroka>
Component: CSSAssignee: Benjamin Poulain <benjamin>
Severity: Normal CC: benjamin, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://jsfiddle.net/RDf4m/2/
Description Flags
Patch darin: review+

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>