New issue
Advanced search Search tips

Issue 914728 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 14
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Compat



Sign in to add a comment

SVG gradient using currentColor not updated on color change

Reported by jan.boes...@incors.com, Dec 13

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Example URL:

Steps to reproduce the problem:
Open the attached test.html or the codepen at https://codepen.io/anon/pen/PXPxgp

Clicking on the "toggle Color" checkbox changes the "color" style property of the body element. This should be reflected in the color of the checkbox text and both circles.

The first circle, which uses a gradient for the fill, does not reflect the color change

What is the expected behavior?
Both circles should turn blue if the checkbox is clicked.

What went wrong?
The change to the color is not reflected by the gradient in the first circle.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 71.0.3578.98  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

This is probably related to  issue 626744 .

Interestingly this issue only occurs on the initial zoom level. If you zoom in or out (even before clicking the checkbox), the issue does not occur. If you zoom back to the initial zoom level, the issue is back.
 
currentColorIssue.png
10.2 KB View Download
Here is the test case as a single html file
test.html
800 bytes View Download
Bisected to 40be0e0b1e39d6f923643d7792b67235361bc156 
"Don't transition a property that is currentColor when color changes"
Landed in 39.0.2151.0 via r293795


Components: Blink>SVG
Labels: -OS-Windows
Status: Available (was: Unconfirmed)
Summary: SVG gradient using currentColor not updated on color change (was: SVG filters using currentColor not updated on color change)
Related bug or duplicate: issue 595467
Although not SVG, this issue is probably related, too: issue 777934
Owner: f...@opera.com
Status: Assigned (was: Available)
Those are different types of gradients, but thanks for bringing them up.

Looks like I "accidentally" had a fix lying around waiting for this bug.
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a1769bde7021b7424820f9ed9762c5b64fa15d9f

commit a1769bde7021b7424820f9ed9762c5b64fa15d9f
Author: Fredrik Söderquist <fs@opera.com>
Date: Fri Dec 14 14:13:37 2018

Use StyleColor for the stop-color property

This changes the ComputedStyle storage for the stop-color property to be
a StyleColor rather than a plain color. This fixes explicit inheritance
for the property ('currentcolor' computes to itself).
It also means we'll properly pick up changes to 'color'.

Bug:  914728 
Change-Id: I3c78a3615220b9149d1ea5102a6e5863526a6d51
Reviewed-on: https://chromium-review.googlesource.com/c/1377437
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#616660}
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/css/css_properties.json5
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/frame/document_loading_rendering_test.cc
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/style/computed_style.h
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/style/svg_computed_style.h
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/style/svg_computed_style_defs.cc
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/style/svg_computed_style_defs.h
[modify] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/renderer/core/svg/svg_stop_element.cc
[add] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/web_tests/external/wpt/svg/pservers/parsing/stop-color-computed.svg
[add] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/web_tests/external/wpt/svg/pservers/reftests/reference/green-100x100.svg
[add] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/web_tests/external/wpt/svg/pservers/reftests/stop-color-currentcolor-dynamic-001.svg
[add] https://crrev.com/a1769bde7021b7424820f9ed9762c5b64fa15d9f/third_party/blink/web_tests/external/wpt/svg/pservers/scripted/stop-color-inheritance-currentcolor.svg

Status: Fixed (was: Assigned)
I can confirm that the issue does not occur anymore in the test case and in our real world scenario. Tested against current Canary 73.0.3642.0.

Thanks so much for fixing this so quickly.

Sign in to add a comment