I am dithering between three possible ways of implementing all this, and I have bits of written code for all of them.
Option A is to do the whole job of tokenising and parsing and rendering ourselves.
- We get full control and can do what we like.
- There isn’t much of the full CSS spec we need to honour just to do window borders.
- But we also run the risk of obscure bugs specific to our code…
- …and we’ll have the inevitable need to prove why we didn’t rely on existing libraries.
- I have a working tokeniser written and some of the parser; I just need to decide whether to use them.
Option B is to do the rendering and perhaps some of the parsing ourselves, and leave the rest of the parsing and all the tokenising to libcroco.
- But libcroco doesn’t do CSS3.
- But there are workarounds for that; still, none of them are perfect and they’ll show up very obviously in the language.
- Of course we could start by modifying libcroco to do CSS3, but that might make this project last forever.
Option C is to use libccss to do almost everything, which depends on libcroco for parsing.
- This is what the first draft of Cowbell did.
- This has all the negative points of Option B, and some of its own.
- However, there were some infelicities, including rather inflexible image handling…
- …and no way to expand the range of colours that were allowed.
- We also had to do some things, like rendering the title text, ourselves anyway.
- Again, we could just fix libccss; again, this will delay this project’s going anywhere in a hurry.