{"action":"closed","issue":{"url":"https://api.github.com/repos/aframevr/aframe/issues/579","repository_url":"https://api.github.com/repos/aframevr/aframe","labels_url":"https://api.github.com/repos/aframevr/aframe/issues/579/labels{/name}","comments_url":"https://api.github.com/repos/aframevr/aframe/issues/579/comments","events_url":"https://api.github.com/repos/aframevr/aframe/issues/579/events","html_url":"https://github.com/aframevr/aframe/issues/579","id":126332081,"number":579,"title":"Investigate why Chrome doesn't know correct size of canvas when an HTML import exists on the page","user":{"login":"ngokevin","id":674727,"avatar_url":"https://avatars.githubusercontent.com/u/674727?v=3","gravatar_id":"","url":"https://api.github.com/users/ngokevin","html_url":"https://github.com/ngokevin","followers_url":"https://api.github.com/users/ngokevin/followers","following_url":"https://api.github.com/users/ngokevin/following{/other_user}","gists_url":"https://api.github.com/users/ngokevin/gists{/gist_id}","starred_url":"https://api.github.com/users/ngokevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngokevin/subscriptions","organizations_url":"https://api.github.com/users/ngokevin/orgs","repos_url":"https://api.github.com/users/ngokevin/repos","events_url":"https://api.github.com/users/ngokevin/events{/privacy}","received_events_url":"https://api.github.com/users/ngokevin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aframevr/aframe/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T03:20:41Z","updated_at":"2016-02-05T10:03:25Z","closed_at":"2016-02-05T10:03:25Z","body":"<a href=\"https://github.com/cvan\"><img src=\"https://avatars.githubusercontent.com/u/203725?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [cvan](https://github.com/cvan)**\n_Saturday Oct 24, 2015 at 00:49 GMT_\n_Originally opened as https://github.com/aframevr/aframe-core/issues/321_\n\n----\n\nFor whatever reason, simply adding a `<link rel=\"import\">` (without even an `href`) to the `<head>` of the page (even a `<link rel=\"import\" async>`) causes Chrome to think `canvas.offsetWidth` and `canvas.offsetHeight` are both `0` at [this point in the scene creation/canvas (re)sizing](https://github.com/MozVR/aframe-core/blob/ca9d11c/src/core/vr-scene.js#L330-L331).\r\n\r\nEven if we wait for `<vr-scene>`'s the `loaded` custom event to fire, it's still `0`.\r\n\r\nWe actually have to wait for the document to fire __`load`__; for some reason, __`DOMContentLoaded`__ is not late enough.\r\n\r\nAccording to the [__HTML Imports__ spec](http://www.w3.org/TR/html-imports/#additions-to-tree-construction-algorithm):\r\n\r\n> All import dependents __must__ be loaded before DOMContentLoaded is fired. See [Bug 23526](https://www.w3.org/Bugs/Public/show_bug.cgi?id=23526).\r\n\r\nFirefox and other browsers aren't affected because HTML Imports are natively supported on only Chrome; elsewhere polyfills are being used.\r\n\r\nI checked the [Chromium bugs](https://code.google.com/p/chromium/issues/list?q=html+import), and I couldn't find anything on file.\n"}}