After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 597054 - Problem with libcroco-0.6.1
Problem with libcroco-0.6.1
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 597347 597349 597357 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-10-01 22:57 UTC by Owen Taylor
Modified: 2009-10-05 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Work around libcroco < 0.6.2 parsing bug for 'rgba' (6.02 KB, patch)
2009-10-05 14:13 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2009-10-01 22:57:39 UTC
Ubuntu 9.04 (and other distros) still are shipping libcroco-0.6.1. (0.6.2 was released in February and is in Fedora 11.)

With libcroco-0.6.1 the calendar and LookingGlass are reported to have completely transparent backgrounds. I think this is because of:

  https://bugzilla.gnome.org/show_bug.cgi?id=394680

Which was fixed in January 2007 but not in a release until 0.6.2. A bit hard to deal with because the misparsing gets done at the tokenization step before we get involved.

One idea about this is to introduce parsing for the (non-CSS-standard) notation:

 #rrggbbaa #rgba

and use that instead of rgba(r,g,b,percentage)

until we don't have to worry about libcroco any more. I think this is possible, though not completely sure - if it's possible the way it would work is that before st-theme-node.c:get_color_from_term() calls cr_rgb_set_from_term(), it needs to do something like:

  else if (term->type == TERM_HASH)
    {
      return get_color_from_hex (term, color);
    }

but it's possible that at the parse step libcroco has already converted TERM_HASH to TERM_RGB. 

The other idea I have is to use cr_om_parser_simply_parse_buf() instead of cr_om_parser_simply_parse_file() and do a search-and-replace on our CSS files when loading them and replace rgba with _rgba and handle that in addition to rgba(). This probably would be conditionalized on 

#if LIBCROCO_VERSION_NUMBER < 602
Comment 1 Owen Taylor 2009-10-04 20:18:40 UTC
*** Bug 597349 has been marked as a duplicate of this bug. ***
Comment 2 Owen Taylor 2009-10-04 20:23:43 UTC
*** Bug 597347 has been marked as a duplicate of this bug. ***
Comment 3 Owen Taylor 2009-10-04 21:26:52 UTC
*** Bug 597357 has been marked as a duplicate of this bug. ***
Comment 4 Owen Taylor 2009-10-05 14:13:43 UTC
Created attachment 144793 [details] [review]
Work around libcroco < 0.6.2 parsing bug for 'rgba'

To work around a problem where libcroco < 0.6.2 can't handle
functions starting with 'r' or 'u', preconvert 'rgba' to 'RGBA'
when parsing stylesheets and then check for rgba()
case-insensitively.

(libcroco is uniformly case-sensitive, though the CSS spec requires
that ASCII should be handled case-insensitively.)
Comment 5 Colin Walters 2009-10-05 16:02:02 UTC
Comment on attachment 144793 [details] [review]
Work around libcroco < 0.6.2 parsing bug for 'rgba'

Looks good to me.
Comment 6 Fernando Mora 2009-10-05 20:45:28 UTC
I can onfirm patch working for ubuntu 9.04 with libcroco 0.6.1.2. Good looking calendar there.
Comment 7 Owen Taylor 2009-10-05 21:08:37 UTC
Attachment 144793 [details] pushed as 4ddc111 - Work around libcroco < 0.6.2 parsing bug for 'rgba'