mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1129526
- Make the RenderFrameParent put focus on the correct OOP child before delivering a click event to it. r=botond
This commit is contained in:
parent
e2616030bb
commit
2af5e47ca3
@ -19,6 +19,7 @@
|
|||||||
#include "mozilla/layers/CompositorParent.h"
|
#include "mozilla/layers/CompositorParent.h"
|
||||||
#include "mozilla/layers/LayerTransactionParent.h"
|
#include "mozilla/layers/LayerTransactionParent.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
|
#include "nsFocusManager.h"
|
||||||
#include "nsFrameLoader.h"
|
#include "nsFrameLoader.h"
|
||||||
#include "nsIObserver.h"
|
#include "nsIObserver.h"
|
||||||
#include "nsSubDocumentFrame.h"
|
#include "nsSubDocumentFrame.h"
|
||||||
@ -148,6 +149,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mRenderFrame) {
|
if (mRenderFrame) {
|
||||||
|
mRenderFrame->TakeFocusForClick();
|
||||||
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
||||||
browser->HandleSingleTap(aPoint, aModifiers, aGuid);
|
browser->HandleSingleTap(aPoint, aModifiers, aGuid);
|
||||||
}
|
}
|
||||||
@ -595,6 +597,25 @@ RenderFrameParent::GetTextureFactoryIdentifier(TextureFactoryIdentifier* aTextur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RenderFrameParent::TakeFocusForClick()
|
||||||
|
{
|
||||||
|
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
|
if (!fm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nsCOMPtr<nsIContent> owner = mFrameLoader->GetOwnerContent();
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(owner);
|
||||||
|
if (!element) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fm->SetFocus(element, nsIFocusManager::FLAG_BYMOUSE |
|
||||||
|
nsIFocusManager::FLAG_NOSCROLL);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace layout
|
} // namespace layout
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
@ -116,6 +116,9 @@ public:
|
|||||||
void GetTextureFactoryIdentifier(TextureFactoryIdentifier* aTextureFactoryIdentifier);
|
void GetTextureFactoryIdentifier(TextureFactoryIdentifier* aTextureFactoryIdentifier);
|
||||||
|
|
||||||
inline uint64_t GetLayersId() { return mLayersId; }
|
inline uint64_t GetLayersId() { return mLayersId; }
|
||||||
|
|
||||||
|
void TakeFocusForClick();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user