[Webkit-unassigned] [Bug 72524] offsetTop incorrect for empty inline elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 30 07:27:30 PDT 2018


--- Comment #8 from Terje Bless <link at pobox.com> ---
Created attachment 348496

  --> https://bugs.webkit.org/attachment.cgi?id=348496&action=review

offsetTop varies based on a single space

Additional test case that demonstrates the insanity of the current behaviour.

Four lines of text (broken with br), where the empty span in line 3 has a lower .offsetTop than that in both lines 2 and 4. The difference between the lines is that in line 3 the span has two literal space characters in front of it, while lines 1,2, and 4 have a single space character. (other seemingly random differences can produce the same effect: for instance, adding a space after the span in line 4 will change its offsetTop). All four elements report their .offsetParent to be the body element.

Empty or not, the reported position of a span element should not be affected the number of space characters in front of it, and it makes no sense for the middle of three following span elements to have its position calculated differently.

Or put another way, absent something that actively fiddles with positioning, empty inline elements should be treated identically to non-empty inline elements, at least as far as where their "top" is. Even a point (no area) has an x and y coordinate.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180830/f4a30dc6/attachment.html>

More information about the webkit-unassigned mailing list