[dev] CSS Parsing class

Michael J Rubinsky mrubinsk at horde.org
Tue Mar 19 13:24:45 UTC 2013


Quoting Jan Schneider <jan at horde.org>:

> 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.

+1
-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6062 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.horde.org/archives/dev/attachments/20130319/7806c3fe/attachment.bin>


More information about the dev mailing list