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

Element.getOffsets() is broken in iOS 4.3 if using -webkit-transform #2245

Closed
ibolmo opened this issue Jan 19, 2012 · 3 comments
Closed

Element.getOffsets() is broken in iOS 4.3 if using -webkit-transform #2245

ibolmo opened this issue Jan 19, 2012 · 3 comments

Comments

@ibolmo
Copy link
Member

ibolmo commented Jan 19, 2012

Element.getOffsets() is not reporting the correct values if an element is within a div that has been translated using the -webkit-transform property in MobileSafari in iOS 4.3.1. This is the case as tested on my iPhone 3GS and iPad 1, both with iOS 4.3.1.

Please see the attached HTML file to see a test case. The red border box should have the getOffsets() values of the red box itself, it reads (20, 20) on webkit browsers on my Mac, as expected, but is instead (20+width_of_browser_window, 20) on iOS. The red box is within a DIV that had been translated to the left using -webkit-transform, the red box is itself translated to the right to compensate.

Seems to me the problem is in line 4313 of mootools_core_1.3.1.js, as for some reason this.getBoundingClientRect is ignored for iOS. Whatever issue that prevented this.getBoundingClientRect from being used in iOS I presume has been fixed in 4.3, as if I remove the ios check, the test case works as intended.

Attached file

@ibolmo
Copy link
Member Author

ibolmo commented Jan 19, 2012

(from a comment)

Additionally, elements within a div using CSS3 multi columns are also affected.

@varyen
Copy link

varyen commented Feb 13, 2012

This problem also exists in desktop webkits. When I use -webkit-transform with matrix for rotation, element.getPosition() returns different values in firefox and in chrome & safari.

@ibolmo ibolmo modified the milestones: 1.5.1, 1.5 Mar 3, 2014
@SergioCrisostomo SergioCrisostomo modified the milestones: 1.5.2, 1.5.1 Jul 3, 2014
@ibolmo
Copy link
Member Author

ibolmo commented Jan 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants