From a1a74387d0fe45fe8a4e6805d056fe208907b1e4 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Mon, 18 Oct 1999 21:47:31 +0000 Subject: [PATCH] Move code to handle focus event into the correct switch statement r=kmcclusk, bug 7133 git-svn-id: svn://10.0.0.236/trunk@51032 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/content/src/nsHTMLInputElement.cpp | 23 +++++++++---------- .../html/content/src/nsHTMLInputElement.cpp | 23 +++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 250019176f2..a077b96975c 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -566,6 +566,17 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext& aPresContext, if ((NS_OK == ret) && (nsEventStatus_eIgnore == aEventStatus)) { switch (aEvent->message) { + case NS_FOCUS_CONTENT: + { + nsIFormControlFrame* formControlFrame = nsnull; + nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame); + if (NS_SUCCEEDED(rv)) { + formControlFrame->SetFocus(PR_TRUE, PR_TRUE); + return NS_OK; + } + } + break; + case NS_KEY_PRESS: { nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent; @@ -573,18 +584,6 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext& aPresContext, PRInt32 type; GetType(&type); switch(type) { - case NS_FOCUS_CONTENT: - { - nsIFormControlFrame* formControlFrame = nsnull; - nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame); - if (NS_SUCCEEDED(rv)) { - formControlFrame->SetFocus(PR_TRUE, PR_TRUE); - return NS_OK; - } - //SetFocus(&aPresContext); - } - break; - case NS_FORM_INPUT_CHECKBOX: { PRBool checked; diff --git a/mozilla/layout/html/content/src/nsHTMLInputElement.cpp b/mozilla/layout/html/content/src/nsHTMLInputElement.cpp index 250019176f2..a077b96975c 100644 --- a/mozilla/layout/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLInputElement.cpp @@ -566,6 +566,17 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext& aPresContext, if ((NS_OK == ret) && (nsEventStatus_eIgnore == aEventStatus)) { switch (aEvent->message) { + case NS_FOCUS_CONTENT: + { + nsIFormControlFrame* formControlFrame = nsnull; + nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame); + if (NS_SUCCEEDED(rv)) { + formControlFrame->SetFocus(PR_TRUE, PR_TRUE); + return NS_OK; + } + } + break; + case NS_KEY_PRESS: { nsKeyEvent * keyEvent = (nsKeyEvent *)aEvent; @@ -573,18 +584,6 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext& aPresContext, PRInt32 type; GetType(&type); switch(type) { - case NS_FOCUS_CONTENT: - { - nsIFormControlFrame* formControlFrame = nsnull; - nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame); - if (NS_SUCCEEDED(rv)) { - formControlFrame->SetFocus(PR_TRUE, PR_TRUE); - return NS_OK; - } - //SetFocus(&aPresContext); - } - break; - case NS_FORM_INPUT_CHECKBOX: { PRBool checked;