Closed Bug 92366 Opened 23 years ago Closed 23 years ago

outliner onselect handler is firing twice even though the selection hasn't changed

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.4

People

(Reporter: sspitzer, Assigned: sspitzer)

References

Details

Attachments

(2 files)

hyatt wrote: "The real bug seems to be that the onselect handler is firing twice even though the selection hasn't changed, i.e., it's ok to call select(), but the select method implementation shouldn't be firing ONselect unless the selection actually changed." this blocks #73865
saspitzer: we shouldn't be firing the onselect handler if the selection hasn't changed. vargajan: but that's currently problem, we're trying to get index of row below mouse pointer (getCellAt), but this function retuns two different indexes in mousedown and click handler vargajan: getCellAt() uses top visible index to compute this value, but that row is actually changed
I think Cathleen wanted to track this for performance work. If the folder branch is going to land in 0.9.4, it should probably land early. Would it be possible to look at this one soon?
following pointers from hyatt, I've set a breakpoint at nsOutlinerSelection::FireOnSelectHandler() when clicking on a row in the folder pane, the first time comes from here: nsOutlinerSelection::FireOnSelectHandler() line 681 nsOutlinerSelection::Select(nsOutlinerSelection * const 0x07ca7090, int 9) line 351 XPTC_InvokeByIndex(nsISupports * 0x07ca7090, unsigned int 7, unsigned int 1, nsXPTCVariant * 0x0012d390) line 139 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1882 + 42 bytes XPC_WN_CallMethod(JSContext * 0x04754030, JSObject * 0x03ca49a0, unsigned int 1, long * 0x07592f58, long * 0x0012d5c4) line 1252 + 11 bytes js_Invoke(JSContext * 0x04754030, unsigned int 1, unsigned int 0) line 807 + 23 bytes js_Interpret(JSContext * 0x04754030, long * 0x0012e364) line 2699 + 15 bytes js_Invoke(JSContext * 0x04754030, unsigned int 1, unsigned int 2) line 824 + 13 bytes js_InternalInvoke(JSContext * 0x04754030, JSObject * 0x02e59010, long 67405704, unsigned int 0, unsigned int 1, long * 0x0012e53c, long * 0x0012e48c) line 896 + 20 bytes JS_CallFunctionValue(JSContext * 0x04754030, JSObject * 0x02e59010, long 67405704, unsigned int 1, long * 0x0012e53c, long * 0x0012e48c) line 3349 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x0472cc50, void * 0x02e59010, void * 0x04048788, unsigned int 1, void * 0x0012e53c, int * 0x0012e538, int 0) line 946 + 33 bytes nsJSEventListener::HandleEvent(nsJSEventListener * const 0x08423e50, nsIDOMEvent * 0x083d89d4) line 139 + 57 bytes nsXBLPrototypeHandler::ExecuteHandler(nsXBLPrototypeHandler * const 0x0499b070, nsIDOMEventReceiver * 0x05998fa8, nsIDOMEvent * 0x083d89d4) line 433 DoMouse(nsIAtom * 0x033b36e0, nsIXBLPrototypeHandler * 0x0499b070, nsIDOMEvent * 0x083d89d4, nsIDOMEventReceiver * 0x05998fa8) line 102 nsXBLMouseHandler::MouseDown(nsXBLMouseHandler * const 0x0446d9a0, nsIDOMEvent * 0x083d89d4) line 107 + 40 bytes nsEventListenerManager::HandleEvent(nsEventListenerManager * const 0x06848310, nsIPresContext * 0x04907250, nsEvent * 0x0012f754, nsIDOMEvent * * 0x0012f42c, nsIDOMEventTarget * 0x05998fa8, unsigned int 7, nsEventStatus * 0x0012f648) line 1285 + 41 bytes nsXULElement::HandleDOMEvent(nsXULElement * const 0x05998fa0, nsIPresContext * 0x04907250, nsEvent * 0x0012f754, nsIDOMEvent * * 0x0012f42c, unsigned int 1, nsEventStatus * 0x0012f648) line 3698 PresShell::HandleEventInternal(nsEvent * 0x0012f754, nsIView * 0x0446d5b0, unsigned int 1, nsEventStatus * 0x0012f648) line 5644 + 41 bytes PresShell::HandleEvent(PresShell * const 0x0490e894, nsIView * 0x0446d5b0, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648, int 0, int & 1) line 5565 + 25 bytes nsView::HandleEvent(nsView * const 0x0446d5b0, nsGUIEvent * 0x0012f754, unsigned int 8, nsEventStatus * 0x0012f648, int 0, int & 1) line 377 nsView::HandleEvent(nsView * const 0x04902860, nsGUIEvent * 0x0012f754, unsigned int 28, nsEventStatus * 0x0012f648, int 1, int & 1) line 350 nsViewManager::DispatchEvent(nsViewManager * const 0x04902a00, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648) line 2058 HandleEvent(nsGUIEvent * 0x0012f754) line 68 nsWindow::DispatchEvent(nsWindow * const 0x0446d474, nsGUIEvent * 0x0012f754, nsEventStatus & nsEventStatus_eIgnore) line 721 + 10 bytes nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f754) line 742 nsWindow::DispatchMouseEvent(unsigned int 302, nsPoint * 0x00000000) line 4246 + 21 bytes ChildWindow::DispatchMouseEvent(unsigned int 302, nsPoint * 0x00000000) line 4495 nsWindow::ProcessMessage(unsigned int 513, unsigned int 1, long 11010107, long * 0x0012fb94) line 3205 + 24 bytes nsWindow::WindowProc(HWND__ * 0x000c0428, unsigned int 513, unsigned int 1, long 11010107) line 989 + 27 bytes USER32! 77e13eb0() USER32! 77e1401a() USER32! 77e192da() nsAppShellService::Run(nsAppShellService * const 0x013ce480) line 425 main1(int 4, char * * 0x00484180, nsISupports * 0x00000000) line 1290 + 32 bytes main(int 4, char * * 0x00484180) line 1599 + 37 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 77e87903() the second time comes from here: nsOutlinerSelection::FireOnSelectHandler() line 681 nsOutlinerSelection::ClearSelection(nsOutlinerSelection * const 0x08424710) line 451 XPTC_InvokeByIndex(nsISupports * 0x08424710, unsigned int 12, unsigned int 0, nsXPTCVariant * 0x00129dd4) line 139 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1882 + 42 bytes XPC_WN_CallMethod(JSContext * 0x04754030, JSObject * 0x04048700, unsigned int 0, long * 0x075a4c48, long * 0x0012a008) line 1252 + 11 bytes js_Invoke(JSContext * 0x04754030, unsigned int 0, unsigned int 0) line 807 + 23 bytes js_Interpret(JSContext * 0x04754030, long * 0x0012ada8) line 2699 + 15 bytes js_Invoke(JSContext * 0x04754030, unsigned int 2, unsigned int 2) line 824 + 13 bytes nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJSClass * const 0x07ca7ed0, nsXPCWrappedJS * 0x07ca7340, unsigned short 10, const nsXPTMethodInfo * 0x02e0d61c, nsXPTCMiniVariant * 0x0012b2ec) line 1019 + 21 bytes nsXPCWrappedJS::CallMethod(nsXPCWrappedJS * const 0x07ca7340, unsigned short 10, const nsXPTMethodInfo * 0x02e0d61c, nsXPTCMiniVariant * 0x0012b2ec) line 427 PrepareAndDispatch(nsXPTCStubBase * 0x07ca7340, unsigned int 10, unsigned int * 0x0012b39c, unsigned int * 0x0012b38c) line 100 + 31 bytes SharedStub() line 124 nsMsgMailSession::OnItemEvent(nsMsgMailSession * const 0x04d602d4, nsIFolder * 0x050e47cc, nsIAtom * 0x03409d10) line 298 nsMsgFolder::NotifyFolderEvent(nsMsgFolder * const 0x050e47cc, nsIAtom * 0x03409d10) line 2429 nsMsgLocalMailFolder::UpdateFolder(nsMsgLocalMailFolder * const 0x050e47cc, nsIMsgWindow * 0x07cc21f0) line 601 XPTC_InvokeByIndex(nsISupports * 0x050e47cc, unsigned int 42, unsigned int 1, nsXPTCVariant * 0x0012b5ac) line 139 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1882 + 42 bytes XPC_WN_CallMethod(JSContext * 0x04754030, JSObject * 0x02e59ac0, unsigned int 1, long * 0x075a4a8c, long * 0x0012b7e0) line 1252 + 11 bytes js_Invoke(JSContext * 0x04754030, unsigned int 1, unsigned int 0) line 807 + 23 bytes js_Interpret(JSContext * 0x04754030, long * 0x0012c580) line 2699 + 15 bytes js_Invoke(JSContext * 0x04754030, unsigned int 1, unsigned int 2) line 824 + 13 bytes js_InternalInvoke(JSContext * 0x04754030, JSObject * 0x02e59010, long 63589264, unsigned int 0, unsigned int 1, long * 0x0012c758, long * 0x0012c6a8) line 896 + 20 bytes JS_CallFunctionValue(JSContext * 0x04754030, JSObject * 0x02e59010, long 63589264, unsigned int 1, long * 0x0012c758, long * 0x0012c6a8) line 3349 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x0472cc50, void * 0x02e59010, void * 0x03ca4b90, unsigned int 1, void * 0x0012c758, int * 0x0012c754, int 0) line 946 + 33 bytes nsJSEventListener::HandleEvent(nsJSEventListener * const 0x0684cae0, nsIDOMEvent * 0x0857baf4) line 139 + 57 bytes nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x0684c9b0, nsIDOMEvent * 0x0857baf4, nsIDOMEventTarget * 0x05998fa8, unsigned int 8, unsigned int 7) line 1196 + 20 bytes nsEventListenerManager::HandleEvent(nsEventListenerManager * const 0x06848310, nsIPresContext * 0x04907250, nsEvent * 0x0012d198, nsIDOMEvent * * 0x0012d12c, nsIDOMEventTarget * 0x05998fa8, unsigned int 7, nsEventStatus * 0x0012d1c0) line 1797 + 36 bytes nsXULElement::HandleDOMEvent(nsXULElement * const 0x05998fa0, nsIPresContext * 0x04907250, nsEvent * 0x0012d198, nsIDOMEvent * * 0x0012d12c, unsigned int 1, nsEventStatus * 0x0012d1c0) line 3698 nsOutlinerSelection::FireOnSelectHandler() line 708 nsOutlinerSelection::Select(nsOutlinerSelection * const 0x07ca7090, int 1) line 351 XPTC_InvokeByIndex(nsISupports * 0x07ca7090, unsigned int 7, unsigned int 1, nsXPTCVariant * 0x0012d390) line 139 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1882 + 42 bytes XPC_WN_CallMethod(JSContext * 0x04754030, JSObject * 0x03ca49a0, unsigned int 1, long * 0x075a4908, long * 0x0012d5c4) line 1252 + 11 bytes js_Invoke(JSContext * 0x04754030, unsigned int 1, unsigned int 0) line 807 + 23 bytes js_Interpret(JSContext * 0x04754030, long * 0x0012e364) line 2699 + 15 bytes js_Invoke(JSContext * 0x04754030, unsigned int 1, unsigned int 2) line 824 + 13 bytes js_InternalInvoke(JSContext * 0x04754030, JSObject * 0x02e59010, long 122447280, unsigned int 0, unsigned int 1, long * 0x0012e53c, long * 0x0012e48c) line 896 + 20 bytes JS_CallFunctionValue(JSContext * 0x04754030, JSObject * 0x02e59010, long 122447280, unsigned int 1, long * 0x0012e53c, long * 0x0012e48c) line 3349 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x0472cc50, void * 0x02e59010, void * 0x074c65b0, unsigned int 1, void * 0x0012e53c, int * 0x0012e538, int 0) line 946 + 33 bytes nsJSEventListener::HandleEvent(nsJSEventListener * const 0x0857aaa0, nsIDOMEvent * 0x08578774) line 139 + 57 bytes nsXBLPrototypeHandler::ExecuteHandler(nsXBLPrototypeHandler * const 0x0499b070, nsIDOMEventReceiver * 0x05998fa8, nsIDOMEvent * 0x08578774) line 433 DoMouse(nsIAtom * 0x033b36e0, nsIXBLPrototypeHandler * 0x0499b070, nsIDOMEvent * 0x08578774, nsIDOMEventReceiver * 0x05998fa8) line 102 nsXBLMouseHandler::MouseDown(nsXBLMouseHandler * const 0x0446d9a0, nsIDOMEvent * 0x08578774) line 107 + 40 bytes nsEventListenerManager::HandleEvent(nsEventListenerManager * const 0x06848310, nsIPresContext * 0x04907250, nsEvent * 0x0012f754, nsIDOMEvent * * 0x0012f42c, nsIDOMEventTarget * 0x05998fa8, unsigned int 7, nsEventStatus * 0x0012f648) line 1285 + 41 bytes nsXULElement::HandleDOMEvent(nsXULElement * const 0x05998fa0, nsIPresContext * 0x04907250, nsEvent * 0x0012f754, nsIDOMEvent * * 0x0012f42c, unsigned int 1, nsEventStatus * 0x0012f648) line 3698 PresShell::HandleEventInternal(nsEvent * 0x0012f754, nsIView * 0x0446d5b0, unsigned int 1, nsEventStatus * 0x0012f648) line 5644 + 41 bytes PresShell::HandleEvent(PresShell * const 0x0490e894, nsIView * 0x0446d5b0, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648, int 0, int & 1) line 5565 + 25 bytes nsView::HandleEvent(nsView * const 0x0446d5b0, nsGUIEvent * 0x0012f754, unsigned int 8, nsEventStatus * 0x0012f648, int 0, int & 1) line 377 nsView::HandleEvent(nsView * const 0x04902860, nsGUIEvent * 0x0012f754, unsigned int 28, nsEventStatus * 0x0012f648, int 1, int & 1) line 350 nsViewManager::DispatchEvent(nsViewManager * const 0x04902a00, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648) line 2058 HandleEvent(nsGUIEvent * 0x0012f754) line 68 nsWindow::DispatchEvent(nsWindow * const 0x0446d474, nsGUIEvent * 0x0012f754, nsEventStatus & nsEventStatus_eIgnore) line 721 + 10 bytes nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f754) line 742 nsWindow::DispatchMouseEvent(unsigned int 302, nsPoint * 0x00000000) line 4246 + 21 bytes ChildWindow::DispatchMouseEvent(unsigned int 302, nsPoint * 0x00000000) line 4495 nsWindow::ProcessMessage(unsigned int 513, unsigned int 1, long 1572903, long * 0x0012fb94) line 3205 + 24 bytes nsWindow::WindowProc(HWND__ * 0x000c0428, unsigned int 513, unsigned int 1, long 1572903) line 989 + 27 bytes USER32! 77e13eb0() USER32! 77e1401a() USER32! 77e192da() nsAppShellService::Run(nsAppShellService * const 0x013ce480) line 425 main1(int 4, char * * 0x00484180, nsISupports * 0x00000000) line 1290 + 32 bytes main(int 4, char * * 0x00484180) line 1599 + 37 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 77e87903()
hmm, actually that second time could be the thread pane.
ok, ignore that last comment. when the problem happens, here are the two calls to FireOnSelectHandler() the first from nsXBLMouseHandler::MouseClick the second from nsXBLMouseHandler::MouseDown() nsOutlinerSelection::FireOnSelectHandler() line 681 nsOutlinerSelection::Select(nsOutlinerSelection * const 0x04c920e0, int 30) line 351 XPTC_InvokeByIndex(nsISupports * 0x04c920e0, unsigned int 7, unsigned int 1, nsXPTCVariant * 0x0012d14c) line 139 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1882 + 42 bytes XPC_WN_CallMethod(JSContext * 0x033031e0, JSObject * 0x03e9d0f8, unsigned int 1, long * 0x03f899c4, long * 0x0012d380) line 1252 + 11 bytes js_Invoke(JSContext * 0x033031e0, unsigned int 1, unsigned int 0) line 807 + 23 bytes js_Interpret(JSContext * 0x033031e0, long * 0x0012e120) line 2699 + 15 bytes js_Invoke(JSContext * 0x033031e0, unsigned int 1, unsigned int 2) line 824 + 13 bytes js_InternalInvoke(JSContext * 0x033031e0, JSObject * 0x03db9cc8, long 67004056, unsigned int 0, unsigned int 1, long * 0x0012e2f8, long * 0x0012e248) line 896 + 20 bytes JS_CallFunctionValue(JSContext * 0x033031e0, JSObject * 0x03db9cc8, long 67004056, unsigned int 1, long * 0x0012e2f8, long * 0x0012e248) line 3349 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x03303390, void * 0x03db9cc8, void * 0x03fe6698, unsigned int 1, void * 0x0012e2f8, int * 0x0012e2f4, int 0) line 946 + 33 bytes nsJSEventListener::HandleEvent(nsJSEventListener * const 0x06880040, nsIDOMEvent * 0x06876f04) line 139 + 57 bytes nsXBLPrototypeHandler::ExecuteHandler(nsXBLPrototypeHandler * const 0x04a83910, nsIDOMEventReceiver * 0x03a06cb8, nsIDOMEvent * 0x06876f04) line 433 DoMouse(nsIAtom * 0x032a3700, nsIXBLPrototypeHandler * 0x04a83910, nsIDOMEvent * 0x06876f04, nsIDOMEventReceiver * 0x03a06cb8) line 102 nsXBLMouseHandler::MouseClick(nsXBLMouseHandler * const 0x04a83500, nsIDOMEvent * 0x06876f04) line 117 + 40 bytes nsEventListenerManager::HandleEvent(nsEventListenerManager * const 0x0442ffc0, nsIPresContext * 0x03309d10, nsEvent * 0x0012f2dc, nsIDOMEvent * * 0x0012f1e8, nsIDOMEventTarget * 0x03a06cb8, unsigned int 7, nsEventStatus * 0x0012f648) line 1295 + 41 bytes nsXULElement::HandleDOMEvent(nsXULElement * const 0x03a06cb0, nsIPresContext * 0x03309d10, nsEvent * 0x0012f2dc, nsIDOMEvent * * 0x0012f1e8, unsigned int 1, nsEventStatus * 0x0012f648) line 3698 PresShell::HandleEventInternal(nsEvent * 0x0012f2dc, nsIView * 0x00000000, unsigned int 1, nsEventStatus * 0x0012f648) line 5638 + 47 bytes PresShell::HandleEventWithTarget(PresShell * const 0x0330ad30, nsEvent * 0x0012f2dc, nsIFrame * 0x03d87848, nsIContent * 0x03a06cb0, unsigned int 1, nsEventStatus * 0x0012f648) line 5611 + 22 bytes nsEventStateManager::CheckForAndDispatchClick(nsEventStateManager * const 0x03936e80, nsIPresContext * 0x03309d10, nsMouseEvent * 0x0012f754, nsEventStatus * 0x0012f648) line 2465 + 61 bytes nsEventStateManager::PostHandleEvent(nsEventStateManager * const 0x03936e88, nsIPresContext * 0x03309d10, nsEvent * 0x0012f754, nsIFrame * 0x03d87848, nsEventStatus * 0x0012f648, nsIView * 0x04a85e80) line 1550 + 28 bytes PresShell::HandleEventInternal(nsEvent * 0x0012f754, nsIView * 0x04a85e80, unsigned int 1, nsEventStatus * 0x0012f648) line 5658 + 43 bytes PresShell::HandleEvent(PresShell * const 0x0330ad34, nsIView * 0x04a85e80, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648, int 0, int & 1) line 5565 + 25 bytes nsView::HandleEvent(nsView * const 0x04a85e80, nsGUIEvent * 0x0012f754, unsigned int 8, nsEventStatus * 0x0012f648, int 0, int & 1) line 377 nsView::HandleEvent(nsView * const 0x03309490, nsGUIEvent * 0x0012f754, unsigned int 28, nsEventStatus * 0x0012f648, int 1, int & 1) line 350 nsViewManager::DispatchEvent(nsViewManager * const 0x03309630, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648) line 2058 HandleEvent(nsGUIEvent * 0x0012f754) line 68 nsWindow::DispatchEvent(nsWindow * const 0x04a85d44, nsGUIEvent * 0x0012f754, nsEventStatus & nsEventStatus_eIgnore) line 721 + 10 bytes nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f754) line 742 nsWindow::DispatchMouseEvent(unsigned int 301, nsPoint * 0x00000000) line 4246 + 21 bytes ChildWindow::DispatchMouseEvent(unsigned int 301, nsPoint * 0x00000000) line 4495 nsWindow::ProcessMessage(unsigned int 514, unsigned int 0, long 13500594, long * 0x0012fb94) line 3210 + 24 bytes nsWindow::WindowProc(HWND__ * 0x001a023a, unsigned int 514, unsigned int 0, long 13500594) line 989 + 27 bytes USER32! 77e13eb0() USER32! 77e1401a() USER32! 77e192da() nsAppShellService::Run(nsAppShellService * const 0x0112dec0) line 425 main1(int 4, char * * 0x00485f10, nsISupports * 0x00000000) line 1290 + 32 bytes main(int 4, char * * 0x00485f10) line 1599 + 37 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 77e87903() nsOutlinerSelection::FireOnSelectHandler() line 681 nsOutlinerSelection::Select(nsOutlinerSelection * const 0x04c920e0, int 34) line 351 XPTC_InvokeByIndex(nsISupports * 0x04c920e0, unsigned int 7, unsigned int 1, nsXPTCVariant * 0x0012d390) line 139 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1882 + 42 bytes XPC_WN_CallMethod(JSContext * 0x033031e0, JSObject * 0x03e9d0f8, unsigned int 1, long * 0x03f899c0, long * 0x0012d5c4) line 1252 + 11 bytes js_Invoke(JSContext * 0x033031e0, unsigned int 1, unsigned int 0) line 807 + 23 bytes js_Interpret(JSContext * 0x033031e0, long * 0x0012e364) line 2699 + 15 bytes js_Invoke(JSContext * 0x033031e0, unsigned int 1, unsigned int 2) line 824 + 13 bytes js_InternalInvoke(JSContext * 0x033031e0, JSObject * 0x03db9cc8, long 66576752, unsigned int 0, unsigned int 1, long * 0x0012e53c, long * 0x0012e48c) line 896 + 20 bytes JS_CallFunctionValue(JSContext * 0x033031e0, JSObject * 0x03db9cc8, long 66576752, unsigned int 1, long * 0x0012e53c, long * 0x0012e48c) line 3349 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x03303390, void * 0x03db9cc8, void * 0x03f7e170, unsigned int 1, void * 0x0012e53c, int * 0x0012e538, int 0) line 946 + 33 bytes nsJSEventListener::HandleEvent(nsJSEventListener * const 0x06464ca0, nsIDOMEvent * 0x06463084) line 139 + 57 bytes nsXBLPrototypeHandler::ExecuteHandler(nsXBLPrototypeHandler * const 0x04a839b0, nsIDOMEventReceiver * 0x03a06cb8, nsIDOMEvent * 0x06463084) line 433 DoMouse(nsIAtom * 0x032a35e0, nsIXBLPrototypeHandler * 0x04a839b0, nsIDOMEvent * 0x06463084, nsIDOMEventReceiver * 0x03a06cb8) line 102 nsXBLMouseHandler::MouseDown(nsXBLMouseHandler * const 0x04a83620, nsIDOMEvent * 0x06463084) line 107 + 40 bytes nsEventListenerManager::HandleEvent(nsEventListenerManager * const 0x0442ffc0, nsIPresContext * 0x03309d10, nsEvent * 0x0012f754, nsIDOMEvent * * 0x0012f42c, nsIDOMEventTarget * 0x03a06cb8, unsigned int 7, nsEventStatus * 0x0012f648) line 1285 + 41 bytes nsXULElement::HandleDOMEvent(nsXULElement * const 0x03a06cb0, nsIPresContext * 0x03309d10, nsEvent * 0x0012f754, nsIDOMEvent * * 0x0012f42c, unsigned int 1, nsEventStatus * 0x0012f648) line 3698 PresShell::HandleEventInternal(nsEvent * 0x0012f754, nsIView * 0x04a85e80, unsigned int 1, nsEventStatus * 0x0012f648) line 5644 + 41 bytes PresShell::HandleEvent(PresShell * const 0x0330ad34, nsIView * 0x04a85e80, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648, int 0, int & 1) line 5565 + 25 bytes nsView::HandleEvent(nsView * const 0x04a85e80, nsGUIEvent * 0x0012f754, unsigned int 8, nsEventStatus * 0x0012f648, int 0, int & 1) line 377 nsView::HandleEvent(nsView * const 0x03309490, nsGUIEvent * 0x0012f754, unsigned int 28, nsEventStatus * 0x0012f648, int 1, int & 1) line 350 nsViewManager::DispatchEvent(nsViewManager * const 0x03309630, nsGUIEvent * 0x0012f754, nsEventStatus * 0x0012f648) line 2058 HandleEvent(nsGUIEvent * 0x0012f754) line 68 nsWindow::DispatchEvent(nsWindow * const 0x04a85d44, nsGUIEvent * 0x0012f754, nsEventStatus & nsEventStatus_eIgnore) line 721 + 10 bytes nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f754) line 742 nsWindow::DispatchMouseEvent(unsigned int 302, nsPoint * 0x00000000) line 4246 + 21 bytes ChildWindow::DispatchMouseEvent(unsigned int 302, nsPoint * 0x00000000) line 4495 nsWindow::ProcessMessage(unsigned int 513, unsigned int 1, long 13500594, long * 0x0012fb94) line 3205 + 24 bytes nsWindow::WindowProc(HWND__ * 0x001a023a, unsigned int 513, unsigned int 1, long 13500594) line 989 + 27 bytes USER32! 77e13eb0() USER32! 77e1401a() USER32! 77e192da() nsAppShellService::Run(nsAppShellService * const 0x0112dec0) line 425 main1(int 4, char * * 0x00485f10, nsISupports * 0x00000000) line 1290 + 32 bytes main(int 4, char * * 0x00485f10) line 1599 + 37 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 77e87903()
>Index: nsOutlinerBodyFrame.cpp >=================================================================== >RCS file: >/cvsroot/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp,v >retrieving revision 1.55 >diff -u -r1.55 nsOutlinerBodyFrame.cpp >--- nsOutlinerBodyFrame.cpp 2001/07/17 01:14:40 1.55 >+++ nsOutlinerBodyFrame.cpp 2001/07/17 11:47:07 >@@ -395,17 +395,13 @@ > } > > if (mView && mRowHeight && aReflowState.reason == eReflowReason_Resize) { >- mInnerBox = GetInnerBox(); >- mPageCount = mInnerBox.height / mRowHeight; >+ InvalidateScrollbar(); > > PRInt32 rowCount; > mView->GetRowCount(&rowCount); >- PRInt32 lastPageTopRow = rowCount - mPageCount; >- if (mTopRowIndex >= lastPageTopRow) >- ScrollToRow(lastPageTopRow); >- >- InvalidateScrollbar(); >- SetVisibleScrollbar((rowCount >= mPageCount)); >+ nsRect innerBox = GetInnerBox(); >+ PRInt32 pageCount = innerBox.height / mRowHeight; >+ SetVisibleScrollbar((rowCount >= pageCount)); > } This is the main fix. Explanation of the problem: select() method, which fires SelectionChanged() (only if selection really changed) is called from "mousedown" and then from "click" event handler. Both event handlers call getCellAt() to get index of corresponding row. We're recomputing mInnerBox (used by getCellAt) and mPageCount in Reflow() method. But mousedown is fired before reflow() and click after reflow(). Therefore we get two different row indexes. The second one is incorrect. And Seth found out that mCurrentIndex changes between mousedown and click. > > return nsLeafBoxFrame::Reflow(aPresContext, aReflowMetrics, aReflowState, >aStatus); >@@ -2205,6 +2200,10 @@ > if (!mView) > return NS_OK; > >+ NS_ASSERTION (aRow >= 0, "can't scroll to negative index" ); >+ if (aRow < 0) >+ return NS_OK; > Assertion to detect bad callers of ScrollInternal() > PRInt32 rowCount; > mView->GetRowCount(&rowCount); > >@@ -2259,6 +2258,8 @@ > > nscoord oldrow = aOldIndex/rh; > nscoord newrow = aNewIndex/rh; >+ if (newrow < 0) >+ newrow = 0; If aNewIndex is negative in PositionChanged(PRInt32 aOldIndex, PRInt32& aNewIndex) just scroll to first row (0). This fixes problem pointed out on http://bugzilla.mozilla.org/showattachment.cgi?attach_id=42502 This was not visible before because there was another positive ScrollToRow() in Reflow() method. > > if (oldrow != newrow) > ScrollInternal(newrow);
Target Milestone: --- → mozilla0.9.4
hyatt, any progress? :-)
hyatt sat down with me and described what he wants to do. he wants to add a new property (say _lastSelectedRow or something) that we store off on mousedown. if on click, if the row has changed, return early and don't fire the second on click handler. I'm testing a patch now.
Assignee: hyatt → sspitzer
OS: Windows 2000 → All
Hardware: PC → All
one reason he didn't want to go with jan's approach was side effects. hyatt thinks that patch would have problems when the outliner changed size.
Status: NEW → ASSIGNED
Attached patch fix (deleted) — Splinter Review
whoops, bad patch. that patch breaks multiple select. new one coming.
The last patch works great. Thanks Seth, hyatt r=me
you removed the button == 0 check... is that because it was redundant?
hyatt, yes I removed the button == 0 because we already do that at the beginning of the implementation for the click handler. see http://lxr.mozilla.org/mozilla/source/xpfe/global/resources/content/bindings/outliner.xml#457
sr=hyatt
fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
May God have mercy on us all. The 212 bug spam-o-rama is Now!
QA Contact: aegis → jrgm
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: