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

utils/has-css3.js throwing errors in Safari on iOS7 #775

Closed
amuraco opened this issue Nov 19, 2013 · 3 comments
Closed

utils/has-css3.js throwing errors in Safari on iOS7 #775

amuraco opened this issue Nov 19, 2013 · 3 comments

Comments

@amuraco
Copy link
Contributor

amuraco commented Nov 19, 2013

if dgrid/List -> dgrid/TouchScroll -> dgrid/utils/has-css3 is loaded before safari had generated a body node (it's hit or miss), then has-css3 test will throw an exception killing page load:

TypeError: 'null' is not an object (evaluating 'document.body.appendChild')

This is coming from line 61 of has-css3.js

In my app, I have dojo.js script tag and require(['myApp/MyGrid']); both located in the head of the document with sync mode on, so I'm GUESSING that safari is doing some sort of incremental parsing of the incoming html, and if the JS is executed before the <body> tag is seen/rendered, the error is thrown.

amuraco pushed a commit to amuraco/dgrid that referenced this issue Nov 20, 2013
@amuraco
Copy link
Contributor Author

amuraco commented Nov 21, 2013

So Turns out, the test case will work if the feature test element is appended to the html element, which always exists.

@kfranqueiro
Copy link
Member

Off the cuff, I could fathom 2 ways to fix this:

  1. Add dojo/domReady! to TouchScroll's dependencies (easy, not ideal since it may make modules wait longer to load)
  2. Restructure code in TouchScroll so that it only calls has the first time it actually needs to be used in a dgrid instance (which would have to be after the DOM is ready anyway)

@amuraco
Copy link
Contributor Author

amuraco commented Nov 21, 2013

I considered both of those changes, and I was able to shuffle around that particular has call with everything that relies on it to be inside a ready block, but I think it would be simplier to just append the test domNode to the <html> node. it appears that the test case works flawlessly, and (together with pull request #776) the transform3d detection actually works correctly, with no errors for us.

I can submit a PR for either approach, let me know.

@ghost ghost closed this as completed in 660eb0f Mar 24, 2014
This issue was closed.
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