Closed
Bug 788148
Opened 12 years ago
Closed 12 years ago
Script debugger doesn't show clientX and clientY properties for MouseEvent object
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Honza, Assigned: past)
References
Details
I don't see clientX and clientY props in the built-in debugger.
STR:
1) use the attached code snippet example
2) create a breakpoint on the console.log line
3) Break in the debugger
4) check the 'Function Scope' section and expand the 'Event' object
5) clientX and clientY are not there
function test(event)
{
console.log(event);
}
<button onclick="test(event)">Click Me</button>
Note that the properties are visible if the object is inspected using Web Console.
Honza
Assignee | ||
Comment 1•12 years ago
|
||
I've put your test code here:
http://htmlpad.org/native-desc/
The reason these properties don't show up is that Debugger.Object.getOwnPropertyDescriptor throws NS_ERROR_XPC_BAD_OP_ON_WN_PROTO:
http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/debugger/server/dbg-script-actors.js#1184
In the log I see this error for the following properties of MouseEvent: type,target,currentTarget,eventPhase,bubbles,cancelable,timeStamp,defaultPrevented,which,rangeParent,rangeOffset,pageX,pageY,isChar,screenX,screenY,mozMovementX,mozMovementY,clientX,clientY,ctrlKey,shiftKey,altKey,metaKey,button,buttons,relatedTarget,mozPressure,mozInputSource
I don't know the cause of this error or how to work around it, but hopefully Jim or Jason would have some ideas.
Assignee: nobody → past
Status: NEW → ASSIGNED
Priority: -- → P2
Assignee | ||
Comment 2•12 years ago
|
||
This seems to be caused by bug 560072. It would be nice if we could come up with a workaround, because that bug doesn't seem easy to fix.
Depends on: 560072
Comment 3•12 years ago
|
||
Note that bug 792215 will change the weird accessor properties on the prototype into ordinary accessor properties. The mouse events will still display as property-less objects whose prototypes have accessors on them, though, which is unfortunate.
It might be possible to use hostAnnotations to tell the debugger when to display such things. That's a proposed mechanism for objects' classes to give Debugger metadata about instances.
Draft spec for hostAnnotations:
https://github.com/jimblandy/DebuggerDocs/tree/onNewGlobal
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Panos Astithas [:past] from comment #4)
> This *may* get fixed by bug 830818.
Surprise, it didn't!
Bug 776864 is needed too, from what I can tell.
Depends on: 776864
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Panos Astithas [:past] from comment #5)
> (In reply to Panos Astithas [:past] from comment #4)
> > This *may* get fixed by bug 830818.
>
> Surprise, it didn't!
> Bug 776864 is needed too, from what I can tell.
...or more accurately, bug 851073. Which was just fixed! \o/
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 7•12 years ago
|
||
(In reply to Panos Astithas [:past] from comment #6)
> ...or more accurately, bug 851073. Which was just fixed! \o/
A million times \o/
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•