diff options
author | Benjamin Otte <otte@redhat.com> | 2016-04-18 20:25:11 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-04-18 20:52:35 +0200 |
commit | 519af3f91d65a9ec8a6f49b0d078ac12271042a1 (patch) | |
tree | 1f988e8e791a5ad1a8e608e8e43cdb981e25b530 /gtk/gtkcssimageradial.c | |
parent | fd373162b547b777d9c31cdc2fc84b2e337e0d52 (diff) | |
download | gtk+-519af3f91d65a9ec8a6f49b0d078ac12271042a1.tar.gz |
cssimage: Warn if gradients only have 1 color stop
GTK <= 3.20 allowed that but the CSS spec and borwsers do not.
We might want to just remove that feature, but for now, we just warn.
Diffstat (limited to 'gtk/gtkcssimageradial.c')
-rw-r--r-- | gtk/gtkcssimageradial.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkcssimageradial.c b/gtk/gtkcssimageradial.c index bc137db7da..81967c9a80 100644 --- a/gtk/gtkcssimageradial.c +++ b/gtk/gtkcssimageradial.c @@ -377,6 +377,14 @@ gtk_css_image_radial_parse (GtkCssImage *image, } while (_gtk_css_parser_try (parser, ",", TRUE)); + if (radial->stops->len < 2) + { + _gtk_css_parser_error_full (parser, + GTK_CSS_PROVIDER_ERROR_DEPRECATED, + "Using one color stop with %s() is deprecated.", + radial->repeating ? "repeating-radial-gradient" : "radial-gradient"); + } + if (!_gtk_css_parser_try (parser, ")", TRUE)) { _gtk_css_parser_error (parser, "Missing closing bracket at end of radial gradient"); |