{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/5624","repository_url":"https://api.github.com/repos/ampproject/amphtml","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/5624/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/5624/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/5624/events","html_url":"https://github.com/ampproject/amphtml/pull/5624","id":183163139,"number":5624,"title":"Calculate current absolute position of fixed-position elements","user":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"assignees":[{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},{"login":"camelburrito","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/camelburrito","html_url":"https://github.com/camelburrito","followers_url":"https://api.github.com/users/camelburrito/followers","following_url":"https://api.github.com/users/camelburrito/following{/other_user}","gists_url":"https://api.github.com/users/camelburrito/gists{/gist_id}","starred_url":"https://api.github.com/users/camelburrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camelburrito/subscriptions","organizations_url":"https://api.github.com/users/camelburrito/orgs","repos_url":"https://api.github.com/users/camelburrito/repos","events_url":"https://api.github.com/users/camelburrito/events{/privacy}","received_events_url":"https://api.github.com/users/camelburrito/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-10-14T22:23:13Z","updated_at":"2016-10-17T19:20:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/5624","html_url":"https://github.com/ampproject/amphtml/pull/5624","diff_url":"https://github.com/ampproject/amphtml/pull/5624.diff","patch_url":"https://github.com/ampproject/amphtml/pull/5624.patch"},"body":"Currently, we Resources cache the absolute position (`layoutBox`'s `top` and `bottom`). This works perfectly for the majority of elements, since they never move absolutely.\r\n\r\nBut fixed-position elements are different. They are positioned relative to the viewport, and the viewport moves. So, fixed-positions \"move\" absolutely. This change makes it so that we cache the relative positions of fixed-positions (to the viewport). When we later ask for the element's `layoutBox`, we'll calculate the real absolute position by adding in the current `scrollTop` and `scrollLeft`. This is exactly the same as what I'm [doing for ad's `layoutBox`](https://github.com/ampproject/amphtml/pull/5271).\r\n\r\nPart 2 (and hopefully the final) of #5149.\r\n/cc @jasti."},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/254306061","html_url":"https://github.com/ampproject/amphtml/pull/5624#issuecomment-254306061","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/5624","id":254306061,"user":{"login":"camelburrito","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/camelburrito","html_url":"https://github.com/camelburrito","followers_url":"https://api.github.com/users/camelburrito/followers","following_url":"https://api.github.com/users/camelburrito/following{/other_user}","gists_url":"https://api.github.com/users/camelburrito/gists{/gist_id}","starred_url":"https://api.github.com/users/camelburrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camelburrito/subscriptions","organizations_url":"https://api.github.com/users/camelburrito/orgs","repos_url":"https://api.github.com/users/camelburrito/repos","events_url":"https://api.github.com/users/camelburrito/events{/privacy}","received_events_url":"https://api.github.com/users/camelburrito/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T19:20:37Z","updated_at":"2016-10-17T19:20:37Z","body":"LGTM - @dvoytenko do you want to take a pass?"}}
{"actor":{"display_login":"camelburrito"}}