diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 8263ed20ca8..99147d9a75c 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -999,6 +999,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext, case NS_FORM_INPUT_BUTTON: case NS_FORM_INPUT_RESET: case NS_FORM_INPUT_SUBMIT: + case NS_FORM_INPUT_IMAGE: { // Tell the frame about the click nsIFormControlFrame* formControlFrame = nsnull; diff --git a/mozilla/layout/forms/nsImageControlFrame.cpp b/mozilla/layout/forms/nsImageControlFrame.cpp index e97710e9549..c6eee1022bf 100644 --- a/mozilla/layout/forms/nsImageControlFrame.cpp +++ b/mozilla/layout/forms/nsImageControlFrame.cpp @@ -287,29 +287,16 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, *aEventStatus = nsEventStatus_eIgnore; switch (aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_DOWN: + case NS_MOUSE_LEFT_BUTTON_UP: { // Store click point for GetNamesValues + // Do this on MouseUp because the specs don't say and that's what IE does. float t2p; aPresContext->GetTwipsToPixels(&t2p); mLastClickPoint.x = NSTwipsToIntPixels(aEvent->point.x, t2p); mLastClickPoint.y = NSTwipsToIntPixels(aEvent->point.y, t2p); - mLastMouseState = eMouseDown; mGotFocus = PR_TRUE; - *aEventStatus = nsEventStatus_eConsumeNoDefault; - return NS_OK; - break; - } - case NS_MOUSE_LEFT_BUTTON_UP: - { - if (eMouseDown == mLastMouseState) { - if (nsEventStatus_eConsumeNoDefault != *aEventStatus) { - MouseClicked(aPresContext); - } - } - mLastMouseState = eMouseUp; - *aEventStatus = nsEventStatus_eConsumeNoDefault; return NS_OK; break; } diff --git a/mozilla/layout/html/content/src/nsHTMLInputElement.cpp b/mozilla/layout/html/content/src/nsHTMLInputElement.cpp index 8263ed20ca8..99147d9a75c 100644 --- a/mozilla/layout/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLInputElement.cpp @@ -999,6 +999,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext, case NS_FORM_INPUT_BUTTON: case NS_FORM_INPUT_RESET: case NS_FORM_INPUT_SUBMIT: + case NS_FORM_INPUT_IMAGE: { // Tell the frame about the click nsIFormControlFrame* formControlFrame = nsnull; diff --git a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp index e97710e9549..c6eee1022bf 100644 --- a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp @@ -287,29 +287,16 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, *aEventStatus = nsEventStatus_eIgnore; switch (aEvent->message) { - case NS_MOUSE_LEFT_BUTTON_DOWN: + case NS_MOUSE_LEFT_BUTTON_UP: { // Store click point for GetNamesValues + // Do this on MouseUp because the specs don't say and that's what IE does. float t2p; aPresContext->GetTwipsToPixels(&t2p); mLastClickPoint.x = NSTwipsToIntPixels(aEvent->point.x, t2p); mLastClickPoint.y = NSTwipsToIntPixels(aEvent->point.y, t2p); - mLastMouseState = eMouseDown; mGotFocus = PR_TRUE; - *aEventStatus = nsEventStatus_eConsumeNoDefault; - return NS_OK; - break; - } - case NS_MOUSE_LEFT_BUTTON_UP: - { - if (eMouseDown == mLastMouseState) { - if (nsEventStatus_eConsumeNoDefault != *aEventStatus) { - MouseClicked(aPresContext); - } - } - mLastMouseState = eMouseUp; - *aEventStatus = nsEventStatus_eConsumeNoDefault; return NS_OK; break; }