Open Bug 1364969 Opened 4 years ago Updated 4 years ago

radiusX and radiusY affected by retina display in synthesized touch events


(Core :: DOM: Events, defect, P3)

52 Branch




(Reporter: mcs, Unassigned)



(1 file)

While working on and running the tests created for that Tor bug on macOS, we discovered that that radiusX and radiusY values are doubled on a MacBook Pro that has a Retina display.

Here is the output from the failed tests (the result of running the attached test file):
    6 INFO TEST-UNEXPECTED-FAIL | dom/events/test/test_touchevent.html | touch.radiusX - got 4, expected 2
    7 INFO TEST-UNEXPECTED-FAIL | dom/events/test/test_touchevent.html | touch.radiusY - got 6, expected 3

This was observed with an ESR52-based branch.
:kats might be able to answer what's up here.
Component: Event Handling → DOM: Events
Flags: needinfo?(bugmail)
This does appear to be a bug. The `synthesizeTouch` function used to generate the touch event seems to take the radius input as CSS pixels, so the radiusX/radiusY value exposed should be the same. However, looking at the code at [1] the RadiusX() function returns mRadius.x, where mRadius is in LayoutDevice pixels, which will include the retina scaling factor.

The entire Touch class could probably do with some better use of strongly-typed units.

Flags: needinfo?(bugmail)
(To be clear, the bug here is that the RadiusX()/RadiusY() functions in Touch.cpp are directly returning a value in LayoutDevice space when they should probably be exposing CSS space values. Other callers of those functions might need to be modified as well.)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.