Contact emails
Explainer
https://drafts.csswg.org/css-images-4/#color-stop-syntax
Spec
https://drafts.csswg.org/css-images-4/#color-stop-syntax
While Images 4 is still a WD, CSSWG has cleared double-position color stop syntax for shipping: [1], [2].
[1] https://github.com/w3c/csswg-drafts/issues/2439
[2] https://www.w3.org/2018/03/28-css-minutes.html#item07
Summary
This is a minor extension to the current gradient color stop syntax: when two consecutive stops use the same color, the author is allowed to omit the second stop and specify two positions instead. E.g.:
instead ofgreen 50% 75%
green 50%, green 75%
This simplifies the definition of solid gradient spans.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Demo link
https://leaverou.github.io/conic-gradient/
Risks
Interoperability and Compatibility
Compatibility risk: minimal. Syntax extension with a supporting polyfill (see Activation below) that's been around for a while. Both this implementation and the polyfill are spec-compliant, so no compatibility issues are expected.
Interoperability risk: low. This is a minor/backward-compatible usability improvement to existing gradient color stop syntax that has been in the draft for six years. CSSWG has cleared the feature for shipping, and, given the minimal effort required to support, will likely be implemented by all vendors.
Edge: No signals
Firefox: No signals (https://bugzilla.mozilla.org/show_bug.cgi?id=1352643)
Safari: No signals
Web developers: Positive.
Ergonomics
Minor usability improvement to existing gradient color stop syntax.
Activation
Lea Verou's cross-platform conic-gradient polyfill (https://leaverou.github.io/conic-gradient/) includes support for double-position color stop syntax.
Is this feature fully tested by web-platform-tests?
WIP (pull request: https://github.com/w3c/web-platform-tests/pull/10274)
Entry on the feature dashboard
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADgYMVdvtW8%2BuJgsGFHhJWMbwGcDUpHy5dgCbyiH1r1ckoFbCw%40mail.gmail.com.
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/398717bf-1e90-4e5d-a164-ed7a470bc00c%40chromium.org
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/398717bf-1e90-4e5d-a164-ed7a470bc00c%40chromium.org?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/e800fc37-f8f6-9a9d-13f2-cd25d21c8fd3%40mozilla.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADgYMVcGnd17ZNUdopyg4k-7jkvADF5So-0RDhXC26Yr%3Dcvocg%40mail.gmail.com.
Florin, I think would Blink be the first to ship support for this new syntax, can you confirm?
On the interop risk, that is the risk that other vendors will not ship the same change, or that it takes many years and we have a non-interoperable state in the interim. (Which we don't like because web developers are routinely bitten by interop issues.)With a small change like this, the interop risk is actually significant, since it's so easy to fall off the radar of someone.
What we can do to minimize the risk:
- Share all of our tests as web-platform-tests. (parsing PR merged)
- File bugs for all engines pointing to those tests and mention which browsers already pass. Perhaps with link to https://wpt.fyi/results/css/css-images/gradient/color-stops-parsing.html (append ?label=experimental to see more)
Florin, do you believe any tests beyond parsing tests are needed here? Since it's a kind of shorthand, it should be possible to write a reftest that makes sures that the interpretation is correct as well, right?
Since https://wpt.fyi/results/css/css-images/gradient/color-stops-parsing.html?label=experimental isn't passing I took a look in cs.chromium.org and was surprised to not see an -expected.txt file. And that the test passes when run. Why is that?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYf9yVXAfW6V6puCeN518dHODaxWL%2B4Vn6jD5J1-7aHDmQ%40mail.gmail.com.
Thanks for the feedback.On Thu, May 31, 2018 at 6:07 AM 'Philip Jägenstedt' via blink-dev <blin...@chromium.org> wrote:Florin, I think would Blink be the first to ship support for this new syntax, can you confirm?Correct.On the interop risk, that is the risk that other vendors will not ship the same change, or that it takes many years and we have a non-interoperable state in the interim. (Which we don't like because web developers are routinely bitten by interop issues.)With a small change like this, the interop risk is actually significant, since it's so easy to fall off the radar of someone.Interesting point -- I had assumed this would be non-controversial exactly because it is a minor extension to existing syntax, and it would get picked up whenever vendors catch up with Images 4 -- but I see your angle.What we can do to minimize the risk:
- Share all of our tests as web-platform-tests. (parsing PR merged)
- File bugs for all engines pointing to those tests and mention which browsers already pass. Perhaps with link to https://wpt.fyi/results/css/css-images/gradient/color-stops-parsing.html (append ?label=experimental to see more)
Florin, do you believe any tests beyond parsing tests are needed here? Since it's a kind of shorthand, it should be possible to write a reftest that makes sures that the interpretation is correct as well, right?Agreed: I am planning to write more WPT tests, and certain aspects can definitely be verified with reftests.
I also opened bugs for WebKit & Edge, per your and PhistucK's suggestion:
Since https://wpt.fyi/results/css/css-images/gradient/color-stops-parsing.html?label=experimental isn't passing I took a look in cs.chromium.org and was surprised to not see an -expected.txt file. And that the test passes when run. Why is that?The test is definitely expected to pass with --enable-experimental-web-platform-features. I'm not familiar with wpt.fyi, my first guess is they are not running the Chrome tests with experimental features enabled. Is there some way to verify?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYdcwO%3DP%3DyAyjSEUqdQwQd6-dMqQt0k4uwc%3Dv2CsZObxLw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/op.zj8jmdkarbppqq%40cicero2.linkoping.osa.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEg2LsxKpfpi%3DRgygN07HFAmebdTD2%2B-9HheprQ%3DjcKPhg%40mail.gmail.com.
Yes, looks like it was decided to expand at parse time and always serialize the expanded form (which matches the current Chromium impl)
On Thu, Jun 7, 2018 at 10:37 AM Florin Malita <fma...@chromium.org> wrote:Yes, looks like it was decided to expand at parse time and always serialize the expanded form (which matches the current Chromium impl)Correction: this doesn't match the current Blink behavior (I misread the examples in GH issue). Going to update the implementation to match the CSSWG resolution before shipping.