add in comment ignoring for CSS #12

Pomax opened this Issue Apr 17, 2012 · 4 comments


None yet
2 participants

Pomax commented Apr 17, 2012

block comments are not ignored at the moment, and they should very much be.

If you could also add the comment's text extents to the parseInfo blob, that would be swell. In the future, this would allow us to easily e.g. point out a comment in a tutorial.


Pomax commented Apr 18, 2012

hmm, I'm making the CSS parser return a single object for the parserInfo of the <style> element, since nothing inside of it counts as more than plain text content as far as the DOM is concerned. Would we rewrite the comments as dom comment nodes?

Well, in 81684b7 I extended the parseInfo blob it returns to actually include a bunch of information about the CSS contained within... I was originally thinking of actually putting this on top of the CSSStyleSheet DOM in the sheet property of the <style> node but decided against it, partly because that sheet property is only non-null when the <style> element is added to a real document.

Anyways, since parseInfo.rules is an array of rules in the sheet, maybe parseInfo.comments can be an array of comments in it?


Pomax commented Apr 23, 2012

done and done, pull request #17 pending.

Pomax closed this Apr 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment