Skip to content
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

Doesn't work with Modernizr #8

Open
SrMouraSilva opened this issue Apr 1, 2014 · 7 comments
Open

Doesn't work with Modernizr #8

SrMouraSilva opened this issue Apr 1, 2014 · 7 comments

Comments

@SrMouraSilva
Copy link

When I use:

<script src="stc/js/default/modernizr.custom.98457.js"></script>
<script type="text/javascript">
    Modernizr.load([{
        test : Modernizr.cssvhunit,
        nope : 'stc/js/default/vimpoly.min.js',
    }]);
</script>

Modernizr code

Only works when opera 12 and never on the browser of Android 4.1

@saabi
Copy link
Owner

saabi commented Aug 13, 2014

I'm maintaining the project again. Did you solve this problem?

It seems like it would be an issue with Modernizr.

@SrMouraSilva
Copy link
Author

I could not: /

@seavor
Copy link

seavor commented Oct 12, 2014

I'm having similar issues with using Modernizr, tho I'm worried I may not be implementing vminpoly correctly. Here's my modernizr script:

Modernizr.load([
{
test : Modernizr.cssvwunit && Modernizr.cssvhunit,
nope : ['polyfills/parser.js', 'polyfills/tokenizer.js', 'polyfills/vminpoly.js']
}
]);

And this is the error I get back:

INFO: processing http://localhost:8888/css/style.css vminpoly.js:45
Parse error at token 1958: {.
Attempt to open a curly-block in a statement-type at-rule. parser.js:56
Parse error at token 2038: {.
Attempt to open a curly-block in a statement-type at-rule. parser.js:56
Parse error at token 2118: {.
Attempt to open a curly-block in a statement-type at-rule. parser.js:56
Parse error at token 2680: DELIM(*). parser.js:56
Uncaught TypeError: Cannot read property 'append' of undefined parser.js:62

Note: This issue seems to persist even without Modernizr. I tried directly loading the vminploy scripts in the HEAD section, and still received an identical array of errors.

@saabi
Copy link
Owner

saabi commented Oct 15, 2014

@seavor this looks like an issue with tabatkin's parser. He's been improving his own repository lately so it might be fixed there, but his changes still haven't been integrated into vminpoly.

@saabi
Copy link
Owner

saabi commented Oct 17, 2014

As a quick, hacky fix, you might try removing whitespace from the CSS file.

Doing this has avoided some parsing errors before.

I know it's not the proper solution. But these days I can't pay attention to the code. Hopefully this will change soon.

@FabioAntunes
Copy link

I'm getting the same error even though my css is minified, any news on this?

@aysegeertsma
Copy link

I had a problem in ImpressPages. It was hard to find because IP uses less css and source and outcome differ. Turned out the problem was caused by

@-webkit-keyframes

Adding it to the registry fixed the problem.

AtRule.registry = {
    'import': '',
    'media': 'rule',
    'font-face': 'declaration',
    'page': 'declaration',
    'keyframes': 'rule',
    '-webkit-keyframes': 'rule', // note: this line was added
    'namespace': '',
    'counter-style': 'declaration',
    'supports': 'rule',
    'document': 'rule',
    'font-feature-values': 'declaration',
    'viewport': '',
    'region-style': 'rule'
};

To find your problem you can either step through the AtRule() fuction or add a console.log like so:

function AtRule(name) {
    this.name = name;
    this.prelude = [];
    this.value = [];
    console.log(name); // todo: remove this line
    if(name in AtRule.registry)
        this.fillType = AtRule.registry[name];
    return this;
}

The name that outputs right before your error is the misunderstood css tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants