{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/frontend/issues/8201","labels_url":"https://api.github.com/repos/guardian/frontend/issues/8201/labels{/name}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/8201/comments","events_url":"https://api.github.com/repos/guardian/frontend/issues/8201/events","html_url":"https://github.com/guardian/frontend/pull/8201","id":56681537,"number":8201,"title":"Do not trigger layout when querying breakpoint (getBreakpoint)","user":{"login":"robertberry","id":1001642,"avatar_url":"https://avatars.githubusercontent.com/u/1001642?v=3","gravatar_id":"","url":"https://api.github.com/users/robertberry","html_url":"https://github.com/robertberry","followers_url":"https://api.github.com/users/robertberry/followers","following_url":"https://api.github.com/users/robertberry/following{/other_user}","gists_url":"https://api.github.com/users/robertberry/gists{/gist_id}","starred_url":"https://api.github.com/users/robertberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertberry/subscriptions","organizations_url":"https://api.github.com/users/robertberry/orgs","repos_url":"https://api.github.com/users/robertberry/repos","events_url":"https://api.github.com/users/robertberry/events{/privacy}","received_events_url":"https://api.github.com/users/robertberry/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-05T15:06:32Z","updated_at":"2015-02-09T14:44:06Z","closed_at":"2015-02-05T15:52:52Z","pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/8201","html_url":"https://github.com/guardian/frontend/pull/8201","diff_url":"https://github.com/guardian/frontend/pull/8201.diff","patch_url":"https://github.com/guardian/frontend/pull/8201.patch"},"body":"`window.getComputedStyle` triggers layout. A whole lot of different things use `getBreakpoint`, so this should give us a performance boost."},"comment":{"url":"https://api.github.com/repos/guardian/frontend/issues/comments/73519375","html_url":"https://github.com/guardian/frontend/pull/8201#issuecomment-73519375","issue_url":"https://api.github.com/repos/guardian/frontend/issues/8201","id":73519375,"user":{"login":"paullewis","id":617438,"avatar_url":"https://avatars.githubusercontent.com/u/617438?v=3","gravatar_id":"","url":"https://api.github.com/users/paullewis","html_url":"https://github.com/paullewis","followers_url":"https://api.github.com/users/paullewis/followers","following_url":"https://api.github.com/users/paullewis/following{/other_user}","gists_url":"https://api.github.com/users/paullewis/gists{/gist_id}","starred_url":"https://api.github.com/users/paullewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paullewis/subscriptions","organizations_url":"https://api.github.com/users/paullewis/orgs","repos_url":"https://api.github.com/users/paullewis/repos","events_url":"https://api.github.com/users/paullewis/events{/privacy}","received_events_url":"https://api.github.com/users/paullewis/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T14:44:06Z","updated_at":"2015-02-09T14:44:06Z","body":"Right, it's pretty much that if you called `getComputedStyle()` any pending styles will have to be flushed, and then layout run, so you may or may not see it, depending on where you call it in the lifecycle.\r\n\r\nUsual vibe should apply: do style reads _then_ writes to avoid a Forced Sync Layout, which in this case probably means querying the last frame's computed style values and storing them in some global (if you're not already) at the start of the frame of interest.\r\n\r\nThanks for the ping, this was funsies."}}