mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Don't QI a node to nsIDOMElement and back to nsIContent for every call to nsEventStateManager::GetContentState. (Bug 509889) r=enndeakin
This commit is contained in:
parent
c163cbee6e
commit
ed026ed2f0
@ -3927,15 +3927,9 @@ nsEventStateManager::GetContentState(nsIContent *aContent, PRInt32& aState)
|
||||
}
|
||||
}
|
||||
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm) {
|
||||
nsCOMPtr<nsIDOMElement> focusedElement;
|
||||
fm->GetFocusedElement(getter_AddRefs(focusedElement));
|
||||
|
||||
nsCOMPtr<nsIContent> focusedContent = do_QueryInterface(focusedElement);
|
||||
if (aContent == focusedContent) {
|
||||
aState |= NS_EVENT_STATE_FOCUS;
|
||||
}
|
||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm && aContent == fm->GetFocusedContent()) {
|
||||
aState |= NS_EVENT_STATE_FOCUS;
|
||||
}
|
||||
if (aContent == mDragOverContent) {
|
||||
aState |= NS_EVENT_STATE_DRAGOVER;
|
||||
|
@ -149,7 +149,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
||||
|
||||
nsIFocusManager* nsFocusManager::sInstance = nsnull;
|
||||
nsFocusManager* nsFocusManager::sInstance = nsnull;
|
||||
|
||||
nsFocusManager::nsFocusManager()
|
||||
{ }
|
||||
|
@ -73,7 +73,14 @@ public:
|
||||
/**
|
||||
* Retrieve the single focus manager.
|
||||
*/
|
||||
static nsIFocusManager* GetFocusManager() { return sInstance; }
|
||||
static nsFocusManager* GetFocusManager() { return sInstance; }
|
||||
|
||||
/**
|
||||
* A faster version of nsIFocusManager::GetFocusedElement, returning a
|
||||
* raw nsIContent pointer (instead of having AddRef-ed nsIDOMElement
|
||||
* pointer filled in to an out-parameter).
|
||||
*/
|
||||
nsIContent* GetFocusedContent() { return mFocusedContent; }
|
||||
|
||||
/**
|
||||
* Returns the content node that would be focused if aWindow was in an
|
||||
@ -437,7 +444,7 @@ protected:
|
||||
nsTArray<nsDelayedBlurOrFocusEvent> mDelayedBlurFocusEvents;
|
||||
|
||||
// the single focus manager
|
||||
static nsIFocusManager* sInstance;
|
||||
static nsFocusManager* sInstance;
|
||||
};
|
||||
|
||||
nsresult
|
||||
|
Loading…
Reference in New Issue
Block a user