Bug 421793 - All useful fields missing from orion.edit.model mouse events
Summary: All useful fields missing from orion.edit.model mouse events
Status: NEW
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: 5.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2013-11-14 22:20 EST by Mark Macdonald CLA
Modified: 2015-05-08 09:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2013-11-14 22:20:55 EST
1. Create a plugin that implements an "orion.edit.model" service and listens to mouse or drag events, eg:

> pluginProvider.registerService("orion.edit.model", {
>     onMouseDown: function(event) {
>         console.log(event);
>     }
> }, {
>     types: ["MouseDown"],
>     contentTypes: ["application/javascript"]
> });

2. Install the plugin, open a .js file and move/click the mouse.
3. You'll see that the event object received by the plugin has only a single field:
> {   preventDefault: function() {..}   }

All of the interesting data (x, y, clickCount, etc) has been stripped out.

This is probably because the serviceRegistry interprets the event object as an ObjectReference due to the presence of the function 'preventDefault' (and possibly other functions in the 'event' field too, which provides the native browser MouseEvent).

The wiring code in dispatcher.js needs to sanitize these events, by removing function-typed fields, before sending them to the plugin.
Comment 1 John Arthorne CLA 2015-05-05 16:30:13 EDT
This open bug report had a target milestone in the past. The target milestone has been removed. Please target for a date in the future or leave the target blank if it is not known.
Comment 2 Eric Moffatt CLA 2015-05-08 09:43:09 EDT
Ssq, feel free to assign this to me if you want...