New issue
Advanced search Search tips

Issue 709730 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , All
Pri: 2
Type: Bug



Sign in to add a comment

CSS conic-gradient color-stops doesn't support calc() with percentages in angles

Reported by yio...@gmail.com, Apr 8 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Steps to reproduce the problem:
1. Open http://jsbin.com/corawafite/edit?html,css,output

background-image: conic-gradient(green calc(100%), transparent 0 100%);

What is the expected behavior?
The background color is green

What went wrong?
No background color

Did this work before? N/A 

Chrome version: 59.0.3066.0  Channel: canary
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 25.0 r0
 

Comment 1 by ajha@chromium.org, Apr 10 2017

Labels: Needs-Triage-M59
Cc: kkaluri@chromium.org
Components: Blink>CSS
Labels: -Needs-Triage-M59 Needs-triage-Mobile M-59
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Mac 10.12.4, Windows 10 and Ubuntu 14.04 with chrome #57.0.2987.133, canary #59.0.3066.0 and also in earlier version M30 - #30.01549.0. This is a non-regression issue, hence marking it as untriaged

Observed background of circle has no color.
Attaching a screen-cast for reference.


Thank You...
Issue 709730.mp4
384 KB View Download

Comment 3 by yio...@gmail.com, Apr 10 2017

Please make sure "chrome://flags/#enable-experimental-web-platform-features" flag is enabled.

Cc: f...@opera.com
Labels: -OS-Mac OS-All
Owner: fmalita@chromium.org
Status: Started (was: Untriaged)

Comment 5 by f...@opera.com, Apr 10 2017

I started on a fix for this (too), but might not be able to get all the collateral damage done today =). https://codereview.chromium.org/2813583002
Haha - almost identical: https://codereview.chromium.org/2814453002
Cc: -f...@opera.com fmalita@chromium.org
Owner: f...@opera.com
Labels: Hotlist-Interop
Labels: Update-Quarterly

Comment 10 by yio...@gmail.com, Apr 11 2017

At present, although we resolve this value, but in fact there is no effect (background color is not green)

background-image: conic-gradient(green calc(360deg), transparent 0 100%);

Comment 11 by yio...@gmail.com, Apr 11 2017

Add more test cases for reference:

conic-gradient(green calc(360deg), transparent 0 100%)
conic-gradient(green 0 calc(360deg), red 0 100%)
conic-gradient(green 360deg, red 0 calc(100%))
conic-gradient(green 360deg, red calc(0deg) calc(100%))
conic-gradient(green 360deg, red calc(0%) 100%)

conic-gradient(#f06, calc(20%), gold)
conic-gradient(#f06, calc(20% + 15deg), gold)
conic-gradient(#f06, calc(20%), gold, calc(60%), green)

conic-gradient(blue calc(10%) calc(20%), blue 30%, white)
conic-gradient(blue calc(10%) calc(45deg), blue 30%, white)
conic-gradient(blue calc(10%) calc(45deg), blue calc(30%) calc(160deg), white)
Project Member

Comment 12 by bugdroid1@chromium.org, Apr 11 2017

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

commit cc50825cf637990a4edfa90c9610ad072885c74d
Author: fs <fs@opera.com>
Date: Tue Apr 11 09:23:43 2017

Support calc(...) in ConsumeAngleOrPercent / for conic-gradient

Because of the explicit check for <percentage-token>, calc(...) would
not be properly handled for percentages. CSSGradientValue also wasn't
checking for calc() values when evaluating stops.
Rewrite ConsumeAngleOrPercent in a vein similar to
ConsumeLengthOrPercent.
Make CSSPrimitiveValue::IsAngle() consider resolved type, and update
CSSRotation TypedOM implementation to counter this.

BUG=709730

Review-Url: https://codereview.chromium.org/2813583002
Cr-Commit-Position: refs/heads/master@{#463585}

[modify] https://crrev.com/cc50825cf637990a4edfa90c9610ad072885c74d/third_party/WebKit/LayoutTests/fast/gradients/conic-gradient-parsing.html
[modify] https://crrev.com/cc50825cf637990a4edfa90c9610ad072885c74d/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
[modify] https://crrev.com/cc50825cf637990a4edfa90c9610ad072885c74d/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
[modify] https://crrev.com/cc50825cf637990a4edfa90c9610ad072885c74d/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp

Comment 13 by yio...@gmail.com, Apr 11 2017

Nice work! There are only conic-gradient(#f06, calc(20% + 15deg), gold) left.

Comment 14 by f...@opera.com, Apr 11 2017

Yepp, that combination wasn't directly supported by the calc() machinery, so will need some additional work (==probably a larger patch than the above.)

Comment 15 by yio...@gmail.com, May 12 2017

@fs Is there any progress?

Comment 16 by f...@opera.com, May 12 2017

Labels: OS-Windows
No, unfortunately not, sorry =/
Labels: -Needs-triage-Mobile
Labels: -Update-Quarterly
Summary: CSS conic-gradient color-stops doesn't support calc() with percentages in angles (was: CSS conic-gradient color-stops doesn't support calc())

Sign in to add a comment