diff --git a/layout/forms/nsImageControlFrame.cpp b/layout/forms/nsImageControlFrame.cpp index 1b495268bf1..8463d942d8d 100644 --- a/layout/forms/nsImageControlFrame.cpp +++ b/layout/forms/nsImageControlFrame.cpp @@ -264,12 +264,8 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, 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; - t2p = aPresContext->TwipsToPixels(); - mLastClickPoint.x = NSTwipsToIntPixels(aEvent->point.x, t2p); - mLastClickPoint.y = NSTwipsToIntPixels(aEvent->point.y, t2p); - + // Do this on MouseUp because the specs don't say and that's what IE does + TranslateEventCoords(aPresContext, aEvent->point, mLastClickPoint); break; } } diff --git a/layout/html/forms/src/nsImageControlFrame.cpp b/layout/html/forms/src/nsImageControlFrame.cpp index 1b495268bf1..8463d942d8d 100644 --- a/layout/html/forms/src/nsImageControlFrame.cpp +++ b/layout/html/forms/src/nsImageControlFrame.cpp @@ -264,12 +264,8 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, 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; - t2p = aPresContext->TwipsToPixels(); - mLastClickPoint.x = NSTwipsToIntPixels(aEvent->point.x, t2p); - mLastClickPoint.y = NSTwipsToIntPixels(aEvent->point.y, t2p); - + // Do this on MouseUp because the specs don't say and that's what IE does + TranslateEventCoords(aPresContext, aEvent->point, mLastClickPoint); break; } }