[dev] CSS Parsing class
Jan Schneider
jan at horde.org
Tue Mar 19 11:12:46 UTC 2013
Zitat von Michael M Slusarz <slusarz at horde.org>:
> There's been talk on the mailing lists recently about the
> limitations of the current Horde_Text_Filter_Csstidy package
> (essentially a wrapper around the unmaintained PHP csstidy code).
>
> By fortuitous chance, the same issue came up with one of my clients.
> Thus, plenty of impetus to look into replacing the library with a
> new library.
>
> Turns out there is a stable, CSS3 compliant, stateful, object
> oriented PHP parser that exists and is favorably licensed (MIT/Expat
> license):
> https://github.com/sabberworm/PHP-CSS-Parser
>
> It turned out to be fairly easy to write a new Horde wrapper around
> this class (Horde_Css_Parser;
> https://github.com/horde/horde/commit/8fe7c6a52443ceab1a3c2a7e4b364f6ba005e059). And the results seem to work beautifully. Haven't played around much more than parsing the existing CSS code, but this code handles the issues requiring us to parse CSS in the first place: relative URL translation and @import
> replacement.
>
> As such, there is no reason to delay making the change, especially
> considering the alternative (csstidy) is known to be broken in
> multiple respects. This code has been around for several years and
> stability looks good at a minimum, there are a good bit of
> forks/stars of the code on github so it tells me this code is being
> used on a daily basis by others.
>
> michael
>
> ___________________________________
> Michael Slusarz [slusarz at horde.org]
I don't feel comfortable with replacing the CSS parser in a bug fix
release of Horde_Core.
Can we instead keep a conditional in the client code until the 5.1
release which checks whether Horde_Css_Parser exists and falls back to
Csstidy if not? We can make Css_Parser an optional dependency then and
release beta versions first for people to test this more thoroughly.
With 5.1 we completely switch to the new parser.
--
Jan Schneider
The Horde Project
http://www.horde.org/
More information about the dev
mailing list