Fix for 78987, modify Init*Event signatures to meet standards. sr:hyatt, r:jst

This commit is contained in:
joki%netscape.com 2001-05-14 01:54:11 +00:00
Родитель 58e745e6a9
Коммит 83de3b5600
7 изменённых файлов: 37 добавлений и 27 удалений

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

@ -1172,13 +1172,15 @@ nsDOMEvent::InitUIEvent(const nsAReadableString& aTypeArg, PRBool aCanBubbleArg,
}
NS_IMETHODIMP
nsDOMEvent::InitMouseEvent(const nsAReadableString& aTypeArg, PRBool aCtrlKeyArg, PRBool aAltKeyArg,
PRBool aShiftKeyArg, PRBool aMetaKeyArg, PRInt32 aScreenXArg, PRInt32 aScreenYArg,
PRInt32 aClientXArg, PRInt32 aClientYArg, PRUint16 aButtonArg, PRUint16 aDetailArg)
nsDOMEvent::InitMouseEvent(const nsAReadableString & aTypeArg, PRBool aCanBubbleArg, PRBool aCancelableArg,
nsIDOMAbstractView *aViewArg, PRUint16 aDetailArg, PRInt32 aScreenXArg,
PRInt32 aScreenYArg, PRInt32 aClientXArg, PRInt32 aClientYArg,
PRBool aCtrlKeyArg, PRBool aAltKeyArg, PRBool aShiftKeyArg,
PRBool aMetaKeyArg, PRUint16 aButtonArg, nsIDOMEventTarget *aRelatedTargetArg)
{
NS_ENSURE_SUCCESS(SetEventType(aTypeArg), NS_ERROR_FAILURE);
//mEvent->flags |= aCanBubbleArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_BUBBLE;
//mEvent->flags |= aCancelableArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_CANCEL;
mEvent->flags |= aCanBubbleArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_BUBBLE;
mEvent->flags |= aCancelableArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_CANCEL;
if (mEvent->eventStructType == NS_MOUSE_EVENT) {
nsMouseEvent* mouseEvent = NS_STATIC_CAST(nsMouseEvent*, mEvent);
@ -1200,8 +1202,9 @@ nsDOMEvent::InitMouseEvent(const nsAReadableString& aTypeArg, PRBool aCtrlKeyArg
NS_IMETHODIMP
nsDOMEvent::InitKeyEvent(const nsAReadableString& aTypeArg, PRBool aCanBubbleArg, PRBool aCancelableArg,
PRBool aCtrlKeyArg, PRBool aAltKeyArg, PRBool aShiftKeyArg, PRBool aMetaKeyArg,
PRUint32 aKeyCodeArg, PRUint32 aCharCodeArg, nsIDOMAbstractView* aViewArg)
nsIDOMAbstractView* aViewArg, PRBool aCtrlKeyArg, PRBool aAltKeyArg,
PRBool aShiftKeyArg, PRBool aMetaKeyArg,
PRUint32 aKeyCodeArg, PRUint32 aCharCodeArg)
{
NS_ENSURE_SUCCESS(SetEventType(aTypeArg), NS_ERROR_FAILURE);
mEvent->flags |= aCanBubbleArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_BUBBLE;

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

@ -141,18 +141,20 @@ public:
NS_IMETHOD GetRelatedTarget(nsIDOMEventTarget** aRelatedTarget);
NS_IMETHOD GetCharCode(PRUint32* aCharCode);
NS_IMETHOD GetKeyCode(PRUint32* aKeyCode);
NS_IMETHOD InitMouseEvent(const nsAReadableString& aTypeArg,
PRBool aCtrlKeyArg, PRBool aAltKeyArg,
PRBool aShiftKeyArg, PRBool aMetaKeyArg,
PRInt32 aScreenXArg, PRInt32 aScreenYArg,
PRInt32 aClientXArg, PRInt32 aClientYArg,
PRUint16 aButtonArg, PRUint16 aDetailArg);
NS_IMETHOD InitMouseEvent(const nsAReadableString & aTypeArg,
PRBool aCanBubbleArg, PRBool aCancelableArg,
nsIDOMAbstractView *aViewArg, PRUint16 aDetailArg,
PRInt32 aScreenXArg, PRInt32 aDcreenYArg,
PRInt32 aClientXArg, PRInt32 aClientYArg,
PRBool aCtrlKeyArg, PRBool aAltKeyArg,
PRBool aShiftKeyArg, PRBool aMetaKeyArg,
PRUint16 aButtonArg, nsIDOMEventTarget *aRelatedTargetArg);
NS_IMETHOD InitKeyEvent(const nsAReadableString& aTypeArg,
PRBool aCanBubbleArg, PRBool aCancelableArg,
nsIDOMAbstractView* aViewArg,
PRBool aCtrlKeyArg, PRBool aAltKeyArg,
PRBool aShiftKeyArg, PRBool aMetaKeyArg,
PRUint32 aKeyCodeArg, PRUint32 aCharCodeArg,
nsIDOMAbstractView* aViewArg);
PRUint32 aKeyCodeArg, PRUint32 aCharCodeArg);
// nsIDOMNSUIEvent interface
NS_IMETHOD GetLayerX(PRInt32* aLayerX);

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

@ -136,7 +136,8 @@ nsDOMMutationEvent::InitMutationEvent(const nsAReadableString& aTypeArg, PRBool
PRBool aCancelableArg, nsIDOMNode* aRelatedNodeArg,
const nsAReadableString& aPrevValueArg,
const nsAReadableString& aNewValueArg,
const nsAReadableString& aAttrNameArg)
const nsAReadableString& aAttrNameArg,
PRUint16 aAttrChangeArg)
{
NS_ENSURE_SUCCESS(SetEventType(aTypeArg), NS_ERROR_FAILURE);
mEvent->flags |= aCanBubbleArg ? NS_EVENT_FLAG_NONE : NS_EVENT_FLAG_CANT_BUBBLE;
@ -151,9 +152,8 @@ nsDOMMutationEvent::InitMutationEvent(const nsAReadableString& aTypeArg, PRBool
mutation->mNewAttrValue = getter_AddRefs(NS_NewAtom(aNewValueArg));
if (!aAttrNameArg.IsEmpty()) {
mutation->mAttrName = getter_AddRefs(NS_NewAtom(aAttrNameArg));
// I guess we assume modification. Weird that this isn't specifiable.
mutation->mAttrChange = nsIDOMMutationEvent::MODIFICATION;
}
mutation->mAttrChange = aAttrChangeArg;
}
return NS_OK;

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

@ -1692,7 +1692,7 @@ nsHTMLInputElement::FireEventForAccessibility(nsIPresContext* aPresContext,
if ( !mutEvent )
return NS_ERROR_FAILURE;
nsAutoString empty;
mutEvent->InitMutationEvent( aEventType, PR_TRUE, PR_TRUE, nsnull, empty, empty, empty);
mutEvent->InitMutationEvent( aEventType, PR_TRUE, PR_TRUE, nsnull, empty, empty, empty, nsIDOMMutationEvent::MODIFICATION);
// Set the target of the event to this nsHTMLInputElement, which should be checkbox content??
nsCOMPtr<nsIPrivateDOMEvent> privEvent(do_QueryInterface(domEvent));

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

@ -161,11 +161,11 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
void initKeyEvent(in DOMString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in nsIDOMAbstractView viewArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in unsigned long keyCodeArg,
in unsigned long charCodeArg,
in nsIDOMAbstractView viewArg);
in unsigned long charCodeArg);
};

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

@ -42,14 +42,18 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent
readonly attribute nsIDOMEventTarget relatedTarget;
void initMouseEvent(in DOMString typeArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in boolean canBubbleArg,
in boolean cancelableArg,
in nsIDOMAbstractView viewArg,
in unsigned short detailArg,
in long screenXArg,
in long screenYArg,
in long clientXArg,
in long clientYArg,
in boolean ctrlKeyArg,
in boolean altKeyArg,
in boolean shiftKeyArg,
in boolean metaKeyArg,
in unsigned short buttonArg,
in unsigned short detailArg);
in nsIDOMEventTarget relatedTargetArg);
};

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

@ -42,5 +42,6 @@ interface nsIDOMMutationEvent : nsIDOMEvent
in nsIDOMNode relatedNodeArg,
in DOMString prevValueArg,
in DOMString newValueArg,
in DOMString attrNameArg);
in DOMString attrNameArg,
in unsigned short attrChangeArg);
};