Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup/compensate for chrome zoomed offset bug #154

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jasco
Copy link

@jasco jasco commented Feb 14, 2017

Issue #153

@stevenbenner
Copy link
Owner

Could you go into more detail on this comment:

However, it appears that document.body serves equally well as a references and avoid needing to manipulate DOM.

I'm really hesitant to add additional elements to the page if there is any other option. My concern is that we don't know if there will be CSS or JavaScript acting on it, and if it causes bugs on some peoples sites it would be very hard to diagnose.

@jasco
Copy link
Author

jasco commented Apr 6, 2017

I understand your concern. To avoid inadvertently breaking code, perhaps we can make it an optional feature that could be enabled for those who encounter the problem and need a workaround.

I had a usually working technique that did not require adding an additional element by using the body element as its reference point. The technique was insufficient when (if memory serves) there was a margin applied to either html or body. Adding an absolute element worked even in those cases.

@stevenbenner
Copy link
Owner

stevenbenner commented Apr 9, 2017

Could you submit a pull request for the alternate version?

This problem is a bug that is likely affecting people right now, so it's higher priority than supporting unexpected body styling. If there is a safe fix that doesn't have backwards compatibility issues then I'd like to get it in for the next release.

Joel Steres added 5 commits June 12, 2017 12:09
Rather than using an element absolutely positioned at 0,0, compute
compensation value based on offset of body. This should be tested more
rigorously but on the upside it does avoid further manipulating the DOM.
Rather than rely on the change in body position to compute the mobile
zoom compensation introduce a hidden, absolutely position element whose
offset can be measured.  The body element can be offset due to vertical
margin collapse even when the element itself is positioned at the
origin. When this happens the body offset measurements become unreliable.
@jasco jasco force-pushed the fixup/compensate-for-chrome-zoomed-offset-bug branch from 5cad830 to f89c15c Compare June 17, 2017 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants