NEW68337
Images inside relatively-positioned links have incorrect offsetTop values
https://bugs.webkit.org/show_bug.cgi?id=68337
Summary Images inside relatively-positioned links have incorrect offsetTop values
Mark James
Reported 2011-09-19 01:02:57 PDT
The test URL has an image inside a link followed by a sized div inside a link. Each link is relatively positioned, and scripts are used to print the relative vertical position of each link with respect to its content block (image or div), via the content's offsetTop value. Google Chrome Beta 14.0.835.163 (Webkit 91698, 07/25/2011) gives incorrect values of 0 for the first and 203 for the second (image attached). The value does not change if a vertical align setting changes the relative positions of the link and its content. Firefox 6.0.1 gives the correct value of -37 for the first and an incorrect 0 for the second. Internet Explorer 8 gives correct values of 2 and 21.
Attachments
Rendering of test URL on Google Chrome Beta Version 14.0.835.163, September 14, 2011 (13.83 KB, image/png)
2011-09-19 01:04 PDT, Mark James
no flags
All browsers differ from each other (902.42 KB, image/png)
2022-07-29 16:53 PDT, Ahmad Saleem
no flags
Mark James
Comment 1 2011-09-19 01:04:40 PDT
Created attachment 107813 [details] Rendering of test URL on Google Chrome Beta Version 14.0.835.163, September 14, 2011
Mark James
Comment 2 2011-09-19 01:13:31 PDT
Note that a workaround for the image offset is navigator.userAgent.indexOf('AppleWebKit/') >= 0 ? img.getBoundingClientRect().top-img.parentNode.getBoundingClientRect().top : img.offsetTop
Ahmad Saleem
Comment 3 2022-07-29 16:53:17 PDT
Created attachment 461301 [details] All browsers differ from each other As can been seen from the attached screenshot, all browsers differ from each other based on test case attached in the URL field. Thanks!
Ryosuke Niwa
Comment 4 2022-07-29 16:58:35 PDT
What a mess! Thanks for testing.
alan
Comment 5 2022-08-01 08:01:47 PDT
This still runs legacy line layout. Will re-test it when IFC is enabled for positioned content.
Note You need to log in before you can comment on or make changes to this bug.