Only get the type when we need it. r=hixie

git-svn-id: svn://10.0.0.236/trunk@86837 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blakeross%telocity.com
2001-02-12 21:19:23 +00:00
parent ffdd58fa50
commit 7e6aa12cf9
2 changed files with 4 additions and 6 deletions

View File

@@ -330,9 +330,6 @@ nsHTMLButtonControlFrame::IsSubmit(nsIPresContext* aPresContext, PRInt32 type)
void
nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
{
PRInt32 type;
GetType(&type);
if ((nsnull != mFormFrame) && !nsFormFrame::GetDisabled(this)) {
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event;
@@ -343,6 +340,8 @@ nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
PRInt32 type;
GetType(&type);
if (IsReset(type) == PR_TRUE) {
event.message = NS_FORM_RESET;
presShell->HandleEventWithTarget(&event, nsnull, formContent, NS_EVENT_FLAG_INIT, &status);