-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues parsing invalid declarations inside phantomjs #83
Comments
This seems to have been fixed in the latest version of |
@conradz Did you actually test that it works inside |
So @conradz I tested this myself now in with this test css: outside phantomjs -- correct
inside phantomjs -- incorrectwhereas inside
Like I said from the beginning, I'm not sure if there's anything you can do about this form your libraries point of view. Just wanted to clarify that is doesn't get fixed by latest version. Cheers |
I just don't have enough understanding of what |
OK, thanks for the clarification, I hadn't understood that it was specific to phantomjs. Yeah I would think that the best way would be to parse in Node, transferring the CSS source to Node instead of parsing in phantomjs. Most likely an issue with regex matching in phantomjs, although I couldn't guarantee that is the problem. |
Hi there, thanks for a great tool, using it for penthouse since a few versions back.
Not sure where this fits, whether this is something that can/should be fixed or not, as issue only happens inside
phantomjs. Any input on how to resolve it, even if fix is outside of this repo much appreciated. Basically I came across this invalid css which does *not* generate any
parsingError, but does throw off the parser so as to make it fail to detect any following rules (after the
.breakingDeclaration), which causes
penthouse` to lose part of critical css in this scenario.Setup
I'm on version
2.0.0
ofcss
(couldn't get more recent version to work in phantom, worth it's own issue..).Call
css.parse()
on the following css* inside a phantomjs script (I've tried both1.9.8
and2.0.0
- same result):To clarify, this call is made inside the top level body of a
phantomjs
script, not inside any page.evaluate js injected to headless browser. The actual line is here.Expected
rules
in stylesheet (.breakingDeclaration and html)-or-
parsingError
for the.breakingDeclaration
declarationActual
only the
.breakingDeclaration
rule (and any preceeding ones) is kept.html
(and any following) rules are lost.I guess it's the double nested set of
()
inside the declaration that throws of a regex somewhere? Note too that I spotted that even though the rules are lost in the AST rules array, callingstringify
with the same array somehow adds the missing rules back again. Doesn't help me though.*The actual declaration was
filter:unquote("progid:DXImageTransform.Microsoft.gradient(enabled = false)")
- some left behind directive, dunno what language.The text was updated successfully, but these errors were encountered: