{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/jquery/issues/2191","labels_url":"https://api.github.com/repos/jquery/jquery/issues/2191/labels{/name}","comments_url":"https://api.github.com/repos/jquery/jquery/issues/2191/comments","events_url":"https://api.github.com/repos/jquery/jquery/issues/2191/events","html_url":"https://github.com/jquery/jquery/issues/2191","id":66923176,"number":2191,"title":"Element width is 0 when opening page in new tab in chrome on mac","user":{"login":"oste","id":350275,"avatar_url":"https://avatars.githubusercontent.com/u/350275?v=3","gravatar_id":"","url":"https://api.github.com/users/oste","html_url":"https://github.com/oste","followers_url":"https://api.github.com/users/oste/followers","following_url":"https://api.github.com/users/oste/following{/other_user}","gists_url":"https://api.github.com/users/oste/gists{/gist_id}","starred_url":"https://api.github.com/users/oste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oste/subscriptions","organizations_url":"https://api.github.com/users/oste/orgs","repos_url":"https://api.github.com/users/oste/repos","events_url":"https://api.github.com/users/oste/events{/privacy}","received_events_url":"https://api.github.com/users/oste/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jquery/jquery/labels/Needs%20info","name":"Needs info","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-07T16:00:17Z","updated_at":"2015-04-08T20:48:35Z","closed_at":null,"body":"I originally thought that this was just a Chrome bug, but the more I think about it this could be more jQuery related so I wanted to post here as well. I need to do further testing without jQuery as a dependency to be sure.\r\n\r\nUsing the following code will result in inconsistent behavior when opening the page in a **new tab** using target=\"_blank\" for example. The width in the timeout is always correct, but the other output will be 0 **some of the time**.\r\n\r\n```\r\n  <div id=\"test\"></div>\r\n\r\n    <!-- jQuery -->\r\n    <script src=\"js/jquery.js\"></script>\r\n\r\n    <script type=\"text/javascript\">\r\n\r\n    $(document).ready(function() {\r\n        console.log($('#test').width());\r\n        console.log(document.getElementById('test').offsetWidth);\r\n\r\n        setTimeout(function() {\r\n            console.log($('#test').width());\r\n            console.log(document.getElementById('test').offsetWidth);\r\n        }, 200);\r\n    });\r\n\r\n    </script>\r\n```\r\n\r\nChromium issue for reference:\r\nhttps://code.google.com/p/chromium/issues/detail?id=474315"},"comment":{"url":"https://api.github.com/repos/jquery/jquery/issues/comments/91032896","html_url":"https://github.com/jquery/jquery/issues/2191#issuecomment-91032896","issue_url":"https://api.github.com/repos/jquery/jquery/issues/2191","id":91032896,"user":{"login":"oste","id":350275,"avatar_url":"https://avatars.githubusercontent.com/u/350275?v=3","gravatar_id":"","url":"https://api.github.com/users/oste","html_url":"https://github.com/oste","followers_url":"https://api.github.com/users/oste/followers","following_url":"https://api.github.com/users/oste/following{/other_user}","gists_url":"https://api.github.com/users/oste/gists{/gist_id}","starred_url":"https://api.github.com/users/oste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oste/subscriptions","organizations_url":"https://api.github.com/users/oste/orgs","repos_url":"https://api.github.com/users/oste/repos","events_url":"https://api.github.com/users/oste/events{/privacy}","received_events_url":"https://api.github.com/users/oste/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T20:48:35Z","updated_at":"2015-04-08T20:48:35Z","body":"Unfortunately I have not had time to try without using jQuery for the $(document).ready features. This is the only place jQuery could be failing. Otherwise it would be a Chrome bug."}}