mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Only unset :hover in NotifyMouseOut if we're not mousing over
anything. Otherwise, let NotifyMouseOver handle changing :hover; it's faster that way. Bug 292472, r+sr=roc, a=dbaron
This commit is contained in:
parent
2775eedb3d
commit
a5df6c9834
@ -2570,9 +2570,15 @@ nsEventStateManager::NotifyMouseOut(nsGUIEvent* aEvent, nsIContent* aMovingInto)
|
||||
// Store the first mouseOut event we fire and don't refire mouseOut
|
||||
// to that element while the first mouseOut is still ongoing.
|
||||
mFirstMouseOutEventElement = mLastMouseOverElement;
|
||||
|
||||
// Unset :hover
|
||||
SetContentState(nsnull, NS_EVENT_STATE_HOVER);
|
||||
|
||||
// Don't touch hover state if aMovingInto is non-null. Caller will update
|
||||
// hover state itself, and we have optimizations for hover switching between
|
||||
// two nearby elements both deep in the DOM tree that would be defeated by
|
||||
// switching the hover state to null here.
|
||||
if (!aMovingInto) {
|
||||
// Unset :hover
|
||||
SetContentState(nsnull, NS_EVENT_STATE_HOVER);
|
||||
}
|
||||
|
||||
// Fire mouseout
|
||||
DispatchMouseEvent(aEvent, NS_MOUSE_EXIT_SYNTH,
|
||||
|
@ -180,6 +180,11 @@ protected:
|
||||
/**
|
||||
* Tell this ESM and ESMs in affected child documents that the mouse
|
||||
* has exited this document's currently hovered content.
|
||||
* @param aEvent the event that triggered the mouseout
|
||||
* @param aMovingInto the content node we've moved into. This is used to set
|
||||
* the relatedTarget for mouseout events. Also, if it's non-null
|
||||
* NotifyMouseOut will NOT change the current hover content to null;
|
||||
* in that case the caller is responsible for updating hover state.
|
||||
*/
|
||||
void NotifyMouseOut(nsGUIEvent* aEvent, nsIContent* aMovingInto);
|
||||
void GenerateDragDropEnterExit(nsPresContext* aPresContext, nsGUIEvent* aEvent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user