Bug 726933 - Add a deprecation warning to getPreventDefault. r=smaug

This commit is contained in:
Masatoshi Kimura 2013-05-27 23:43:51 +09:00
parent dfdb68d68a
commit 18fd56d251
4 changed files with 15 additions and 4 deletions

View File

@ -30,3 +30,4 @@ DEPRECATED_OPERATION(PrefixedVisibilityAPI)
DEPRECATED_OPERATION(NodeIteratorDetach)
DEPRECATED_OPERATION(MozAudioData)
DEPRECATED_OPERATION(LenientThis)
DEPRECATED_OPERATION(GetPreventDefault)

View File

@ -1220,6 +1220,17 @@ const char* nsDOMEvent::GetEventName(uint32_t aEventType)
return nullptr;
}
bool
nsDOMEvent::GetPreventDefault() const
{
if (mOwner) {
if (nsIDocument* doc = mOwner->GetExtantDoc()) {
doc->WarnOnceAbout(nsIDocument::eGetPreventDefault);
}
}
return DefaultPrevented();
}
NS_IMETHODIMP
nsDOMEvent::GetPreventDefault(bool* aReturn)
{

View File

@ -189,10 +189,7 @@ public:
mozilla::dom::EventTarget* GetOriginalTarget() const;
mozilla::dom::EventTarget* GetExplicitOriginalTarget() const;
bool GetPreventDefault() const
{
return DefaultPrevented();
}
bool GetPreventDefault() const;
protected:

View File

@ -130,3 +130,5 @@ MozAudioDataWarning=The Mozilla Audio Data API is deprecated. Please use the We
LenientThisWarning=Ignoring get or set of property that has [LenientThis] because the "this" object is incorrect.
# LOCALIZATION NOTE: Do not translate "nsIDOMWindowUtils", "getWindowWithOuterId", or "nsIWindowMediator"
GetWindowWithOuterIdWarning=Use of nsIDOMWindowUtils.getOuterWindowWithId() is deprecated. Instead, use the nsIWindowMediator method of the same name.
# LOCALIZATION NOTE: Do not translate "getPreventDefault" or "defaultPrevented".
GetPreventDefaultWarning=Use of getPreventDefault() is deprecated. Use defaultPrevented instead.