mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 03:00:30 +00:00
Only get the type when we need it. r=hixie
This commit is contained in:
parent
0940ba390b
commit
2a5c341197
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user