зеркало из https://github.com/mozilla/gecko-dev.git
Fix for caret problems in Ender text fields. r=saari
This commit is contained in:
Родитель
5b5d567b93
Коммит
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче