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

This commit is contained in:
blakeross%telocity.com 2001-02-12 21:19:23 +00:00
parent 0940ba390b
commit 2a5c341197
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);

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);