GNOME Bugzilla – Bug 597054
Problem with libcroco-0.6.1
Last modified: 2009-10-05 21:08:40 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
*** Bug 597349 has been marked as a duplicate of this bug. ***
*** Bug 597347 has been marked as a duplicate of this bug. ***
*** Bug 597357 has been marked as a duplicate of this bug. ***
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 on attachment 144793 [details] [review] Work around libcroco < 0.6.2 parsing bug for 'rgba' Looks good to me.
I can onfirm patch working for ubuntu 9.04 with libcroco 0.6.1.2. Good looking calendar there.
Attachment 144793 [details] pushed as 4ddc111 - Work around libcroco < 0.6.2 parsing bug for 'rgba'