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

Firefox throws an error with the built version #42

Open
aprilmay opened this issue Dec 28, 2014 · 4 comments
Open

Firefox throws an error with the built version #42

aprilmay opened this issue Dec 28, 2014 · 4 comments

Comments

@aprilmay
Copy link

With recent (33+) FF and a custom build only, an error happens (not always, but most of the time): InvalidAccessError: A parameter or an operation is not supported by the underlying object

It is in the checkImports function, in those lines:
var needsParsing = sheet.needsParsing, cssRules = sheet.rules || sheet.cssRules;

Pure AMD app, xstyle bundled within dgrid with 'xstyle/main', 'xstyle/core/load-css', 'xstyle/core/load-imports'.

@kriszyp
Copy link
Owner

kriszyp commented Dec 30, 2014

For your build are using a targetStyleSheet for the layer, or is the CSS being built into the JS layer?

@aprilmay
Copy link
Author

The CSS was loaded through plain HTML (because xstyle was just a dependency for dgrid, i didn't care enough about it).

Importing CSSss with xstyle solves the problem. It also allowed me to integrate the CSSes to deal nicely with the AMD principles. Thanks Kris!

@kriszyp
Copy link
Owner

kriszyp commented Jan 17, 2015

I'd still be curious if there is an issue here that can be reproduced, but glad you solved your problem.

@aprilmay
Copy link
Author

aprilmay commented Feb 6, 2015

Well, i fear i was too optimistic and the issue is still present, sorry.

I narrowed the problem to: FF is complaining when accessing "sheet.cssRules" in the checkImports function.

This is called from the domReady function in core/elemental.js.

So i think the problem is with doc.readyState: when it is "interactive", it means that some stuff still needs parsing (according to https://developer.mozilla.org/en-US/docs/Web/API/document.readyState).

So, a simple fix is to replace the rather obscure condition "/e/.test(doc.readyState||''" to "doc.readyState == 'complete'" (line 116 in the current trunk).

@aprilmay aprilmay reopened this Feb 6, 2015
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

2 participants