Closed Bug 775746 Opened 12 years ago Closed 9 years ago

Make nsDOMTouch inherit from SingleTouchData

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: drs, Unassigned)

References

Details

Attachments

(1 file)

They are nearly identical and we will have duplicate code if we don't do this. For now, nsDOMTouch is used in too many places that I don't understand. nsDOMTouch can only be used on the main thread because it has nsRefPtr<nsIWidget>, whereas SingleTouchData only has the data values like screen point, force, etc.
Depends on: 750974
Flags: needinfo?(drs.bugzilla)
Attachment #8573276 - Flags: feedback?(bugs)
If it is still needed, who should review this?
Does the patch make the code any simpler? I'm somewhat worried that if Touch becomes
SingleTouchData, and SingleTouchData is supposed to be thread-agnostic, we'll get crashes
if Touch objects (which are main-thread only) are passed  to other threads.
(In reply to Olli Pettay [:smaug] (no new review requests before March 8, please) from comment #3)
This changes made according with existing bug and comment http://mxr.mozilla.org/mozilla-central/source/widget/InputData.h#113
Could you please, give your opinion about this bug?
Flags: needinfo?(bugmail.mozilla)
I would rather close this bug as WONTFIX. I think there is a fairly clear distinction between SingleTouchData (and in general the stuff living in widget/InputData.h) and the DOM versions. The widget/InputData stuff is to be used in the widget code and when interacting with APZ, but once it goes to the main thread for gecko dispatch it should be converted to the DOM version.

The specific thing that makes me against having the DOM version extend the InputData version is that we have added like "mLocalScreenPoint" to SingleTouchData for APZ use, and it doesn't really make sense to import that into the DOM version. Also the coordinate systems of InputData and DOM are different (at least when APZ is around) and so if we were to combine the two we would have problems with ambiguity in that respect - should a point be in Screen space or LayoutDevice space? (That's one of the reasons we added mLocalScreenPoint in the first place, but I don't want to extend that to LayoutDevice space as well).

I'm not super concerned about the threading aspect that smaug mentioned in comment 3 although it is a valid concern as well. Overall I just don't think there's much win here, at least not to justify the effort.
Flags: needinfo?(bugmail.mozilla)
Attachment #8573276 - Flags: feedback?(bugs)
Closing for now, but feel free to argue your case if you feel otherwise.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Flags: needinfo?(drs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: