logoalt Hacker News

matt_kantorlast Friday at 12:42 AM1 replyview on HN

I see. I was under the impression that you were saying the "mistake" from the post was wrong in its premise. But I guess that's incorrect, rather you think that people shouldn't use the CSSOM for use cases when comments matter, and instead they ought to design their own parsers/representations.

Just curious: do you feel the same about HTML? Should HTML allow comments in more places? I can imagine alternate ways to represent an HTML document that could capture comments within attribute lists, etc (and the DOM could exclude them entirely).


Replies

IshKebablast Friday at 7:58 AM

Nah I think HTML comments are fine. I don't think there would be a benefit to allowing comments in more places and it would make it more annoying when you actually do want to process comments.

If CSS had mandated that comments could only appear in certain places (e.g. before a rule or attribute) I think that would have been fine too, though maybe slightly confusing given the resemblance to C-style comments which are allowed almost anywhere.

show 1 reply