02Mar 2010
JSCSSP
14:14 - By BlueGriffon - Thinking at loud - 4 comments
Nvu had a strong limitation, because of Gecko. It could only edit CSS styles understandable by the embedded version of Gecko. This is something I don't want for BlueGriffon because I think it does not make sense to make a content editor for the Web that is restricted to Gecko-based browsers. I want users to be able to manipulate a UI that will create -moz-transform but also -webkit-transform. And I also want users to be able to edit stylesheets that include both properties while the -webkit-* are never present in Gecko's CSS OM (and that's normal). I don't need to cascade, I want to preserve all rules and all declarations even multiple declarations of the same property, I want to preserve comments as much as possible (ie between rules and between declarations), I want to preserve CSS parsing errors. The only extra thing I need is a resolver for shorthands.
So I just started my own CSS parser. It'll parse a string containing a stylesheet and will return CSSOM-like objects with the necessary extensions. It'll live inside the CSS Inspector sidebar of BlueGriffon but I will probably make it MPL.





4 comments
What language are you writing the parser in?
Sorry, stupid question. JSCSSP = Javascript CSS Parser
Dean Edward's IE7 project has a CSS parser. You might be interested in collaborating with him.
http://ie7-js.googlecode.com
@Sean Hogan: yes I know Dean's code ; his parser does not do enough for my needs, unfortunately.
wat is dean's code?