Bug 124298 - moving form submit/reset event firing into the content node. r=jkeiser, sr=attinasi
This commit is contained in:
@@ -1367,10 +1367,16 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
case NS_FORM_INPUT_SUBMIT:
|
||||
case NS_FORM_INPUT_IMAGE:
|
||||
{
|
||||
// Tell the frame about the click
|
||||
if (formControlFrame) {
|
||||
formControlFrame->MouseClicked(aPresContext);
|
||||
}
|
||||
nsFormEvent event;
|
||||
event.eventStructType = NS_FORM_EVENT;
|
||||
event.message = (type == NS_FORM_INPUT_RESET) ? NS_FORM_RESET : NS_FORM_SUBMIT;
|
||||
event.originator = this;
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext->GetShell(getter_AddRefs(presShell));
|
||||
nsCOMPtr<nsIContent> form(do_QueryInterface(mForm));
|
||||
presShell->HandleEventWithTarget(&event, nsnull, form, NS_EVENT_FLAG_INIT, &status);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -299,21 +299,8 @@ nsHTMLButtonControlFrame::IsSubmit(PRInt32 type)
|
||||
void
|
||||
nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
||||
{
|
||||
if ((nsnull != mFormFrame) && !nsFormFrame::GetDisabled(this)) {
|
||||
PRInt32 type;
|
||||
GetType(&type);
|
||||
|
||||
if (IsReset(type) == PR_TRUE) {
|
||||
// do Reset & Frame processing of event
|
||||
nsFormControlHelper::DoManualSubmitOrReset(aPresContext, nsnull, mFormFrame,
|
||||
this, PR_FALSE, PR_FALSE);
|
||||
}
|
||||
else if (IsSubmit(type) == PR_TRUE) {
|
||||
// do Submit & Frame processing of event
|
||||
nsFormControlHelper::DoManualSubmitOrReset(aPresContext, nsnull, mFormFrame,
|
||||
this, PR_TRUE, PR_FALSE);
|
||||
}
|
||||
}
|
||||
// This is no longer called; click events are handled in
|
||||
// nsHTMLInputElement::HandleDOMEvent().
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -436,11 +436,8 @@ nsImageControlFrame::GetCursor(nsIPresContext* aPresContext,
|
||||
void
|
||||
nsImageControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
||||
{
|
||||
if (nsnull != mFormFrame && !nsFormFrame::GetDisabled(this)) {
|
||||
// Do Submit & DOM Processing
|
||||
nsFormControlHelper::DoManualSubmitOrReset(aPresContext, nsnull,
|
||||
mFormFrame, this, PR_TRUE, PR_TRUE);
|
||||
}
|
||||
// This is no longer called; click events are handled in
|
||||
// nsHTMLInputElement::HandleDOMEvent().
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
@@ -299,21 +299,8 @@ nsHTMLButtonControlFrame::IsSubmit(PRInt32 type)
|
||||
void
|
||||
nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
||||
{
|
||||
if ((nsnull != mFormFrame) && !nsFormFrame::GetDisabled(this)) {
|
||||
PRInt32 type;
|
||||
GetType(&type);
|
||||
|
||||
if (IsReset(type) == PR_TRUE) {
|
||||
// do Reset & Frame processing of event
|
||||
nsFormControlHelper::DoManualSubmitOrReset(aPresContext, nsnull, mFormFrame,
|
||||
this, PR_FALSE, PR_FALSE);
|
||||
}
|
||||
else if (IsSubmit(type) == PR_TRUE) {
|
||||
// do Submit & Frame processing of event
|
||||
nsFormControlHelper::DoManualSubmitOrReset(aPresContext, nsnull, mFormFrame,
|
||||
this, PR_TRUE, PR_FALSE);
|
||||
}
|
||||
}
|
||||
// This is no longer called; click events are handled in
|
||||
// nsHTMLInputElement::HandleDOMEvent().
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -436,11 +436,8 @@ nsImageControlFrame::GetCursor(nsIPresContext* aPresContext,
|
||||
void
|
||||
nsImageControlFrame::MouseClicked(nsIPresContext* aPresContext)
|
||||
{
|
||||
if (nsnull != mFormFrame && !nsFormFrame::GetDisabled(this)) {
|
||||
// Do Submit & DOM Processing
|
||||
nsFormControlHelper::DoManualSubmitOrReset(aPresContext, nsnull,
|
||||
mFormFrame, this, PR_TRUE, PR_TRUE);
|
||||
}
|
||||
// This is no longer called; click events are handled in
|
||||
// nsHTMLInputElement::HandleDOMEvent().
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
Reference in New Issue
Block a user