mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Fix for caret problems in Ender text fields. r=saari
This commit is contained in:
parent
5b5d567b93
commit
9f336df5c0
@ -194,6 +194,14 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
|
||||
break;
|
||||
case NS_GOTFOCUS:
|
||||
{
|
||||
if (!mDocument) {
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
if (presShell) {
|
||||
presShell->GetDocument(&mDocument);
|
||||
}
|
||||
}
|
||||
|
||||
if (gLastFocusedDocument == mDocument)
|
||||
break;
|
||||
|
||||
@ -221,14 +229,6 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
|
||||
focusevent.eventStructType = NS_EVENT;
|
||||
focusevent.message = NS_FOCUS_CONTENT;
|
||||
|
||||
if (!mDocument) {
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
if (presShell) {
|
||||
presShell->GetDocument(&mDocument);
|
||||
}
|
||||
}
|
||||
|
||||
if (mDocument) {
|
||||
// fire focus on window, not document
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject;
|
||||
|
@ -194,6 +194,14 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
|
||||
break;
|
||||
case NS_GOTFOCUS:
|
||||
{
|
||||
if (!mDocument) {
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
if (presShell) {
|
||||
presShell->GetDocument(&mDocument);
|
||||
}
|
||||
}
|
||||
|
||||
if (gLastFocusedDocument == mDocument)
|
||||
break;
|
||||
|
||||
@ -221,14 +229,6 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
|
||||
focusevent.eventStructType = NS_EVENT;
|
||||
focusevent.message = NS_FOCUS_CONTENT;
|
||||
|
||||
if (!mDocument) {
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
if (presShell) {
|
||||
presShell->GetDocument(&mDocument);
|
||||
}
|
||||
}
|
||||
|
||||
if (mDocument) {
|
||||
// fire focus on window, not document
|
||||
nsCOMPtr<nsIScriptGlobalObject> globalObject;
|
||||
|
Loading…
Reference in New Issue
Block a user