Right click option on bookmark menu not behaving properly

VERIFIED FIXED in Firefox 34

Status

()

defect
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: anushbmx, Assigned: mconley)

Tracking

(Blocks 1 bug, {regression})

Trunk
Firefox 34
x86_64
Linux
Points:
---
Dependency tree / graph
Bug Flags:
firefox-backlog +

Firefox Tracking Flags

(firefox29 wontfix, firefox30+ wontfix, firefox31+ wontfix, firefox32- affected, firefox33- affected, firefox34 verified)

Details

Attachments

(2 attachments)

Reporter

Description

5 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release)
Build ID: 20140427195542

Steps to reproduce:

Click the bookmark list icon, the drop down appears.

Now right click on any of the bookmark and try to choose any option in the right click menu.


Actual results:

Right click menu on book mark list doesn't behave properly, 
The menu appears but when hovered over right click menu the "hover style that is the color change that informs its hovered" keeps on blinking


Expected results:

The right click menu should work as the right click menu works in other places.

Taking a screen shot wasn't possible, so took a photo of the screen.
Reporter

Comment 1

5 years ago
Confirming on latest Nightly, build ID: 20140504030205.
Status: UNCONFIRMED → NEW
Component: Untriaged → Bookmarks & History
Ever confirmed: true
Version: 29 Branch → Trunk
let's assume it's a regression, having a range would be nice, sounds like either graphics or widgets...

Comment 4

5 years ago
Regression window(m-c)
Good:
https://hg.mozilla.org/mozilla-central/rev/ff96e428da76
Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0 ID:20140307035057
Bad:
https://hg.mozilla.org/mozilla-central/rev/0dc1be930880
Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0 ID:20140307040757
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ff96e428da76&tochange=0dc1be930880

Regression window(fx)
Good:
https://hg.mozilla.org/integration/fx-team/rev/4652f1cda834
Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0 ID:20140306141346
Bad:
https://hg.mozilla.org/integration/fx-team/rev/8187e4139690
Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0 ID:20140306141547
Pushlog:
http://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=4652f1cda834&tochange=8187e4139690

Regressed by:
8187e4139690	Mike Conley — Bug 975808 - [Australis] When hovering over disabled 'Bookmark this site' button the 'Bookmark menu' button gets hovering state set in Linux theme. r=jaws.
FX29 is clearly a wontfix at this point.
Flags: firefox-backlog?
mike, any idea?
Flags: needinfo?(mconley)
Flags: firefox-backlog?
Flags: firefox-backlog+
firefox30 is again wontfix :(
Yeah, something fishy is going on here... not exactly sure what, but I'll take a peek when I have a moment.
Mike, 31 is going to move to beta next Monday. Could you find time to look at it? Thanks
No update on this for a month, we won't block the release because of this bug. Untracking
Clearly we've been kicking the can here - I don't think there's much value in tracking this further.

Mike, I know you're busy with e10s stuff, but if you could take a quick look that would be great - it's a bit embarrassing that we let this slide for so long.
(In reply to :Gavin Sharp [email: gavin@gavinsharp.com] from comment #11)
> Clearly we've been kicking the can here - I don't think there's much value
> in tracking this further.
> 
> Mike, I know you're busy with e10s stuff, but if you could take a quick look
> that would be great - it's a bit embarrassing that we let this slide for so
> long.

Guh, sorry - this slipped off the radar. :/

Yeah, I'll take a look.
Assignee: nobody → mconley
This bug is caused by this rule:

:-moz-any(#TabsToolbar, #nav-bar) .toolbarbutton-1:not([disabled=true]):hover > .toolbarbutton-menubutton-button > .toolbarbutton-icon,

at:

http://hg.mozilla.org/mozilla-central/file/08c23f12a43e/browser/themes/linux/browser.css#l589

Investigating why now...
Flags: needinfo?(mconley)
The flashing is occurring because _moz-menuactive is being set on the menuitem we're hovering, and then immediately removed.

Diving into XUL now...
So here's the backtrace for where we're dispatching the runnable to remove the _moz-menuactive attribute:

#0  nsMenuFrame::SelectMenu (this=0x8ea1c430, aActivateFlag=false) at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuFrame.cpp:636
#1  0xb2256ba0 in nsMenuPopupFrame::ChangeMenuItem (this=0x99aa9bf8, aMenuItem=0x0, aSelectFirstItem=false) at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuPopupFrame.cpp:1633
#2  0xb224de66 in nsMenuFrame::HandleEvent (this=0x8ea1c430, aPresContext=0x9cfc5400, aEvent=0x98a397d0, aEventStatus=0xbf86b89c) at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuFrame.cpp:480
#3  0xb1340f84 in mozilla::ESMEventCB::HandleEvent (this=0xbf86b934, aVisitor=...) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3552
#4  0xb13631d8 in mozilla::EventTargetChainItem::HandleEventTargetChain (aChain=..., aVisitor=..., aCallback=0xbf86b934, aCd=...)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventDispatcher.cpp:335
#5  0xb13642f6 in mozilla::EventDispatcher::Dispatch (aTarget=0x9c198790, aPresContext=0x9cfc5400, aEvent=0x98a397d0, aDOMEvent=0x0, aEventStatus=0xbf86b920, aCallback=0xbf86b934, aTargets=0x0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventDispatcher.cpp:606
#6  0xb13391f4 in mozilla::EventStateManager::DispatchMouseOrPointerEvent (this=0xa60e15e0, aMouseEvent=0xbf86bef0, aMessage=332, aTargetContent=0x9c198790, aRelatedContent=0x0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3660
#7  0xb13395cc in mozilla::EventStateManager::NotifyMouseOut (this=0xa60e15e0, aMouseEvent=0xbf86bef0, aMovingInto=0x0) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3803
#8  0xb133a0c5 in mozilla::EventStateManager::GenerateMouseEnterExit (this=0xa60e15e0, aMouseEvent=0xbf86bef0) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:4052
#9  0xb13305e3 in mozilla::EventStateManager::PreHandleEvent (this=0xa60e15e0, aPresContext=0x9cfc5400, aEvent=0xbf86bef0, aTargetFrame=0x99aa9bf8, aStatus=0xbf86be10)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:594
#10 0xb1fbf812 in PresShell::HandleEventInternal (this=0x9cf40e00, aEvent=0xbf86bef0, aStatus=0xbf86be10) at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7753
#11 0xb1fbea9a in PresShell::HandlePositionedEvent (this=0x9cf40e00, aTargetFrame=0x99aa9bf8, aEvent=0xbf86bef0, aEventStatus=0xbf86be10)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7505
#12 0xb1fbe0ef in PresShell::HandleEvent (this=0x9cf40e00, aFrame=0x99aa9bf8, aEvent=0xbf86bef0, aDontRetargetEvents=false, aEventStatus=0xbf86be10)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7305
#13 0xb177128d in nsViewManager::DispatchEvent (this=0x9def1b50, aEvent=0xbf86bef0, aView=0x99aa8970, aStatus=0xbf86be10) at /media/Projects/mozilla/mozilla-central/view/src/nsViewManager.cpp:775
#14 0xb176eaac in nsView::HandleEvent (this=0x99aa8970, aEvent=0xbf86bef0, aUseAttachedEvents=false) at /media/Projects/mozilla/mozilla-central/view/src/nsView.cpp:1097
#15 0xb17bac39 in nsWindow::DispatchEvent (this=0x8e69f200, aEvent=0xbf86bef0, aStatus=@0xbf86beec: nsEventStatus_eIgnore) at /media/Projects/mozilla/mozilla-central/widget/gtk/nsWindow.cpp:478
#16 0xb17bf811 in nsWindow::OnLeaveNotifyEvent (this=0x8e69f200, aEvent=0x98827da0) at /media/Projects/mozilla/mozilla-central/widget/gtk/nsWindow.cpp:2496
#17 0xb17c63cb in leave_notify_event_cb (widget=0x8ea852f8, event=0x98827da0) at /media/Projects/mozilla/mozilla-central/widget/gtk/nsWindow.cpp:5266
#18 0xaed5debe in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#19 0xaf1b8a7e in g_closure_invoke () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#20 0xaf1cb029 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#21 0xaf1d268f in g_signal_emit_valist () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#22 0xaf1d2bf3 in g_signal_emit () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#23 0xaee8aa53 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#24 0xaed5c860 in gtk_main_do_event () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#25 0xae944188 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#26 0xaf0e61e3 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#27 0xaf0e6468 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#28 0xaf0e6528 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#29 0xb17b3dbc in nsAppShell::ProcessNextNativeEvent (this=0xa864c0b0, mayWait=false) at /media/Projects/mozilla/mozilla-central/widget/gtk/nsAppShell.cpp:156
#30 0xb178ad5e in nsBaseAppShell::DoProcessNextNativeEvent (this=0xa864c0b0, mayWait=false, recursionDepth=0) at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:140
#31 0xb178b10f in nsBaseAppShell::OnProcessNextEvent (this=0xa864c0b0, thr=0xad542b00, mayWait=false, recursionDepth=0) at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:280
#32 0xaf8ea224 in nsThread::ProcessNextEvent (this=0xad542b00, aMayWait=false, aResult=0xbf86c53f) at /media/Projects/mozilla/mozilla-central/xpcom/threads/nsThread.cpp:741
#33 0xaf91f97a in NS_ProcessNextEvent (aThread=0xad542b00, aMayWait=false) at /media/Projects/mozilla/mozilla-central/xpcom/glue/nsThreadUtils.cpp:265
#34 0xafdb3918 in mozilla::ipc::MessagePump::Run (this=0xad53ea00, aDelegate=0xb7219b40) at /media/Projects/mozilla/mozilla-central/ipc/glue/MessagePump.cpp:99
#35 0xafd56bc4 in MessageLoop::RunInternal (this=0xb7219b40) at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:229
#36 0xafd56b4f in MessageLoop::RunHandler (this=0xb7219b40) at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:222
#37 0xafd56af3 in MessageLoop::Run (this=0xb7219b40) at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:196
#38 0xb178ae09 in nsBaseAppShell::Run (this=0xa864c0b0) at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:164
#39 0xb288cc1e in nsAppStartup::Run (this=0xa862a160) at /media/Projects/mozilla/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:278
#40 0xb2904f70 in XREMain::XRE_mainRun (this=0xbf86c840) at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4013
#41 0xb29052a8 in XREMain::XRE_main (this=0xbf86c840, argc=4, argv=0xbf86db64, aAppData=0xbf86c9a0) at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4084
#42 0xb290550a in XRE_main (argc=4, argv=0xbf86db64, aAppData=0xbf86c9a0, aFlags=0) at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4298



What's kinda weird about this, is that GTK is telling us that we've "left the window" that we're hovering with the mouse, even though the mouse is very much inside of it. From the way I understand it, it thinks we're leaving the context menu, and hovering the menu underneath it.

If we go outside of the bounds of the popup _behind_ the context menu, everything starts working properly again. But if we exit the bounds of the context menu, and re-enter from within the bounds of the popup behind the context menu, the problem recurs.

Here's a screencast illustrating the issue: http://www.screencast.com/t/6hEOHcTRorL3 (I've made the :hover rule on the bookmark button more dramatic by colouring it red).

Note that getting rid of the :hover on the rule I mentioned in comment 13 eliminates the issue (though that, unfortunately, causes the bookmark star to appear constantly hovered).

karlt or Enn - do you know what might be happening here? This seems like it might be a XUL or GTK thing...
Flags: needinfo?(karlt)
Flags: needinfo?(enndeakin)
(In reply to Mike Conley (:mconley) from comment #15)
> What's kinda weird about this, is that GTK is telling us that we've "left
> the window" that we're hovering with the mouse, even though the mouse is
> very much inside of it. From the way I understand it, it thinks we're
> leaving the context menu, and hovering the menu underneath it.

I'm not observing this behavior.
If I put NSPR_LOG_MODULES=Widget:5 in the environment of a debug build,
the OnEnterNotify and OnLeaveNotify are logged with the expected windows.

> If we go outside of the bounds of the popup _behind_ the context menu,
> everything starts working properly again.

There are no GTK enter/leave notifications logged while doing this, so I don't have any evidence that this is a GTK problem.

I would check the pointer motion events next.  It seems something is mapping them to the wrong window.  I don't know whether that is GTK or something else.

(In reply to Mike Conley (:mconley) from comment #13)
> This bug is caused by this rule:
> 
> :-moz-any(#TabsToolbar, #nav-bar)
> .toolbarbutton-1:not([disabled=true]):hover >
> .toolbarbutton-menubutton-button > .toolbarbutton-icon,
> 
> at:
> 
> http://hg.mozilla.org/mozilla-central/file/08c23f12a43e/browser/themes/linux/
> browser.css#l589

I don't know how that can be related.  Triggering a reflow, perhaps?
Flags: needinfo?(karlt)
Hrm. So you're not hitting leave_notify_event_cb when you mouse around in that context menu like I am in the trace in comment 15?
Flags: needinfo?(karlt)
(In reply to Mike Conley (:mconley) from comment #17)
> So you're not hitting leave_notify_event_cb when you mouse around in
> that context menu like I am in the trace in comment 15?

That is correct.  I only have leave_notify_event_cb called when leaving the context menu (and then subsequently when leaving other windows), but I do reproduce this bug.
Flags: needinfo?(karlt)
Ah, yes - I wasn't properly disabling mouse capture for my VM, so when I moused over to my gdb in my host machine, that was causing the leave_notify_event_cb.

I gdb'd in via a separate machine, and this is the stack for deactivating the menu item now:

#0  nsMenuFrame::SelectMenu (this=0xa0d86b38, aActivateFlag=false)
    at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuFrame.cpp:597
#1  0xb21fbba0 in nsMenuPopupFrame::ChangeMenuItem (this=0x98babbf8, aMenuItem=0x0, aSelectFirstItem=false)
    at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuPopupFrame.cpp:1633
#2  0xb21f2e66 in nsMenuFrame::HandleEvent (this=0xa0d86b38, aPresContext=0xa6db0800, aEvent=0x942d73e0,
    aEventStatus=0xbfc61bfc) at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuFrame.cpp:480
#3  0xb12e5f84 in mozilla::ESMEventCB::HandleEvent (this=0xbfc61c94, aVisitor=...)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3552
#4  0xb13081d8 in mozilla::EventTargetChainItem::HandleEventTargetChain (aChain=..., aVisitor=...,
    aCallback=0xbfc61c94, aCd=...) at /media/Projects/mozilla/mozilla-central/dom/events/EventDispatcher.cpp:335
#5  0xb13092f6 in mozilla::EventDispatcher::Dispatch (aTarget=0x9c2a4b00, aPresContext=0xa6db0800, aEvent=
    0x942d73e0, aDOMEvent=0x0, aEventStatus=0xbfc61c80, aCallback=0xbfc61c94, aTargets=0x0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventDispatcher.cpp:606
#6  0xb12de1f4 in mozilla::EventStateManager::DispatchMouseOrPointerEvent (this=0x9d043690,
    aMouseEvent=0xbfc6231c, aMessage=332, aTargetContent=0x9c2a4b00, aRelatedContent=0x9c2a4ab0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3660
#7  0xb12de5cc in mozilla::EventStateManager::NotifyMouseOut (this=0x9d043690, aMouseEvent=0xbfc6231c,
    aMovingInto=0x9c2a4ab0) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3803
#8  0xb12de871 in mozilla::EventStateManager::NotifyMouseOver (this=0x9d043690, aMouseEvent=0xbfc6231c,
    aContent=0x9c2a4ab0) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3861
#9  0xb12def2d in mozilla::EventStateManager::GenerateMouseEnterExit (this=0x9d043690, aMouseEvent=0xbfc6231c)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:4009
#10 0xb12d5655 in mozilla::EventStateManager::PreHandleEvent (this=0x9d043690, aPresContext=0xa6db0800,
    aEvent=0xbfc6231c, aTargetFrame=0xa0d865c0, aStatus=0xbfc62200)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:610
#11 0xb1f64812 in PresShell::HandleEventInternal (this=0x9d018340, aEvent=0xbfc6231c, aStatus=0xbfc62200)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7753
#12 0xb1f63a9a in PresShell::HandlePositionedEvent (this=0x9d018340, aTargetFrame=0xa0d865c0, aEvent=0xbfc6231c,
    aEventStatus=0xbfc62200) at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7505
#13 0xb1f630ef in PresShell::HandleEvent (this=0x9d018340, aFrame=0x98babbf8, aEvent=0xbfc6231c,
    aDontRetargetEvents=false, aEventStatus=0xbfc62200)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7305
#14 0xb171628d in nsViewManager::DispatchEvent (this=0x9dff1be0, aEvent=0xbfc6231c, aView=0x98ba9c90,
    aStatus=0xbfc62200) at /media/Projects/mozilla/mozilla-central/view/src/nsViewManager.cpp:775
#15 0xb1713aac in nsView::HandleEvent (this=0x98ba9c90, aEvent=0xbfc6231c, aUseAttachedEvents=false)
    at /media/Projects/mozilla/mozilla-central/view/src/nsView.cpp:1097
#16 0xb175fc39 in nsWindow::DispatchEvent (this=0x976f2a00, aEvent=0xbfc6231c,
    aStatus=@0xbfc62314: nsEventStatus_eIgnore)
    at /media/Projects/mozilla/mozilla-central/widget/gtk/nsWindow.cpp:478
#17 0xb1764c1e in nsWindow::OnMotionNotifyEvent (this=0x976f2a00, aEvent=0x94513d40)
    at /media/Projects/mozilla/mozilla-central/widget/gtk/nsWindow.cpp:2576
#18 0xb176b478 in motion_notify_event_cb (widget=0x8fd190d0, event=0x94513d40)
    at /media/Projects/mozilla/mozilla-central/widget/gtk/nsWindow.cpp:5297
#19 0xaeceaebe in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#20 0xaf145a7e in g_closure_invoke () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#21 0xaf158029 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#22 0xaf15f68f in g_signal_emit_valist () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#23 0xaf15fbf3 in g_signal_emit () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#24 0xaee17a53 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#25 0xaece9294 in gtk_propagate_event () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#26 0xaece9690 in gtk_main_do_event () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#27 0xae8d1188 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#28 0xaf0731e3 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#29 0xaf073468 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#30 0xaf073528 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#31 0xb1758dbc in nsAppShell::ProcessNextNativeEvent (this=0xa94019c0, mayWait=false)
    at /media/Projects/mozilla/mozilla-central/widget/gtk/nsAppShell.cpp:156
#32 0xb172fd5e in nsBaseAppShell::DoProcessNextNativeEvent (this=0xa94019c0, mayWait=false, recursionDepth=0)
    at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:140
#33 0xb173010f in nsBaseAppShell::OnProcessNextEvent (this=0xa94019c0, thr=0xad542b00, mayWait=false,
    recursionDepth=0) at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:280
#34 0xaf88f224 in nsThread::ProcessNextEvent (this=0xad542b00, aMayWait=false, aResult=0xbfc62a3f)
    at /media/Projects/mozilla/mozilla-central/xpcom/threads/nsThread.cpp:741
#35 0xaf8c497a in NS_ProcessNextEvent (aThread=0xad542b00, aMayWait=false)
    at /media/Projects/mozilla/mozilla-central/xpcom/glue/nsThreadUtils.cpp:265
#36 0xafd58918 in mozilla::ipc::MessagePump::Run (this=0xad53ea90, aDelegate=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/glue/MessagePump.cpp:99
#37 0xafcfbbc4 in MessageLoop::RunInternal (this=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:229
#38 0xafcfbb4f in MessageLoop::RunHandler (this=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:222
#39 0xafcfbaf3 in MessageLoop::Run (this=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:196
#40 0xb172fe09 in nsBaseAppShell::Run (this=0xa94019c0)
    at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:164
#41 0xb2831c1e in nsAppStartup::Run (this=0xa872a1f0)
    at /media/Projects/mozilla/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:278
#42 0xb28a9f70 in XREMain::XRE_mainRun (this=0xbfc62d40)
    at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4013
#43 0xb28aa2a8 in XREMain::XRE_main (this=0xbfc62d40, argc=4, argv=0xbfc64064, aAppData=0xbfc62ea0)
    at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4084
#44 0xb28aa50a in XRE_main (argc=4, argv=0xbfc64064, aAppData=0xbfc62ea0, aFlags=0)
    at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4298
#45 0x0804bbdf in do_main (argc=4, argv=0xbfc64064, xreDirectory=0xb7170480)
    at /media/Projects/mozilla/mozilla-central/browser/app/nsBrowserApp.cpp:282
#46 0x0804c08b in main (argc=4, argv=0xbfc64064)
    at /media/Projects/mozilla/mozilla-central/browser/app/nsBrowserApp.cpp:643
So, karlt, as you suspected, it's a pointer motion event that's causing it. I agree that it seems that they're being dispatched to the wrong window...

Any idea how I could diagnose why that'd be the case?
Flags: needinfo?(karlt)
Hm.. I also see (more frequently) occurrences where we're calling nsMenuFrame::SelectMenu with aActivateFlag set to false because we're reacting to a synthesized mouse event, which (from what I can tell) is caused by reflow:

#0  nsMenuFrame::SelectMenu (this=0xa0d865c0, aActivateFlag=false)
    at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuFrame.cpp:597
#1  0xb21fbba0 in nsMenuPopupFrame::ChangeMenuItem (this=0x98babbf8, aMenuItem=0x0, aSelectFirstItem=false)
    at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuPopupFrame.cpp:1633
#2  0xb21f2e66 in nsMenuFrame::HandleEvent (this=0xa0d865c0, aPresContext=0xa6db0800, aEvent=0x964bddc0,
    aEventStatus=0xbfc61fbc) at /media/Projects/mozilla/mozilla-central/layout/xul/nsMenuFrame.cpp:480
#3  0xb12e5f84 in mozilla::ESMEventCB::HandleEvent (this=0xbfc62054, aVisitor=...)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3552
#4  0xb13081d8 in mozilla::EventTargetChainItem::HandleEventTargetChain (aChain=..., aVisitor=...,
    aCallback=0xbfc62054, aCd=...) at /media/Projects/mozilla/mozilla-central/dom/events/EventDispatcher.cpp:335
#5  0xb13092f6 in mozilla::EventDispatcher::Dispatch (aTarget=0x9c2a4ab0, aPresContext=0xa6db0800,
    aEvent=0x964bddc0, aDOMEvent=0x0, aEventStatus=0xbfc62040, aCallback=0xbfc62054, aTargets=0x0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventDispatcher.cpp:606
#6  0xb12de1f4 in mozilla::EventStateManager::DispatchMouseOrPointerEvent (this=0x9d043690,
    aMouseEvent=0xbfc62650, aMessage=332, aTargetContent=0x9c2a4ab0, aRelatedContent=0x91f347e0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3660
#7  0xb12de5cc in mozilla::EventStateManager::NotifyMouseOut (this=0x9d043690, aMouseEvent=0xbfc62650,
    aMovingInto=0x91f347e0) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3803
#8  0xb12de871 in mozilla::EventStateManager::NotifyMouseOver (this=0x9d043690, aMouseEvent=0xbfc62650,
    aContent=0x91f347e0) at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:3861
#9  0xb12def2d in mozilla::EventStateManager::GenerateMouseEnterExit (this=0x9d043690, aMouseEvent=0xbfc62650)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:4009
#10 0xb12d5655 in mozilla::EventStateManager::PreHandleEvent (this=0x9d043690, aPresContext=0xa6db0800,
    aEvent=0xbfc62650, aTargetFrame=0xa0d87320, aStatus=0xbfc625c0)
    at /media/Projects/mozilla/mozilla-central/dom/events/EventStateManager.cpp:610
#11 0xb1f64812 in PresShell::HandleEventInternal (this=0x9d018340, aEvent=0xbfc62650, aStatus=0xbfc625c0)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7753
#12 0xb1f63a9a in PresShell::HandlePositionedEvent (this=0x9d018340, aTargetFrame=0xa0d87320, aEvent=0xbfc62650,
    aEventStatus=0xbfc625c0) at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7505
#13 0xb1f630ef in PresShell::HandleEvent (this=0x9d018340, aFrame=0x9c2375b8, aEvent=0xbfc62650,
    aDontRetargetEvents=false, aEventStatus=0xbfc625c0)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:7305
#14 0xb171628d in nsViewManager::DispatchEvent (this=0x9dff1be0, aEvent=0xbfc62650, aView=0x945951f0,
    aStatus=0xbfc625c0) at /media/Projects/mozilla/mozilla-central/view/src/nsViewManager.cpp:775
#15 0xb1f58501 in PresShell::DispatchSynthMouseMove (this=0x9d018340, aEvent=0xbfc62650, aFlushOnHoverChange=true)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:3794
#16 0xb1f5da6d in PresShell::ProcessSynthMouseMoveEvent (this=0x9d018340, aFromScroll=false)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.cpp:5673
#17 0xb1f6f837 in PresShell::nsSynthMouseMoveEvent::WillRefresh (this=0x8f6fa260, aTime=...)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsPresShell.h:637
#18 0xb1f78375 in nsRefreshDriver::Tick (this=0xb71f4940, aNowEpoch=1406833731129909, aNowTime=...)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsRefreshDriver.cpp:1119
#19 0xb1f7a496 in mozilla::RefreshDriverTimer::TickDriver (driver=0xb71f4940, jsnow=1406833731129909, now=...)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsRefreshDriver.cpp:171
#20 0xb1f7a3b0 in mozilla::RefreshDriverTimer::Tick (this=0xa6aed980)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsRefreshDriver.cpp:162
#21 0xb1f7a4b3 in mozilla::RefreshDriverTimer::TimerTick (aTimer=0xa6ae6fb0, aClosure=0xa6aed980)
    at /media/Projects/mozilla/mozilla-central/layout/base/nsRefreshDriver.cpp:188
#22 0xaf89705c in nsTimerImpl::Fire (this=0xa6ae6fb0)
    at /media/Projects/mozilla/mozilla-central/xpcom/threads/nsTimerImpl.cpp:618
#23 0xaf8973d7 in nsTimerEvent::Run (this=0xa94fd050)
    at /media/Projects/mozilla/mozilla-central/xpcom/threads/nsTimerImpl.cpp:711
#24 0xaf88f3c0 in nsThread::ProcessNextEvent (this=0xad542b00, aMayWait=false, aResult=0xbfc62a3f)
    at /media/Projects/mozilla/mozilla-central/xpcom/threads/nsThread.cpp:770
#25 0xaf8c497a in NS_ProcessNextEvent (aThread=0xad542b00, aMayWait=false)
    at /media/Projects/mozilla/mozilla-central/xpcom/glue/nsThreadUtils.cpp:265
#26 0xafd58918 in mozilla::ipc::MessagePump::Run (this=0xad53ea90, aDelegate=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/glue/MessagePump.cpp:99
#27 0xafcfbbc4 in MessageLoop::RunInternal (this=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:229
#28 0xafcfbb4f in MessageLoop::RunHandler (this=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:222
#29 0xafcfbaf3 in MessageLoop::Run (this=0xb7119b40)
    at /media/Projects/mozilla/mozilla-central/ipc/chromium/src/base/message_loop.cc:196
#30 0xb172fe09 in nsBaseAppShell::Run (this=0xa94019c0)
    at /media/Projects/mozilla/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:164
#31 0xb2831c1e in nsAppStartup::Run (this=0xa872a1f0)
    at /media/Projects/mozilla/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:278
#32 0xb28a9f70 in XREMain::XRE_mainRun (this=0xbfc62d40)
    at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4013
#33 0xb28aa2a8 in XREMain::XRE_main (this=0xbfc62d40, argc=4, argv=0xbfc64064, aAppData=0xbfc62ea0)
    at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4084
#34 0xb28aa50a in XRE_main (argc=4, argv=0xbfc64064, aAppData=0xbfc62ea0, aFlags=0)
    at /media/Projects/mozilla/mozilla-central/toolkit/xre/nsAppRunner.cpp:4298
#35 0x0804bbdf in do_main (argc=4, argv=0xbfc64064, xreDirectory=0xb7170480)
    at /media/Projects/mozilla/mozilla-central/browser/app/nsBrowserApp.cpp:282
#36 0x0804c08b in main (argc=4, argv=0xbfc64064)
    at /media/Projects/mozilla/mozilla-central/browser/app/nsBrowserApp.cpp:643
Demonstration of reflows while moving mouse in context menu:

http://www.screencast.com/t/OuDO5ClD

And the reflows go away as soon as I exit the bounds of the underlying popup.

Updated

