Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2a4ece3e4b025e969143a02a4b3e46c2999bc553
https://github.com/WebKit/WebKit/commit/2a4ece3e4b025e969143a02a4b3e46c2999bc553
Author: Ahmad Saleem <[email protected]>
Date: 2026-01-12 (Mon, 12 Jan 2026)
Changed paths:
M LayoutTests/fast/events/document-elementFromPoint-expected.txt
M LayoutTests/fast/events/document-elementFromPoint.html
M LayoutTests/fast/events/offsetX-offsetY-expected.txt
M LayoutTests/fast/events/offsetX-offsetY.html
M LayoutTests/fast/forms/option-mouseevents-expected.txt
M LayoutTests/fast/forms/option-mouseevents.html
M
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
M
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
M
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-expected.txt
M
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt
M
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
M
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
M
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-expected.txt
M
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt
M
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
M
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
M
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-expected.txt
M
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt
M
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
M
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
M
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-expected.txt
M
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt
M LayoutTests/transforms/3d/point-mapping/3d-point-mapping-2.html
M LayoutTests/transforms/3d/point-mapping/3d-point-mapping-deep.html
M LayoutTests/transforms/3d/point-mapping/3d-point-mapping-preserve-3d.html
M LayoutTests/transforms/3d/point-mapping/3d-point-mapping.html
M Source/WebCore/dom/MouseRelatedEvent.cpp
Log Message:
-----------
MouseEvent offsetX and offsetY should be relative to padding edge
https://bugs.webkit.org/show_bug.cgi?id=271694
rdar://125763807
Reviewed by Abrar Rahman Protyasha.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
Merge:
https://chromium.googlesource.com/chromium/src.git/+/ad76338520534c07a557bb68db876fbf2c34ce49
Currently, we are computing relative to target coordinate while we should
be relative to padding box and this patch subtract borderLeft / borderTop
from offsetX / offsetY to achieve this. This matches us with the web
specification [1] & [2]:
[1] https://drafts.csswg.org/cssom-view/#dom-mouseevent-offsetx
"...return the x-coordinate of the position where the event occurred relative
to the origin of the padding edge of the target node..."
[2] https://drafts.csswg.org/cssom-view/#dom-mouseevent-offsety
"...return the y-coordinate of the position where the event occurred relative
to the origin of the padding edge of the target node..."
* LayoutTests/fast/events/document-elementFromPoint-expected.txt:
* LayoutTests/fast/events/document-elementFromPoint.html:
* LayoutTests/fast/events/offsetX-offsetY-expected.txt:
* LayoutTests/fast/events/offsetX-offsetY.html:
* LayoutTests/fast/forms/option-mouseevents-expected.txt:
* LayoutTests/fast/forms/option-mouseevents.html:
*
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
*
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt:
*
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
*
LayoutTests/platform/glib/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt:
*
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
*
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt:
*
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
*
LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt:
*
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
*
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt:
*
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
*
LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt:
*
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
*
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt:
*
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
*
LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt:
* LayoutTests/transforms/3d/point-mapping/3d-point-mapping-2.html:
* LayoutTests/transforms/3d/point-mapping/3d-point-mapping-deep.html:
* LayoutTests/transforms/3d/point-mapping/3d-point-mapping-preserve-3d.html:
* LayoutTests/transforms/3d/point-mapping/3d-point-mapping.html:
* Source/WebCore/dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::computeRelativePosition):
Canonical link: https://commits.webkit.org/305479@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications