Implement color stop position syntax from CSS Image Values 4
Reported by
leave...@gmail.com,
Mar 30 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce the problem: Testcase: http://dabblet.com/gist/d52773b90f2bf6d6304c95c86a858c23 What is the expected behavior? The background should be green What went wrong? The background is red Did this work before? N/A Does this work in other browsers? N/A Chrome version: 56.0.2924.87 Channel: n/a OS Version: OS X 10.12.3 Flash Version: Shockwave Flash 25.0 r0 Spec: https://drafts.csswg.org/css-images-4/#color-stop-syntax According to the new grammar, color stops can have two positions which is equivalent to two consecutive color stops with the same color and different positions. For example linear-gradient(45deg, #f06 25%, yellow 25%, yellow 50%, #f06 50%, #f06 75%, yellow 75%) can be written as linear-gradient(45deg, #f06 25%, yellow 25% 50%, #f06 50% 75%, yellow 75%) with this syntax. It's useful for all gradient types as it makes it easier and more readable to specify "bands" of color and should be relatively straightforward to implement since it's rather simple syntactic sugar.
,
Apr 1 2017
Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1352643
,
Apr 3 2017
,
Apr 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/546c77f5d4ce77af661664954f0a59d7a4b45edf commit 546c77f5d4ce77af661664954f0a59d7a4b45edf Author: fmalita <fmalita@chromium.org> Date: Fri Apr 07 12:02:26 2017 Implement color stop position syntax from CSS Image Values 4 CSS Image Values 4 allows specifying up to two positions per color stop, e.g.: linear-gradient(45deg, black 0% 50%, white 50% 100%) This is equivalent to repeating the color at the given positions: linear-gradient(45deg, black 0%, black 50%, white 50%, white 100%) (https://drafts.csswg.org/css-images-4/#color-stop-syntax) Add support for the new syntax, behind a runtime flag. BUG= 707047 Review-Url: https://codereview.chromium.org/2799793002 Cr-Commit-Position: refs/heads/master@{#462841} [modify] https://crrev.com/546c77f5d4ce77af661664954f0a59d7a4b45edf/third_party/WebKit/LayoutTests/fast/gradients/conic-gradient-parsing.html [modify] https://crrev.com/546c77f5d4ce77af661664954f0a59d7a4b45edf/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-gradient-parsing-expected.txt [modify] https://crrev.com/546c77f5d4ce77af661664954f0a59d7a4b45edf/third_party/WebKit/LayoutTests/fast/gradients/unprefixed-gradient-parsing.html [modify] https://crrev.com/546c77f5d4ce77af661664954f0a59d7a4b45edf/third_party/WebKit/Source/core/css/CSSGradientValue.cpp [modify] https://crrev.com/546c77f5d4ce77af661664954f0a59d7a4b45edf/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp [modify] https://crrev.com/546c77f5d4ce77af661664954f0a59d7a4b45edf/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
,
Apr 10 2017
This seems weird. Why only two percentage values per color stop?...
,
Apr 10 2017
@phistuck because the color is the same. Sequential same-color stops are used to define color bands (no actual gradient), so only the extremes count. Anything more than two offsets implies the intermediate values are redundant: (green 10% 20% 30% 40%) -> (green 10%, green 20%, green 30%, green 40%) which is the same as (green 10%, green 40%).
,
Dec 6 2017
,
Mar 6 2018
,
Sep 17
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/eb572e75298d39013f472d2d4b4641dd391d4cf1 commit eb572e75298d39013f472d2d4b4641dd391d4cf1 Author: Fredrik Söderquist <fs@opera.com> Date: Mon Sep 17 17:12:07 2018 Add basic tests for multiple position gradient stops Tests rendering for the the case where <color-stop-length> or (or <color-stop-angle>) is two <length-percentage> (or <angle-percentage>.) Spec: https://drafts.csswg.org/css-images-4/#color-stop-syntax Bug: 707047 , 880733 Change-Id: I56bc9b43858b37c003e081ea0ef8588f3da78627 Reviewed-on: https://chromium-review.googlesource.com/1228120 Commit-Queue: Fredrik Söderquist <fs@opera.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Cr-Commit-Position: refs/heads/master@{#591717} [add] https://crrev.com/eb572e75298d39013f472d2d4b4641dd391d4cf1/third_party/WebKit/LayoutTests/external/wpt/css/css-images/multiple-position-color-stop-conic.html [add] https://crrev.com/eb572e75298d39013f472d2d4b4641dd391d4cf1/third_party/WebKit/LayoutTests/external/wpt/css/css-images/multiple-position-color-stop-linear.html [add] https://crrev.com/eb572e75298d39013f472d2d4b4641dd391d4cf1/third_party/WebKit/LayoutTests/external/wpt/css/css-images/multiple-position-color-stop-radial.html [add] https://crrev.com/eb572e75298d39013f472d2d4b4641dd391d4cf1/third_party/WebKit/LayoutTests/external/wpt/css/css-images/support/100x100-blue-green.html
,
Sep 18
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/50689e69f63fb991c09387f486d4105abfa91988 commit 50689e69f63fb991c09387f486d4105abfa91988 Author: Fredrik Söderquist <fs@opera.com> Date: Tue Sep 18 13:58:52 2018 Ship CSS gradient color stop double-position syntax Intent-to-Ship thread: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/8B9FbeTBIK0/DNkC2pz-AAAJ Also removing the actual feature and corresponding check, because it's only used in a single spot, so if the feature should need to be unshipped it ought to be a fairly trivial revert. Bug: 707047 , 880733 Change-Id: Ie854d7fd9f7a22e9c6144668a37f694dd1c508ee Reviewed-on: https://chromium-review.googlesource.com/1230018 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#592028} [modify] https://crrev.com/50689e69f63fb991c09387f486d4105abfa91988/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc [modify] https://crrev.com/50689e69f63fb991c09387f486d4105abfa91988/third_party/blink/renderer/platform/runtime_enabled_features.json5
,
Sep 19
Able to reproduce the issue on Mac, windows and Ubuntu using chrome build without fix. Verified the fix on Mac 10.13.6, Windows 10 and Ubuntu as per comment#0 on latest chrome version #71.0.3556.0. Attaching screen cast for reference. Observed that "As we are able to edit the text " Hence, the fix is working as expected. Adding the verified labels. Thanks...! |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by fmalita@chromium.org
, Mar 31 2017Owner: fmalita@chromium.org
Status: Assigned (was: Unconfirmed)