зеркало из https://github.com/mozilla/pjs.git
Fix for the regression described in bug 6823.
This commit is contained in:
Родитель
a425d2dc74
Коммит
8fb2c9835b
|
@ -32,10 +32,15 @@ class nsIPresContext;
|
|||
0x80a98c80, 0x2036, 0x11d2, \
|
||||
{0xbd, 0x89, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4} }
|
||||
|
||||
class nsIDOMNode;
|
||||
|
||||
class nsIPrivateDOMEvent : public nsISupports {
|
||||
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IPRIVATEDOMEVENT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD DuplicatePrivateData() = 0;
|
||||
NS_IMETHOD SetTarget(nsIDOMNode* aNode) = 0;
|
||||
};
|
||||
|
||||
extern nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult, nsIPresContext& aPresContext, nsEvent *aEvent);
|
||||
|
|
|
@ -346,6 +346,16 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::SetTarget(nsIDOMNode* aTarget)
|
||||
{
|
||||
if (mTarget != aTarget) {
|
||||
NS_IF_RELEASE(mTarget);
|
||||
NS_IF_ADDREF(aTarget);
|
||||
mTarget = aTarget;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
|
||||
{
|
||||
switch(aEventType) {
|
||||
|
|
|
@ -121,6 +121,7 @@ public:
|
|||
|
||||
// nsIPrivateDOMEvent interface
|
||||
NS_IMETHOD DuplicatePrivateData();
|
||||
NS_IMETHOD SetTarget(nsIDOMNode* aNode);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -2238,7 +2238,12 @@ RDFElementImpl::HandleDOMEvent(nsIPresContext& aPresContext,
|
|||
NS_ERROR("Menu/key event will fail without the ability to create the event early.");
|
||||
return ret;
|
||||
}
|
||||
//domEvent->SetTarget(this);
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(domEvent);
|
||||
if (privateEvent) {
|
||||
privateEvent->SetTarget(this);
|
||||
}
|
||||
else return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,10 +32,15 @@ class nsIPresContext;
|
|||
0x80a98c80, 0x2036, 0x11d2, \
|
||||
{0xbd, 0x89, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4} }
|
||||
|
||||
class nsIDOMNode;
|
||||
|
||||
class nsIPrivateDOMEvent : public nsISupports {
|
||||
|
||||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IPRIVATEDOMEVENT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD DuplicatePrivateData() = 0;
|
||||
NS_IMETHOD SetTarget(nsIDOMNode* aNode) = 0;
|
||||
};
|
||||
|
||||
extern nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult, nsIPresContext& aPresContext, nsEvent *aEvent);
|
||||
|
|
|
@ -346,6 +346,16 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsDOMEvent::SetTarget(nsIDOMNode* aTarget)
|
||||
{
|
||||
if (mTarget != aTarget) {
|
||||
NS_IF_RELEASE(mTarget);
|
||||
NS_IF_ADDREF(aTarget);
|
||||
mTarget = aTarget;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
|
||||
{
|
||||
switch(aEventType) {
|
||||
|
|
|
@ -121,6 +121,7 @@ public:
|
|||
|
||||
// nsIPrivateDOMEvent interface
|
||||
NS_IMETHOD DuplicatePrivateData();
|
||||
NS_IMETHOD SetTarget(nsIDOMNode* aNode);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -2238,7 +2238,12 @@ RDFElementImpl::HandleDOMEvent(nsIPresContext& aPresContext,
|
|||
NS_ERROR("Menu/key event will fail without the ability to create the event early.");
|
||||
return ret;
|
||||
}
|
||||
//domEvent->SetTarget(this);
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(domEvent);
|
||||
if (privateEvent) {
|
||||
privateEvent->SetTarget(this);
|
||||
}
|
||||
else return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2238,7 +2238,12 @@ RDFElementImpl::HandleDOMEvent(nsIPresContext& aPresContext,
|
|||
NS_ERROR("Menu/key event will fail without the ability to create the event early.");
|
||||
return ret;
|
||||
}
|
||||
//domEvent->SetTarget(this);
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(domEvent);
|
||||
if (privateEvent) {
|
||||
privateEvent->SetTarget(this);
|
||||
}
|
||||
else return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче