mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 06:05:44 +00:00
Bug 598833 part 4. Store urltarget and dragover state directly on elements. r=dbaron
This commit is contained in:
parent
36028374d5
commit
998bcec762
@ -4240,12 +4240,6 @@ nsEventStateManager::GetContentState(nsIContent *aContent)
|
||||
state |= NS_EVENT_STATE_FOCUSRING;
|
||||
}
|
||||
}
|
||||
if (aContent == mDragOverContent) {
|
||||
state |= NS_EVENT_STATE_DRAGOVER;
|
||||
}
|
||||
if (aContent == mURLTargetContent) {
|
||||
state |= NS_EVENT_STATE_URLTARGET;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -4305,6 +4299,16 @@ nsEventStateManager::DoStateChange(Element* aElement, nsEventStates aState,
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
inline void
|
||||
nsEventStateManager::DoStateChange(nsIContent* aContent, nsEventStates aState,
|
||||
PRBool aStateAdded)
|
||||
{
|
||||
if (aContent->IsElement()) {
|
||||
DoStateChange(aContent->AsElement(), aState, aStateAdded);
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsEventStateManager::UpdateAncestorState(nsIContent* aStartNode,
|
||||
@ -4440,10 +4444,10 @@ nsEventStateManager::SetContentState(nsIContent *aContent, nsEventStates aState)
|
||||
UpdateAncestorState(notifyContent1, commonAncestor, aState,
|
||||
content1StateSet);
|
||||
} else {
|
||||
mDocument->ContentStateChanged(notifyContent1, aState);
|
||||
if (notifyContent2) {
|
||||
mDocument->ContentStateChanged(notifyContent2, aState);
|
||||
DoStateChange(notifyContent2, aState, PR_FALSE);
|
||||
}
|
||||
DoStateChange(notifyContent1, aState, content1StateSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -437,6 +437,8 @@ protected:
|
||||
private:
|
||||
static inline void DoStateChange(mozilla::dom::Element* aElement,
|
||||
nsEventStates aState, PRBool aAddState);
|
||||
static inline void DoStateChange(nsIContent* aContent, nsEventStates aState,
|
||||
PRBool aAddState);
|
||||
static void UpdateAncestorState(nsIContent* aStartNode,
|
||||
nsIContent* aStopBefore,
|
||||
nsEventStates aState,
|
||||
|
Loading…
Reference in New Issue
Block a user