Difference between revisions of "Stack Trace for nsDOMMouseEvent::GetScreenX"
(Created page with 'Attach a 'mousemove' event listener, move your mouse, access event.screenX: <pre> #0 nsDOMMouseEvent::GetScreenX (this=0x11ac73880, aScreenX=0x7fff5fbf9478) at /Users/dave/repo…') |
|||
Line 1: | Line 1: | ||
Attach a 'mousemove' event listener, move your mouse, access event.screenX: | Attach a 'mousemove' event listener, move your mouse, access event.screenX: | ||
+ | |||
+ | <pre> | ||
+ | 221 NS_METHOD nsDOMMouseEvent::GetScreenX(PRInt32* aScreenX) | ||
+ | 222 { | ||
+ | 223 NS_ENSURE_ARG_POINTER(aScreenX); | ||
+ | 224 *aScreenX = GetScreenPoint().x; | ||
+ | 225 return NS_OK; | ||
+ | 226 } | ||
+ | </pre> | ||
+ | |||
+ | this calls nsDOMUIEvent::GetScreenPoint: | ||
+ | |||
+ | <pre> | ||
+ | 126 nsDOMUIEvent::GetScreenPoint() | ||
+ | 127 { | ||
+ | 128 if (!mEvent || | ||
+ | 129 (mEvent->eventStructType != NS_MOUSE_EVENT && | ||
+ | 130 mEvent->eventStructType != NS_POPUP_EVENT && | ||
+ | 131 mEvent->eventStructType != NS_MOUSE_SCROLL_EVENT && | ||
+ | 132 mEvent->eventStructType != NS_MOZTOUCH_EVENT && | ||
+ | 133 mEvent->eventStructType != NS_DRAG_EVENT && | ||
+ | 134 mEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) { | ||
+ | 135 return nsIntPoint(0, 0); | ||
+ | 136 } | ||
+ | 137 | ||
+ | 138 if (!((nsGUIEvent*)mEvent)->widget ) { | ||
+ | 139 return mEvent->refPoint; | ||
+ | 140 } | ||
+ | 141 | ||
+ | 142 nsIntPoint offset = mEvent->refPoint + // <---------------------here | ||
+ | 143 ((nsGUIEvent*)mEvent)->widget->WidgetToScreenOffset(); | ||
+ | 144 nscoord factor = mPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel(); | ||
+ | 145 return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor), | ||
+ | 146 nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor)); | ||
+ | 147 } | ||
+ | </pre> | ||
+ | |||
<pre> | <pre> |
Latest revision as of 21:05, 19 November 2011
Attach a 'mousemove' event listener, move your mouse, access event.screenX:
221 NS_METHOD nsDOMMouseEvent::GetScreenX(PRInt32* aScreenX) 222 { 223 NS_ENSURE_ARG_POINTER(aScreenX); 224 *aScreenX = GetScreenPoint().x; 225 return NS_OK; 226 }
this calls nsDOMUIEvent::GetScreenPoint:
126 nsDOMUIEvent::GetScreenPoint() 127 { 128 if (!mEvent || 129 (mEvent->eventStructType != NS_MOUSE_EVENT && 130 mEvent->eventStructType != NS_POPUP_EVENT && 131 mEvent->eventStructType != NS_MOUSE_SCROLL_EVENT && 132 mEvent->eventStructType != NS_MOZTOUCH_EVENT && 133 mEvent->eventStructType != NS_DRAG_EVENT && 134 mEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) { 135 return nsIntPoint(0, 0); 136 } 137 138 if (!((nsGUIEvent*)mEvent)->widget ) { 139 return mEvent->refPoint; 140 } 141 142 nsIntPoint offset = mEvent->refPoint + // <---------------------here 143 ((nsGUIEvent*)mEvent)->widget->WidgetToScreenOffset(); 144 nscoord factor = mPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel(); 145 return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor), 146 nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor)); 147 }
#0 nsDOMMouseEvent::GetScreenX (this=0x11ac73880, aScreenX=0x7fff5fbf9478) at /Users/dave/repos/mozilla-central/content/events/src/nsDOMMouseEvent.cpp:240 #1 0x000000010247b756 in nsIDOMMouseEvent_GetScreenX (cx=0x122aa7ab0, obj=0x14c2a2190, id={asBits = 4746707680}, vp=0x11a500238) at /Users/dave/repos/mozilla-central/objdir-debug/js/xpconnect/src/dom_quickstubs.cpp:10873 #2 0x00000001012e22f4 in js::CallJSPropertyOp (cx=0x122aa7ab0, op=0x10247b6cc <nsIDOMMouseEvent_GetScreenX(JSContext*, JSObject*, jsid, JS::Value*)>, receiver=0x14c2a2190, id={asBits = 4746707680}, vp=0x11a500238) at jscntxtinlines.h:347 #3 0x00000001012e3317 in js::Shape::get (this=0x14c279800, cx=0x122aa7ab0, receiver=0x14c2a2190, obj=0x14c2a2190, pobj=0x14c2a2030, vp=0x11a500238) at jsscopeinlines.h:295 #4 0x00000001012d4960 in js_NativeGetInline (cx=0x122aa7ab0, receiver=0x14c2a2190, obj=0x14c2a2190, pobj=0x14c2a2030, shape=0x14c279800, getHow=0, vp=0x11a500238) at /Users/dave/repos/mozilla-central/js/src/jsobj.cpp:5771 #5 0x00000001012d6934 in js_GetPropertyHelperInline (cx=0x122aa7ab0, obj=0x14c2a2190, receiver=0x14c2a2190, id={asBits = 4746707680}, getHow=0, vp=0x11a500238) at /Users/dave/repos/mozilla-central/js/src/jsobj.cpp:5951 #6 0x00000001012d69a2 in js_GetProperty (cx=0x122aa7ab0, obj=0x14c2a2190, receiver=0x14c2a2190, id={asBits = 4746707680}, vp=0x11a500238) at /Users/dave/repos/mozilla-central/js/src/jsobj.cpp:5967 #7 0x00000001012c8834 in JSObject::getGeneric (this=0x14c2a2190, cx=0x122aa7ab0, receiver=0x14c2a2190, id={asBits = 4746707680}, vp=0x11a500238) at jsobjinlines.h:198 #8 0x00000001012e4584 in JSObject::getGeneric (this=0x14c2a2190, cx=0x122aa7ab0, id={asBits = 4746707680}, vp=0x11a500238) at jsobjinlines.h:213 #9 0x000000010124df55 in JSObject::getProperty (this=0x14c2a2190, cx=0x122aa7ab0, name=0x11aed02e0, vp=0x11a500238) at jsobjinlines.h:219 #10 0x00000001012b6e69 in js::Interpret (cx=0x122aa7ab0, entryFrame=0x11a5000d8, interpMode=js::JSINTERP_NORMAL) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:3821 #11 0x00000001012c4c9f in js::RunScript (cx=0x122aa7ab0, script=0x149c00f30, fp=0x11a5000d8) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:584 #12 0x00000001012c52aa in js::InvokeKernel (cx=0x122aa7ab0, args={<js::CallReceiver> = {usedRval_ = false, argv_ = 0x11a5000d0}, argc_ = 1}, construct=js::NO_CONSTRUCT) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:647 #13 0x00000001012c92b7 in js::Invoke (cx=0x122aa7ab0, args=@0x7fff5fbfabc0, construct=js::NO_CONSTRUCT) at jsinterp.h:148 #14 0x00000001030c1f5d in js_fun_apply (cx=0x122aa7ab0, argc=2, vp=0x11a5000a0) at /Users/dave/repos/mozilla-central/js/src/jsfun.cpp:1835 #15 0x00000001012c822e in js::CallJSNative (cx=0x122aa7ab0, native=0x1030c1cc7 <js_fun_apply(JSContext*, unsigned int, JS::Value*)>, args=@0x7fff5fbfad80) at jscntxtinlines.h:297 #16 0x00000001012c51cb in js::InvokeKernel (cx=0x122aa7ab0, args={<js::CallReceiver> = {usedRval_ = false, argv_ = 0x11a5000b0}, argc_ = 2}, construct=js::NO_CONSTRUCT) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:629 #17 0x00000001012b7cb3 in js::Interpret (cx=0x122aa7ab0, entryFrame=0x11a500038, interpMode=js::JSINTERP_NORMAL) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:3950 #18 0x00000001012c4c9f in js::RunScript (cx=0x122aa7ab0, script=0x149c00b20, fp=0x11a500038) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:584 #19 0x00000001012c52aa in js::InvokeKernel (cx=0x122aa7ab0, args={<js::CallReceiver> = {usedRval_ = false, argv_ = 0x11a500030}, argc_ = 1}, construct=js::NO_CONSTRUCT) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:647 #20 0x00000001012c92b7 in js::Invoke (cx=0x122aa7ab0, args=@0x7fff5fbfc1b0, construct=js::NO_CONSTRUCT) at jsinterp.h:148 #21 0x00000001012c56ca in js::Invoke (cx=0x122aa7ab0, thisv=@0x7fff5fbfc280, fval=@0x7fff5fbfc248, argc=1, argv=0x7fff5fbfc960, rval=0x7fff5fbfc680) at /Users/dave/repos/mozilla-central/js/src/jsinterp.cpp:679 #22 0x000000010306961c in JS_CallFunctionValue (cx=0x122aa7ab0, obj=0x148aa1450, fval={data = {asBits = 18445477441853023048, debugView = {payload47 = 5538669384, tag = JSVAL_TAG_OBJECT}, s = {payload = {i32 = 1243702088, u32 = 1243702088, why = 1243702088}}, asDouble = -nan(0xb80014a216348), asPtr = 0xfffb80014a216348, asWord = 18445477441853023048}}, argc=1, argv=0x7fff5fbfc960, rval=0x7fff5fbfc680) at /Users/dave/repos/mozilla-central/js/src/jsapi.cpp:5223 #23 0x00000001024486c9 in nsXPCWrappedJSClass::CallMethod (this=0x11c8919c0, wrapper=0x11acad000, methodIndex=3, info=0x11971e528, nativeParams=0x7fff5fbfcab0) at /Users/dave/repos/mozilla-central/js/xpconnect/src/XPCWrappedJSClass.cpp:1530 #24 0x000000010243f380 in nsXPCWrappedJS::CallMethod (this=0x11acad000, methodIndex=3, info=0x11971e528, params=0x7fff5fbfcab0) at /Users/dave/repos/mozilla-central/js/xpconnect/src/XPCWrappedJS.cpp:611 #25 0x0000000102bd055c in PrepareAndDispatch (self=0x11ac0d400, methodIndex=3, args=0x7fff5fbfcc30, gpregs=0x7fff5fbfcbb0, fpregs=0x7fff5fbfcbe0) at /Users/dave/repos/mozilla-central/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp:153 #26 0x0000000102bcefbb in SharedStub () at xpt_struct.h:334 #27 0x0000000101c4a5a1 in nsEventListenerManager::HandleEventSubType (this=0x11c9cae90, aListenerStruct=0x1270a18a8, aListener=0x11ac0d400, aDOMEvent=0x11ac73880, aCurrentTarget=0x12661f000, aPhaseFlags=2, aPusher=0x7fff5fbfcf80) at /Users/dave/repos/mozilla-central/content/events/src/nsEventListenerManager.cpp:736 #28 0x0000000101c4a7ba in nsEventListenerManager::HandleEventInternal (this=0x11c9cae90, aPresContext=0x11cc08c00, aEvent=0x7fff5fbfd090, aDOMEvent=0x7fff5fbfcf60, aCurrentTarget=0x12661f000, aFlags=2, aEventStatus=0x7fff5fbfcf68, aPusher=0x7fff5fbfcf80) at /Users/dave/repos/mozilla-central/content/events/src/nsEventListenerManager.cpp:793 #29 0x0000000101c7bf27 in nsEventListenerManager::HandleEvent (this=0x11c9cae90, aPresContext=0x11cc08c00, aEvent=0x7fff5fbfd090, aDOMEvent=0x7fff5fbfcf60, aCurrentTarget=0x12661f000, aFlags=2, aEventStatus=0x7fff5fbfcf68, aPusher=0x7fff5fbfcf80) at nsEventListenerManager.h:160 #30 0x0000000101c7c0d3 in nsEventTargetChainItem::HandleEvent (this=0x11b10d7a8, aVisitor=@0x7fff5fbfcf50, aFlags=2, aMayHaveNewListenerManagers=false, aPusher=0x7fff5fbfcf80) at /Users/dave/repos/mozilla-central/content/events/src/nsEventDispatcher.cpp:215 #31 0x0000000101c7a41a in nsEventTargetChainItem::HandleEventTargetChain (this=0x11b10d770, aVisitor=@0x7fff5fbfcf50, aFlags=6, aCallback=0x7fff5fbfd110, aMayHaveNewListenerManagers=false, aPusher=0x7fff5fbfcf80) at /Users/dave/repos/mozilla-central/content/events/src/nsEventDispatcher.cpp:367 #32 0x0000000101c7b336 in nsEventDispatcher::Dispatch (aTarget=0x11b75f280, aPresContext=0x11cc08c00, aEvent=0x7fff5fbfd090, aDOMEvent=0x0, aEventStatus=0x7fff5fbfd13c, aCallback=0x7fff5fbfd110, aTargets=0x0) at /Users/dave/repos/mozilla-central/content/events/src/nsEventDispatcher.cpp:677 #33 0x0000000101c5161d in nsEventStateManager::DispatchMouseEvent (this=0x124776e10, aEvent=0x7fff5fbfdbb0, aMessage=331, aTargetContent=0x11b75f280, aRelatedContent=0x11bae4980) at /Users/dave/repos/mozilla-central/content/events/src/nsEventStateManager.cpp:3834 #34 0x0000000101c51b9b in nsEventStateManager::NotifyMouseOver (this=0x124776e10, aEvent=0x7fff5fbfdbb0, aContent=0x11b75f280) at /Users/dave/repos/mozilla-central/content/events/src/nsEventStateManager.cpp:4003 #35 0x0000000101c51cf4 in nsEventStateManager::GenerateMouseEnterExit (this=0x124776e10, aEvent=0x7fff5fbfdbb0) at /Users/dave/repos/mozilla-central/content/events/src/nsEventStateManager.cpp:4032 #36 0x0000000101c5a50a in nsEventStateManager::PreHandleEvent (this=0x124776e10, aPresContext=0x11cc08c00, aEvent=0x7fff5fbfdbb0, aTargetFrame=0x14b20fe90, aStatus=0x7fff5fbfd83c, aView=0x1229aa480) at /Users/dave/repos/mozilla-central/content/events/src/nsEventStateManager.cpp:1150 #37 0x00000001017e0669 in PresShell::HandleEventInternal (this=0x1229c6c00, aEvent=0x7fff5fbfdbb0, aView=0x1229aa480, aStatus=0x7fff5fbfd83c) at /Users/dave/repos/mozilla-central/layout/base/nsPresShell.cpp:6450 #38 0x00000001017e0bd2 in PresShell::HandlePositionedEvent (this=0x1229c6c00, aView=0x1229aa480, aTargetFrame=0x14b20fe90, aEvent=0x7fff5fbfdbb0, aEventStatus=0x7fff5fbfd83c) at /Users/dave/repos/mozilla-central/layout/base/nsPresShell.cpp:6222 #39 0x00000001017e1de7 in PresShell::HandleEvent (this=0x11bc5a800, aView=0x11bbc9100, aEvent=0x7fff5fbfdbb0, aDontRetargetEvents=false, aEventStatus=0x7fff5fbfd83c) at /Users/dave/repos/mozilla-central/layout/base/nsPresShell.cpp:6044 #40 0x0000000101e77f32 in nsViewManager::HandleEvent (this=0x11bc23e60, aView=0x11bbc9100, aEvent=0x7fff5fbfdbb0) at /Users/dave/repos/mozilla-central/view/src/nsViewManager.cpp:1023 #41 0x0000000101e7ab1b in nsViewManager::DispatchEvent (this=0x11bc23e60, aEvent=0x7fff5fbfdbb0, aView=0x11bbc9100, aStatus=0x7fff5fbfda2c) at /Users/dave/repos/mozilla-central/view/src/nsViewManager.cpp:1001 #42 0x0000000101e75aa3 in HandleEvent (aEvent=0x7fff5fbfdbb0) at /Users/dave/repos/mozilla-central/view/src/nsView.cpp:159 #43 0x00000001028c8bd1 in nsChildView::DispatchEvent (this=0x10031b700, event=0x7fff5fbfdbb0, aStatus=@0x7fff5fbfdb4c) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsChildView.mm:1517 #44 0x00000001028c3a72 in nsChildView::DispatchWindowEvent (this=0x10031b700, event=@0x7fff5fbfdbb0) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsChildView.mm:1527 #45 0x00000001028ce8bb in -[ChildView handleMouseMoved:] (self=0x11bb69e00, _cmd=0x7fff84e1c864, theEvent=0x11acc1ac0) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsChildView.mm:3433 #46 0x00000001028c5549 in ChildViewMouseTracker::MouseMoved (aEvent=0x11acc1ac0) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsChildView.mm:4988 #47 0x00000001028bbd19 in -[BaseWindow mouseMoved:] (self=0x1003928a0, _cmd=0x7fff848d20ae, aEvent=0x11acc1ac0) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsCocoaWindow.mm:2142 #48 0x00007fff842b1833 in -[NSWindow sendEvent:] () #49 0x00000001028b9ef8 in -[ToolbarWindow sendEvent:] (self=0x1003928a0, _cmd=0x7fff848af2c0, anEvent=0x11acc1ac0) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsCocoaWindow.mm:2468 #50 0x00007fff841e6afa in -[NSApplication sendEvent:] () #51 0x00000001028b4d6d in -[GeckoNSApplication sendEvent:] (self=0x1003b3350, _cmd=0x7fff848af2c0, anEvent=0x11acc1ac0) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsAppShell.mm:192 #52 0x00007fff8417d6de in -[NSApplication run] () #53 0x00000001028b5bd2 in nsAppShell::Run (this=0x100304b00) at /Users/dave/repos/mozilla-central/widget/src/cocoa/nsAppShell.mm:771 #54 0x000000010261255b in nsAppStartup::Run (this=0x11963ff60) at /Users/dave/repos/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:228 #55 0x000000010144b951 in XRE_main (argc=3, argv=0x7fff5fbff5d0, aAppData=0x1003059b0) at /Users/dave/repos/mozilla-central/toolkit/xre/nsAppRunner.cpp:3551 #56 0x0000000100001b31 in do_main (exePath=0x7fff5fbff1a0 "/Users/dave/repos/mozilla-central/./objdir-debug/dist/NightlyDebug.app/Contents/MacOS/libxpcom.dylib", argc=3, argv=0x7fff5fbff5d0) at /Users/dave/repos/mozilla-central/browser/app/nsBrowserApp.cpp:198 #57 0x0000000100001d98 in main (argc=3, argv=0x7fff5fbff5d0) at /Users/dave/repos/mozilla-central/browser/app/nsBrowserApp.cpp:281