diff options
author | Benjamin Otte <otte@redhat.com> | 2012-12-01 16:22:04 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-12-01 16:27:45 +0100 |
commit | 5942099f0003c5ceecfe219fa1aeffe647b170e8 (patch) | |
tree | b282fd81289bcb55d8356913134d35b0d8c9fcba /gtk/gtkcssstylepropertyimpl.c | |
parent | 891a4ab347a5e9994b2ca41edd0669ad7f81735f (diff) | |
download | gtk+-5942099f0003c5ceecfe219fa1aeffe647b170e8.tar.gz |
cssvalue: Parse font sizes properly
As the last CSS property, font-size now is a proper number (when it's
not a keyword).
Diffstat (limited to 'gtk/gtkcssstylepropertyimpl.c')
-rw-r--r-- | gtk/gtkcssstylepropertyimpl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index bd22a7c1d7..3d8eb213c6 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -649,19 +649,16 @@ font_size_parse (GtkCssStyleProperty *property, GtkCssParser *parser) { GtkCssValue *value; - gdouble d; value = _gtk_css_font_size_value_try_parse (parser); if (value) return value; - if (!_gtk_css_parser_try_double (parser, &d)) - { - _gtk_css_parser_error (parser, "Expected a number"); - return NULL; - } - - return _gtk_css_number_value_new (d, GTK_CSS_PX); + return _gtk_css_number_value_parse (parser, + GTK_CSS_PARSE_LENGTH + | GTK_CSS_PARSE_PERCENT + | GTK_CSS_POSITIVE_ONLY + | GTK_CSS_NUMBER_AS_PIXELS); } static GtkCssValue * |