Fix for bug 417533 (Resizing linked images fails in contentEditable elements). r/sr=jst, a=damon.

This commit is contained in:
peterv%propagandism.org 2008-04-23 11:53:30 +00:00
Родитель 858ebe3746
Коммит 8ed966f360
3 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -41,7 +41,7 @@
interface nsIHTMLObjectResizeListener;
[scriptable, uuid(b0338f6c-ded3-4c39-a953-56e8bae494f5)]
[scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)]
interface nsIHTMLObjectResizer : nsISupports
{
@ -88,9 +88,10 @@ interface nsIHTMLObjectResizer : nsISupports
* @param aX [IN] horizontal position of the pointer
* @param aY [IN] vertical position of the pointer
* @param aTarget [IN] the element triggering the event
* @param aMouseEvent [IN] the event
*/
void mouseDown(in long aX, in long aY,
in nsIDOMElement aTarget);
in nsIDOMElement aTarget, in nsIDOMEvent aMouseEvent);
/**
* event callback when a mouse button is released

Просмотреть файл

@ -275,7 +275,7 @@ nsHTMLEditorMouseListener::MouseDown(nsIDOMEvent* aMouseEvent)
PRInt32 clientX, clientY;
mouseEvent->GetClientX(&clientX);
mouseEvent->GetClientY(&clientY);
objectResizer->MouseDown(clientX, clientY, element);
objectResizer->MouseDown(clientX, clientY, element, aMouseEvent);
}
}

Просмотреть файл

@ -623,7 +623,7 @@ nsHTMLEditor::StartResizing(nsIDOMElement *aHandle)
NS_IMETHODIMP
nsHTMLEditor::MouseDown(PRInt32 aClientX, PRInt32 aClientY,
nsIDOMElement *aTarget)
nsIDOMElement *aTarget, nsIDOMEvent* aEvent)
{
PRBool anonElement = PR_FALSE;
if (aTarget && NS_SUCCEEDED(aTarget->HasAttribute(NS_LITERAL_STRING("_moz_anonclass"), &anonElement)))
@ -634,6 +634,8 @@ nsHTMLEditor::MouseDown(PRInt32 aClientX, PRInt32 aClientY,
if (NS_FAILED(res)) return res;
if (anonclass.EqualsLiteral("mozResizer")) {
// and that element is a resizer, let's start resizing!
aEvent->PreventDefault();
mOriginalX = aClientX;
mOriginalY = aClientY;
return StartResizing(aTarget);