W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

Re: [csswg-drafts] [cssom-view] Behavior of MouseEvent.offsetX/Y with inline elements is inconsistent across browsers (#5659)

From: Noam Rosenthal via GitHub <sysbot+gh@w3.org>
Date: Thu, 12 Nov 2020 07:43:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-725901188-1605167029-sysbot+gh@w3.org>
I was surprised to find out that `MouseEvent.offsetX`, according to [UseCounter](https://www.chromestatus.com/metrics/feature/timeline/popularity/502), is used in 50% of websites!

I did some investigation and found that a main contributor to that could be [this line in jQuery](https://github.com/jquery/jquery/blob/e743cbd28553267f955f71ea7248377915613fd9/test/data/jquery-1.9.1.js#L3259). Apparently jQuery copies some of the mouse event props from the native event to the jQuery event, `MouseEvent.offsetX `being one of them.

So Chrome UseCounter for offsetX/offsetY doesn't check actual usage in this case (and in potential many other cases), but some arbitrary library behavior.



-- 
GitHub Notification of comment by noamr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5659#issuecomment-725901188 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 12 November 2020 07:43:51 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC