mouseout/mouseleave event doesn't work properly on the root element in Fission oop iframe
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
(Blocks 1 open bug)
Details
Attachments
(6 files, 1 obsolete file)
Found this in bug 1594989.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
•
|
||
It happens when mouse moves from inner OOP frame to the outer OOP frame, we currently dispatch eMouseExitFromWidget
event with mExitFrom = WidgetMouseEvent::eChild
, we treat it as synthesized mouse, not a really exit, so we think the mouse is still over the root element of the inner OOP frame. What we should do is dispatching a really exit event while moving from inner OOP frame to the outer OOP frame, for example, mExitFrom = WidgetMouseEvent::eTopLevel
, but the naming is a bit confused, I plan to introduce another type, something like eProcess
, and make eTopLevel
is only used in parent process for top-level widget exit.
And we would also need a mechanism to detect the 'direction' of movement, for example, inner to outer, outer to inner, or even for more complicated case: from one leaf to another leaf. And I think we could also fix bug 1646370 here.
Comment hidden (obsolete) |
Assignee | ||
Comment 4•5 years ago
•
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Got an intermittent time out on new added test in test verify mode.
Comment 6•5 years ago
|
||
This is high priority for us to get fixed in M6b.
Assignee | ||
Comment 7•5 years ago
|
||
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget.
- eTopLevelWidget is used only in parent process indicates if the mouse cursor
exits from a top level widget. - eProcessContent is used only in child process indicates if the mouse cursor
exits from the process content rendering area.
And if mExitFrom is Nothing and mMessage is eMouseExitFromWidget, it indicates
that the mouse cursor traverses widget/process boundaries but still in
top-level widget or within the process content area.
Assignee | ||
Comment 8•5 years ago
|
||
This patch also considers the nested OOP iframe case and could also fix bug 1646370.
Depends on D84748
Assignee | ||
Comment 9•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
I spend some time to debug the test-verify timeout on the new added test, the timeout test is to test the mouseleave
event would be fired properly while switching to a new tab/window, the test would do:
- call
window.open()
to open a new window and switch focus to it - wait for
mouseleave
event.
However, window.open() will spin event loop and suppress event handling, the eMouseExitFromWidget event might be discarded if it happens during the spin event loop. We could fix this by adding eMouseExitFromWidget to delayed events. But I still got a timeout with a different case...
Assignee | ||
Comment 12•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #11)
But I still got a timeout with a different case...
Another case is somehow the mLastOverFrame
is nullptr, so we don't try to notify mouseout on subframe.
I could only reproduce on try, but not locally.
Assignee | ||
Comment 13•5 years ago
|
||
Assignee | ||
Comment 14•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #12)
Another case is somehow the
mLastOverFrame
is nullptr, so we don't try to notify mouseout on subframe.
I could only reproduce on try, but not locally.
The mLastOverFrame
is null-ed out because of the focus call on the test iframe while starting the test, it would possibly trigger the pending restyled and clear the WeakFrame, like
task 2020-08-15T23:04:17.535Z] 23:04:17 INFO - GECKO(2453) | #01: mozilla::PresShell::ClearFrameRefs(nsIFrame*) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x46b3148]
[task 2020-08-15T23:04:17.543Z] 23:04:17 INFO - GECKO(2453) | #02: nsIFrame::DestroyFrom(nsIFrame*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x4875faf]
[task 2020-08-15T23:04:17.544Z] 23:04:17 INFO - GECKO(2453) | #03: nsSubDocumentFrame::DestroyFrom(nsIFrame*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x4901d9c]
[task 2020-08-15T23:04:17.544Z] 23:04:17 INFO - GECKO(2453) | #04: nsLineBox::DeleteLineList(nsPresContext*, nsLineList&, nsIFrame*, nsFrameList*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x48de139]
[task 2020-08-15T23:04:17.544Z] 23:04:17 INFO - GECKO(2453) | #05: nsBlockFrame::DestroyFrom(nsIFrame*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x47b8f28]
[task 2020-08-15T23:04:17.547Z] 23:04:17 INFO - GECKO(2453) | #06: nsLineBox::DeleteLineList(nsPresContext*, nsLineList&, nsIFrame*, nsFrameList*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x48de139]
[task 2020-08-15T23:04:17.548Z] 23:04:17 INFO - GECKO(2453) | #07: nsBlockFrame::DestroyFrom(nsIFrame*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x47b8f28]
[task 2020-08-15T23:04:17.558Z] 23:04:17 INFO - GECKO(2453) | #08: nsLineBox::DeleteLineList(nsPresContext*, nsLineList&, nsIFrame*, nsFrameList*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x48de139]
[task 2020-08-15T23:04:17.558Z] 23:04:17 INFO - GECKO(2453) | #09: nsBlockFrame::DestroyFrom(nsIFrame*, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x47b8f28]
[task 2020-08-15T23:04:17.558Z] 23:04:17 INFO - GECKO(2453) | #10: nsBlockFrame::DoRemoveFrameInternal(nsIFrame*, unsigned int, mozilla::layout::PostFrameDestroyData&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x47d64f1]
[task 2020-08-15T23:04:17.565Z] 23:04:17 INFO - GECKO(2453) | #11: nsBlockFrame::RemoveFrame(mozilla::layout::FrameChildListID, nsIFrame*) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x47d4a24]
[task 2020-08-15T23:04:17.565Z] 23:04:17 INFO - GECKO(2453) | #12: nsCSSFrameConstructor::ContentRemoved(nsIContent*, nsIContent*, nsCSSFrameConstructor::RemoveFlags) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x4717eff]
[task 2020-08-15T23:04:17.565Z] 23:04:17 INFO - GECKO(2453) | #13: nsCSSFrameConstructor::RecreateFramesForContent(nsIContent*, nsCSSFrameConstructor::InsertionKind) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x470f125]
[task 2020-08-15T23:04:17.572Z] 23:04:17 INFO - GECKO(2453) | #14: mozilla::RestyleManager::ProcessRestyledFrames(nsStyleChangeList&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x46d8e95]
[task 2020-08-15T23:04:17.573Z] 23:04:17 INFO - GECKO(2453) | #15: mozilla::RestyleManager::DoProcessPendingRestyles(mozilla::ServoTraversalFlags) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x46dff9a]
[task 2020-08-15T23:04:17.573Z] 23:04:17 INFO - GECKO(2453) | #16: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x46b8037]
[task 2020-08-15T23:04:17.577Z] 23:04:17 INFO - GECKO(2453) | #17: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x1b16f5c]
[task 2020-08-15T23:04:17.578Z] 23:04:17 INFO - GECKO(2453) | #18: nsFocusManager::FlushAndCheckIfFocusable(mozilla::dom::Element*, unsigned int) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x1c71d33]
[task 2020-08-15T23:04:17.578Z] 23:04:17 INFO - GECKO(2453) | #19: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x1c6f6be]
[task 2020-08-15T23:04:17.587Z] 23:04:17 INFO - GECKO(2453) | #20: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x1c71b4a]
[task 2020-08-15T23:04:17.587Z] 23:04:17 INFO - GECKO(2453) | #21: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x1b3d5e3]
[task 2020-08-15T23:04:17.587Z] 23:04:17 INFO - GECKO(2453) | #22: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/cltbld/tasks/task_1597525354/build/application/Firefox NightlyDebug.app/Contents/MacOS/XUL + 0x2de059b]
This seems a timing issue and the try run has a higher chance to hit it. One possible solution is to introduce a way to clear synthesized mouse status after finishing the test.
Assignee | ||
Comment 15•5 years ago
|
||
Depends on D86953
Assignee | ||
Comment 16•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #14)
One possible solution is to introduce a way to clear synthesized mouse status after finishing the test.
Unfortunately, I could not make it work successfully.
I did some experiments on Mac, the code in cocoa widget doesn't support synthesizing mouse exit event, and I also tried to do a quick hack, but no luck to make it work. And on Windows, there seems no Exit
event that we can simulate, https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event. I didn't try Linux.
I decide to skip test-verify for now and bug 1659940 is filed as a follow-up.
Comment 18•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #16)
(In reply to Edgar Chen [:edgar] from comment #14)
One possible solution is to introduce a way to clear synthesized mouse status after finishing the test.
Unfortunately, I could not make it work successfully.
I did some experiments on Mac, the code in cocoa widget doesn't support synthesizing mouse exit event, and I also tried to do a quick hack, but no luck to make it work. And on Windows, there seems noExit
event that we can simulate, https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event. I didn't try Linux.I decide to skip test-verify for now and bug 1659940 is filed as a follow-up.
Just to be clear: this is "just" a problem with the tests on Mac and Windows, not with the patch itself?
Assignee | ||
Comment 19•5 years ago
|
||
(In reply to Jens Stutte [:jstutte] (REO for FF 81) from comment #18)
Just to be clear: this is "just" a problem with the tests on Mac and Windows, not with the patch itself?
This is a potential issue on the long-existing code (not related to the patch), the newly added test hit it on try (did not see this locally).
Comment 20•5 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #19)
(In reply to Jens Stutte [:jstutte] (REO for FF 81) from comment #18)
Just to be clear: this is "just" a problem with the tests on Mac and Windows, not with the patch itself?
This is a potential issue on the long-existing code (not related to the patch), the newly added test hit it on try (did not see this locally).
I see, thanks. Should we file a different bug for it then?
Assignee | ||
Comment 21•5 years ago
|
||
(In reply to Jens Stutte [:jstutte] (REO for FF 81) from comment #20)
I see, thanks. Should we file a different bug for it then?
Yes, had filed bug 1659940 for that.
Assignee | ||
Comment 22•5 years ago
|
||
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 23•5 years ago
•
|
||
Comment 24•5 years ago
|
||
Comment 25•5 years ago
|
||
Comment 26•5 years ago
|
||
Backed out for assertion failures on EventStateManager.cpp.
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=314199358&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/230586563fe7
Assignee | ||
Comment 27•5 years ago
•
|
||
Comment 28•5 years ago
|
||
Comment 29•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/aadba4e6432e
https://hg.mozilla.org/mozilla-central/rev/0621a2181232
https://hg.mozilla.org/mozilla-central/rev/a5ea6e6a60b5
https://hg.mozilla.org/mozilla-central/rev/5f7c12fa235a
https://hg.mozilla.org/mozilla-central/rev/8053557b9f59
Assignee | ||
Updated•5 years ago
|
Description
•