5 years ago
See Also: → 492960
(In reply to Mike Conley (:mconley) from comment #20)
> So, karlt, as you suspected, it's a pointer motion event that's causing it.
> I agree that it seems that they're being dispatched to the wrong window...
> 
> Any idea how I could diagnose why that'd be the case?

You can add logging to OnMotionNotifyEvent, like that in OnLeaveNotifyEvent, to check that widget is dispatching to the correct window, but comment 21 suggests that it might be EventStateManager that is selecting the wrong window/element.
Flags: needinfo?(karlt)

Comment 24

5 years ago
The block which calls nsLayoutUtils::GetPopupFrameForEventCoordinates at http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#7002

is where events are redirected to the right popup. Check here to see what frame is being returned and what is being returned from GetVisiblePopups.

I think a synthetic mousemove occurs when the mouse cursor is changed, and when something is scrolled, although I don't think either of those is happening here.
Flags: needinfo?(enndeakin)
(In reply to Neil Deakin from comment #24)
> The block which calls nsLayoutUtils::GetPopupFrameForEventCoordinates at
> http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.
> cpp#7002
> 
> is where events are redirected to the right popup. Check here to see what
> frame is being returned and what is being returned from GetVisiblePopups.
> 

Hm, we never seem to hit GetPopupFrameForEventCoordinates when I reproduce the problem, nor when I escape the bounds of the rear popup, when the problem goes away. We _do_ hit that code as soon as the mouse touches any area that doesn't have a menupopup underneath it.

> I think a synthetic mousemove occurs when the mouse cursor is changed, and
> when something is scrolled, although I don't think either of those is
> happening here.

Interesting...
Comment on attachment 8466278 [details] [diff] [review]
Context menu in bookmark menu is flickery on Linux. r=?

So this seems to fix the issue.

Notes:

This seems to be related to some deeper layout or presshell bug that I can't seem to wrap my head around. I'm pretty sure the :hover rules that I'm bypassing with :not([open]) are what was causing this, and :hover causes synthetic mousemove events to be fired, and then... things go awry. And I don't exactly know why. :/

My solution was to always show the outline around the bookmarks-menu-button toolbar icon if the button is "open", instead of relying on the :hover state. The only time we rely on the :hover state is when there's no "open" attribute. So that works around the issue.


Caveats:

Like I said, there seem to be deeper layout bugs here. For example, with this patch, open up the bookmarks menu, right click on any bookmark item to open the context menu, and then click somewhere on web content to close the whole thing. Notice that the hover state is still detected on the bookmarks menu button, and will stay there until you hover the bookmarks menu button, or exit the window. WTF.

This isn't unique to the bookmarks menu button though - if you open up the bookmarks toolbar, for example, and right click on an item in the toolbar, and then click web content again to close the context menu, notice that the item you clicked still has a hover state.

I think this layout bug is the root cause of all this flickery-ness, but I don't really have the time to dive into it further. :/ This workaround seems to solve this bug however.
Attachment #8466278 - Flags: review?(jaws)

Comment 28

5 years ago
The problem here is that FindFloatingViewContaining iterates over the views from first to last, which means that order the popup views were created in, which isn't useful. It should be using the order they are displayed in. A variation of nsLayoutUtils::GetPopupFrameForEventCoordinates could be used, but it would need to also handle html:select popups.

Comment 29

5 years ago
In fact, when I change FindFloatingViewContaining to take the last view it finds instead of the first, the bug goes away. Of course, that isn't correct either, since we want to handle the popups properly regardless of where they appear in the source.

I filed bug 1047530 on this issue.
Comment on attachment 8466278 [details] [diff] [review]
Context menu in bookmark menu is flickery on Linux. r=?

Review of attachment 8466278 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me, but not for expedited uplift because I'm not sure what might spill out of this change.
Attachment #8466278 - Flags: review?(jaws) → review+
Thanks jaws,

remote:   https://hg.mozilla.org/integration/fx-team/rev/57aef463817f
Status: NEW → ASSIGNED
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/57aef463817f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
Iteration: --- → 34.2
QA Whiteboard: [qa?]
QA Whiteboard: [qa?] → [qa+]
QA Contact: andrei.vaida
Assignee

Comment 34

5 years ago
bugnotes
Er, whoops. Meant to link to my actual bug notes:

http://people.mozilla.org/~mconley2/bugnotes/bug-1003931.html
Reproduced the initial bug on Nightly 32.0a1 (2014-04-30).
Verified fixed on Nightly 34.0a1 (2014-08-10) using Ubuntu 13.04 32-bit.

Leaving [qa+] in place until this fix lands on Aurora.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.