Bug 218117 - MouseEvent.offsetX/Y returns wrong value for inline elements
Summary: MouseEvent.offsetX/Y returns wrong value for inline elements
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-23 01:13 PDT by Noam Rosenthal
Modified: 2020-10-30 01:13 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noam Rosenthal 2020-10-23 01:13:04 PDT
According to spec (https://drafts.csswg.org/cssom-view/#dom-mouseevent-offsetx), offsetX/offsetY should return the values relative to the element's padding edge.
Firefox does this correctly, WebKit (and also Chromium, currently), return the value relative to the nearest block ancestor. 

See https://codepen.io/noamr-the-selector/pen/WNxRbmZ
Comment 1 Noam Rosenthal 2020-10-23 01:18:56 PDT
Corresponding Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1141782
Comment 2 Noam Rosenthal 2020-10-23 01:21:01 PDT
Relevant WPT issue: https://github.com/web-platform-tests/wpt/issues/15089
Comment 3 Radar WebKit Bug Importer 2020-10-30 01:13:58 PDT
<rdar://problem/70857665>