Re: CSS parser bug
"Sebastian Geerken" <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
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
_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
signature.asc
(application/pgp-signature, 473 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXfCISAAoJEAw7+YHB+ZL6gBkH/1c2CoSZn+kYUMInbrX5Q5ys 7iWWc03+Sw5fKG2XZNERWRgMZy8P/uOFuT3lqPTiW0PV1GnJphFwIphb/AdKiwc6 bXjipDhmawBWM9Gs9nauou389494scOFTZk9BLjjBxGblaC4aLE/NaR47QIWkOZi 2KOOj4YPoOcN6D4Zb42mJHD4Ve1RVepZC306uKAsAhMhoGlWDC9EQs7nkl/2mTdC lIl523N1cjhgY9xr+Z0tq3oZl9tuvzQLo2UljQTQckPjYYVSyGU4sIGVoJCQPig+ U08GFFpJVb8j2odfIimYrLxBw8bUq0X4bdCdfO0jJWKVUHIEwqVhJXPjBY9Sp5g= =rtOi -----END PGP SIGNATURE-----