Bug 499008, part 3, remove nsIDOMNSEvent::tmpRealOriginalTarget, r=smaug

This commit is contained in:
Neil Deakin 2012-02-17 09:16:59 -05:00
parent cc12e59fdf
commit 4450a27928
4 changed files with 5 additions and 34 deletions

View File

@ -180,8 +180,7 @@ nsDOMEvent::InitPresContextData(nsPresContext* aPresContext)
// Get the explicit original target (if it's anonymous make it null)
{
nsCOMPtr<nsIContent> content = GetTargetFromFrame();
mTmpRealOriginalTarget = do_QueryInterface(content);
mExplicitOriginalTarget = mTmpRealOriginalTarget;
mExplicitOriginalTarget = do_QueryInterface(content);
if (content && content->IsInAnonymousSubtree()) {
mExplicitOriginalTarget = nsnull;
}
@ -237,10 +236,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
}
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPresContext);
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTmpRealOriginalTarget)
// Always set mExplicitOriginalTarget to null, when
// mTmpRealOriginalTarget doesn't point to any object!
tmp->mExplicitOriginalTarget = nsnull;
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mExplicitOriginalTarget);
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
@ -275,7 +271,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
}
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mPresContext.get(), nsPresContext)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTmpRealOriginalTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mExplicitOriginalTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
// nsIDOMEventInterface
@ -355,18 +351,6 @@ nsDOMEvent::GetExplicitOriginalTarget(nsIDOMEventTarget** aRealEventTarget)
return GetTarget(aRealEventTarget);
}
NS_IMETHODIMP
nsDOMEvent::GetTmpRealOriginalTarget(nsIDOMEventTarget** aRealEventTarget)
{
if (mTmpRealOriginalTarget) {
*aRealEventTarget = mTmpRealOriginalTarget;
NS_ADDREF(*aRealEventTarget);
return NS_OK;
}
return GetOriginalTarget(aRealEventTarget);
}
NS_IMETHODIMP
nsDOMEvent::GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget)
{

View File

@ -267,8 +267,7 @@ protected:
nsEvent* mEvent;
nsRefPtr<nsPresContext> mPresContext;
nsCOMPtr<nsIDOMEventTarget> mTmpRealOriginalTarget;
nsIDOMEventTarget* mExplicitOriginalTarget;
nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget;
nsString mCachedType;
bool mEventIsInternal;
bool mPrivateDataDuplicated;

View File

@ -44,7 +44,7 @@
#endif
%}
[scriptable, uuid(9be8096b-f795-4045-9664-0c275f36fe5b)]
[scriptable, uuid(07F905C1-9170-4103-86CA-766374DA149A)]
interface nsIDOMNSEvent : nsISupports
{
const long MOUSEDOWN = 0x00000001;
@ -97,12 +97,6 @@ interface nsIDOMNSEvent : nsISupports
* contain anonymous content.
*/
readonly attribute nsIDOMEventTarget explicitOriginalTarget;
/* XXX This is TEMPORARY.
* The original target, without any retargeting (like textnode retargeting).
* This really needs to be in .originalTarget, but this is a less risky way of
* fixing it.
*/
[noscript] readonly attribute nsIDOMEventTarget tmpRealOriginalTarget;
/**
* @deprecated Use nsIDOMEvent::stopPropagation.

View File

@ -152,12 +152,6 @@ NS_IMETHODIMP nsSmartCardEvent::GetExplicitOriginalTarget(nsIDOMEventTarget * *a
return mNSEvent->GetExplicitOriginalTarget(aTarget);
}
NS_IMETHODIMP nsSmartCardEvent::GetTmpRealOriginalTarget(nsIDOMEventTarget * *aTarget)
{
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
return mNSEvent->GetTmpRealOriginalTarget(aTarget);
}
NS_IMETHODIMP nsSmartCardEvent::PreventBubble(void)
{
NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");