{"action":"created","issue":{"url":"https://api.github.com/repos/madrobby/zepto/issues/1240","repository_url":"https://api.github.com/repos/madrobby/zepto","labels_url":"https://api.github.com/repos/madrobby/zepto/issues/1240/labels{/name}","comments_url":"https://api.github.com/repos/madrobby/zepto/issues/1240/comments","events_url":"https://api.github.com/repos/madrobby/zepto/issues/1240/events","html_url":"https://github.com/madrobby/zepto/pull/1240","id":189892374,"number":1240,"title":"Fix ready() on IE (again)","user":{"login":"Totktonada","id":92749,"avatar_url":"https://avatars.githubusercontent.com/u/92749?v=3","gravatar_id":"","url":"https://api.github.com/users/Totktonada","html_url":"https://github.com/Totktonada","followers_url":"https://api.github.com/users/Totktonada/followers","following_url":"https://api.github.com/users/Totktonada/following{/other_user}","gists_url":"https://api.github.com/users/Totktonada/gists{/gist_id}","starred_url":"https://api.github.com/users/Totktonada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Totktonada/subscriptions","organizations_url":"https://api.github.com/users/Totktonada/orgs","repos_url":"https://api.github.com/users/Totktonada/repos","events_url":"https://api.github.com/users/Totktonada/events{/privacy}","received_events_url":"https://api.github.com/users/Totktonada/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2016-11-17T00:12:23Z","updated_at":"2016-11-23T00:17:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/madrobby/zepto/pulls/1240","html_url":"https://github.com/madrobby/zepto/pull/1240","diff_url":"https://github.com/madrobby/zepto/pull/1240.diff","patch_url":"https://github.com/madrobby/zepto/pull/1240.patch"},"body":"We shouldn't use \"DOMContentLoaded\" event on IE10 as well as\r\n\"interactive\" state. This commit is continuation of effort in PR #1235\r\nand hopefully now it really fixed for any configuration.\r\n\r\nWith my server configuration (async script loading) ready() works on\r\nIE9, but doesn't work on IE10 from time to time. I found that ready()\r\ndoesn't call the callback when invoked in \"interactive\" state. That\r\nmeans the moment when \"DOMContentLoaded\" very likely was already fired.\r\nIn this case the callback won't invoked at all.\r\n\r\nCurrent implementation can be explained in very simple words. We invoke\r\nthe callback when:\r\n\r\n* (old IE) in \"complete\" state or when \"load\" event occurs;\r\n* (others) in \"interactive\" state or when \"DOMContentLoaded\" event\r\n  occurs.\r\n\r\nThe change tested with Microsoft's VM images from [1] on IE9 and IE10.\r\nSeems to be good.\r\n\r\n[1]: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/\r\n\r\nBuild size\r\n----------\r\n\r\nCalculated for a build with the default modules set:\r\n\r\n```\r\nzepto.js      58755 -> 58921 (+166 bytes)\r\nzepto.min.js  26453 -> 26486 ( +33 bytes)\r\nzepto.min.gz   9806 ->  9824 ( +18 bytes)\r\n```\r\n\r\nNote: Size of zgipped version is little flaky as depends on the first\r\nline (comment) with a commit id, so don't worry if it differs on +/- 5\r\nbytes from my numbers."},"comment":{"url":"https://api.github.com/repos/madrobby/zepto/issues/comments/262405082","html_url":"https://github.com/madrobby/zepto/pull/1240#issuecomment-262405082","issue_url":"https://api.github.com/repos/madrobby/zepto/issues/1240","id":262405082,"user":{"login":"Totktonada","id":92749,"avatar_url":"https://avatars.githubusercontent.com/u/92749?v=3","gravatar_id":"","url":"https://api.github.com/users/Totktonada","html_url":"https://github.com/Totktonada","followers_url":"https://api.github.com/users/Totktonada/followers","following_url":"https://api.github.com/users/Totktonada/following{/other_user}","gists_url":"https://api.github.com/users/Totktonada/gists{/gist_id}","starred_url":"https://api.github.com/users/Totktonada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Totktonada/subscriptions","organizations_url":"https://api.github.com/users/Totktonada/orgs","repos_url":"https://api.github.com/users/Totktonada/repos","events_url":"https://api.github.com/users/Totktonada/events{/privacy}","received_events_url":"https://api.github.com/users/Totktonada/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T00:17:50Z","updated_at":"2016-11-23T00:17:50Z","body":"@mislav Great, it should work! I really missed that simple solution. I tested it on modern Firefox, Chrome on Android, IE9 and IE10 and it works for me. Also I checked for double callback firing on Firefox and it, again, works as expected."}}
{"actor":{"display_login":"Totktonada"}}