[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua CSS parser?
- From: Tom N Harris <telliamed@...>
- Date: Tue, 27 May 2014 14:33:41 -0400
On Tuesday, May 27, 2014 12:20:49 PM Sean Conner wrote:
> is legal (and before you say no sane person would actually write the above,
> there's some saying I can't quite find that states that if it's possible, it
> will exist in some codebase somewhere).
Worse than that, CSS requires that a parser must accept *illegal* syntax
without failing. It must pass over the nonsense, while balancing braces,
parenthesis, and quotes, then ignore what it doesn't understand.
@media screen {
p { font-family: monospace }
@foo @bar;
p { color: red; color{;color:maroon}; color: green }
) ( {} ) p {color: red }
p {
font-family: 'Times New Roman
font-style: italic;
A conforming CSS processor must be accept this and reduce it to
@media screen {
p { font-family:monospace; color:green; font-style:italic; }
}
Now, if you don't mind being non-conforming, I don't think anyone will be too
upset if you refuse to accept that unholy mess.
--
tom <telliamed@whoopdedo.org>