On Di, Jul 05, 2016, Johannes Hofmann wrote:
> On Mon, Jul 04, 2016 at 08:21:56PM +0200, Sebastian Geerken wrote:
> > The CSS parser seems to have a bug handling shorthand properties. This
> > example works well, both properties are handled correctly:
> >
> > <body style="background: url(
http://www.gnu.org/graphics/heckert_gnu.small.png) repeat-y">
> >
> > Adding "transparent" (for "background-color"), however, causes the
> > other parts not to be parsed:
> >
> > <body style="background: transparent url(
http://www.gnu.org/graphics/heckert_gnu.small.png) repeat-y">
> >
> > Not a regression, dillo 3.0.5 shows the same behaviour.
>
> transparent seems to be the problem.
>
> <body style="background: red url(
http://www.gnu.org/graphics/heckert_gnu.small.png) repeat-y">
>
> works here. Not sure yet what it would take to support transparent properly.
Suggested by your hint, I successfully tried this hack of
CssParser::tokenMatchesProperty:
diff -r c449be1f747f src/cssparser.cc
--- a/src/cssparser.cc Mon Jul 04 14:04:49 2016 +0000
+++ b/src/cssparser.cc Tue Jul 05 23:06:31 2016 +0200
@@ -762,6 +762,7 @@
if ((ttype == CSS_TK_COLOR ||
ttype == CSS_TK_SYMBOL) &&
(dStrAsciiCasecmp(tval, "rgb") == 0 ||
+ dStrAsciiCasecmp(tval, "transparent") == 0 ||
a_Color_parse(tval, -1, &err) != -1))
return true;
break;
Of course, I get a warning "color is not in "#RRGGBB" format", but at
least "transparent" is /recognized/ as color at this point.
Sebastian