{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/fullscreen/issues/5","labels_url":"https://api.github.com/repos/whatwg/fullscreen/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/fullscreen/issues/5/comments","events_url":"https://api.github.com/repos/whatwg/fullscreen/issues/5/events","html_url":"https://github.com/whatwg/fullscreen/issues/5","id":93659747,"number":5,"title":"Time to dispatch the fullscreenchange event","user":{"login":"upsuper","id":333750,"avatar_url":"https://avatars.githubusercontent.com/u/333750?v=3","gravatar_id":"","url":"https://api.github.com/users/upsuper","html_url":"https://github.com/upsuper","followers_url":"https://api.github.com/users/upsuper/followers","following_url":"https://api.github.com/users/upsuper/following{/other_user}","gists_url":"https://api.github.com/users/upsuper/gists{/gist_id}","starred_url":"https://api.github.com/users/upsuper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upsuper/subscriptions","organizations_url":"https://api.github.com/users/upsuper/orgs","repos_url":"https://api.github.com/users/upsuper/repos","events_url":"https://api.github.com/users/upsuper/events{/privacy}","received_events_url":"https://api.github.com/users/upsuper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-08T00:26:07Z","updated_at":"2015-07-09T14:38:30Z","closed_at":null,"body":"In the current spec, the `fullscreenchange` event is dispatched synchronously inside the loop of changing the document state, which means the event handler may reach an incomplete state of style. For `requestFullscreen`, the state of the child document isn't flipped. For `exitFullscreen`, the state of the parent document isn't flipped.\r\n\r\nAs far as I can see, it doesn't match any of the current impl. Gecko, Blink (assuming WebKit shares the same code), Trident (including Edge which is shipping the unprefixed Fullscreen API) dispatch all `fullscreenchange` events with a complete state.\r\n\r\nPersonally I don't have a strong opinion about which is better. But given all impls agree with the same way, and I don't see reaching incomplete state makes much sense, I propose we change the spec to match the impls."},"comment":{"url":"https://api.github.com/repos/whatwg/fullscreen/issues/comments/120007201","html_url":"https://github.com/whatwg/fullscreen/issues/5#issuecomment-120007201","issue_url":"https://api.github.com/repos/whatwg/fullscreen/issues/5","id":120007201,"user":{"login":"foolip","id":498917,"avatar_url":"https://avatars.githubusercontent.com/u/498917?v=3","gravatar_id":"","url":"https://api.github.com/users/foolip","html_url":"https://github.com/foolip","followers_url":"https://api.github.com/users/foolip/followers","following_url":"https://api.github.com/users/foolip/following{/other_user}","gists_url":"https://api.github.com/users/foolip/gists{/gist_id}","starred_url":"https://api.github.com/users/foolip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foolip/subscriptions","organizations_url":"https://api.github.com/users/foolip/orgs","repos_url":"https://api.github.com/users/foolip/repos","events_url":"https://api.github.com/users/foolip/events{/privacy}","received_events_url":"https://api.github.com/users/foolip/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T14:38:30Z","updated_at":"2015-07-09T14:38:30Z","body":"Yes, the promises should be resolved and the events fired in an animation frame task, but after everything else is done like @upsuper suggests sure seems less risky."}}