{"action":"created","issue":{"url":"https://api.github.com/repos/galambalazs/smoothscroll/issues/115","labels_url":"https://api.github.com/repos/galambalazs/smoothscroll/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/galambalazs/smoothscroll/issues/115/comments","events_url":"https://api.github.com/repos/galambalazs/smoothscroll/issues/115/events","html_url":"https://github.com/galambalazs/smoothscroll/pull/115","id":107181140,"number":115,"title":"Remove Absolute Element Workaround (soon)","user":{"login":"KillerJK","id":3981571,"avatar_url":"https://avatars.githubusercontent.com/u/3981571?v=3","gravatar_id":"","url":"https://api.github.com/users/KillerJK","html_url":"https://github.com/KillerJK","followers_url":"https://api.github.com/users/KillerJK/followers","following_url":"https://api.github.com/users/KillerJK/following{/other_user}","gists_url":"https://api.github.com/users/KillerJK/gists{/gist_id}","starred_url":"https://api.github.com/users/KillerJK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KillerJK/subscriptions","organizations_url":"https://api.github.com/users/KillerJK/orgs","repos_url":"https://api.github.com/users/KillerJK/repos","events_url":"https://api.github.com/users/KillerJK/events{/privacy}","received_events_url":"https://api.github.com/users/KillerJK/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-18T11:03:35Z","updated_at":"2015-09-18T11:24:56Z","closed_at":"2015-09-18T11:09:47Z","pull_request":{"url":"https://api.github.com/repos/galambalazs/smoothscroll/pulls/115","html_url":"https://github.com/galambalazs/smoothscroll/pull/115","diff_url":"https://github.com/galambalazs/smoothscroll/pull/115.diff","patch_url":"https://github.com/galambalazs/smoothscroll/pull/115.patch"},"body":"While working on a website I noticed a strange space was sometimes being added after the footer at the bottom of the page. I then found out this addon was the source of the problem. It sometimes adds a big, absolutely positioned element, needed to fix a bug according to comments in the code. It has MutationObserver, but when a media query changes an element's height, it's not triggered. I have a test case where the height of an element changes, scrollHeight changes with it, MutationObserver is not triggered, refresh is not called, the element's height is no longer correct and the page breaks.\r\n\r\nIn most situations the content in a webpage only grows or stays the same, and I suppose that's the reason why this wasn't found first. In my case however it shrinks, because there is a big textarea in the center, and its height is adjusted to maintain the aspect ratio when the user changes the width of the browser. I guess you could have other situations when resizing the window changed the font-size and the height of the whole page with it. The important part here is that there are ways of modifying it without changing the DOM.\r\n\r\nI made a [test](https://rawgit.com/KillerJK/9c258769f66c6a820f3d/raw/421fdf297a50896e19c9693d090deb220d13515c/bug-footer.html) to show exactly what happens. Load the webpage with a wide window, then shrink it to trigger the media query, and look at the footer.\r\n\r\nI didn't want to submit a bug report without at least trying to understand what was going on, but I don't know if you will like the very simple patch. I tried to find a way to trigger an event only when scrollHeight was modified, but I couldn't find anything other than observing attributes and the dom (which is not what I want).\r\n\r\nBecause the handler is in a 500ms timeout, it doesn't seem to affect performance. You can however still see how the footer is adjusted soon after the resize, and its ugly. You may want to increase the frequency, 500ms seems a very relaxed number for the work done by the handler. To be sure, you may want to profile it. If it's slow, maybe checking if a height change is necessary instead of always setting a new one.\r\n\r\nAnyway, my primary goal was making sure you were aware of this problem.\r\n\r\nAwesome extension!\r\n"},"comment":{"url":"https://api.github.com/repos/galambalazs/smoothscroll/issues/comments/141422666","html_url":"https://github.com/galambalazs/smoothscroll/pull/115#issuecomment-141422666","issue_url":"https://api.github.com/repos/galambalazs/smoothscroll/issues/115","id":141422666,"user":{"login":"KillerJK","id":3981571,"avatar_url":"https://avatars.githubusercontent.com/u/3981571?v=3","gravatar_id":"","url":"https://api.github.com/users/KillerJK","html_url":"https://github.com/KillerJK","followers_url":"https://api.github.com/users/KillerJK/followers","following_url":"https://api.github.com/users/KillerJK/following{/other_user}","gists_url":"https://api.github.com/users/KillerJK/gists{/gist_id}","starred_url":"https://api.github.com/users/KillerJK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KillerJK/subscriptions","organizations_url":"https://api.github.com/users/KillerJK/orgs","repos_url":"https://api.github.com/users/KillerJK/repos","events_url":"https://api.github.com/users/KillerJK/events{/privacy}","received_events_url":"https://api.github.com/users/KillerJK/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T11:24:56Z","updated_at":"2015-09-18T11:24:56Z","body":"Done. I classified it as serious bug for maximum effect. They probably dislike me now."}}