mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 881252 - Warn use of getUserData() or setUserData(). r=bz
This commit is contained in:
parent
07cc85ecb9
commit
043ca816ee
@ -31,3 +31,4 @@ DEPRECATED_OPERATION(NodeIteratorDetach)
|
||||
DEPRECATED_OPERATION(MozAudioData)
|
||||
DEPRECATED_OPERATION(LenientThis)
|
||||
DEPRECATED_OPERATION(GetPreventDefault)
|
||||
DEPRECATED_OPERATION(GetSetUserData)
|
||||
|
@ -1111,15 +1111,7 @@ public:
|
||||
* @return aResult the previously registered object for aKey on this node, if
|
||||
* any
|
||||
*/
|
||||
nsIVariant* GetUserData(const nsAString& aKey)
|
||||
{
|
||||
nsCOMPtr<nsIAtom> key = do_GetAtom(aKey);
|
||||
if (!key) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<nsIVariant*>(GetProperty(DOM_USER_DATA, key));
|
||||
}
|
||||
nsIVariant* GetUserData(const nsAString& aKey);
|
||||
|
||||
nsresult GetUserData(const nsAString& aKey, nsIVariant** aResult)
|
||||
{
|
||||
|
@ -637,6 +637,7 @@ nsresult
|
||||
nsINode::SetUserData(const nsAString &aKey, nsIVariant *aData,
|
||||
nsIDOMUserDataHandler *aHandler, nsIVariant **aResult)
|
||||
{
|
||||
OwnerDoc()->WarnOnceAbout(nsIDocument::eGetSetUserData);
|
||||
*aResult = nullptr;
|
||||
|
||||
nsCOMPtr<nsIAtom> key = do_GetAtom(aKey);
|
||||
@ -707,6 +708,18 @@ nsINode::SetUserData(JSContext* aCx, const nsAString& aKey,
|
||||
return result;
|
||||
}
|
||||
|
||||
nsIVariant*
|
||||
nsINode::GetUserData(const nsAString& aKey)
|
||||
{
|
||||
OwnerDoc()->WarnOnceAbout(nsIDocument::eGetSetUserData);
|
||||
nsCOMPtr<nsIAtom> key = do_GetAtom(aKey);
|
||||
if (!key) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<nsIVariant*>(GetProperty(DOM_USER_DATA, key));
|
||||
}
|
||||
|
||||
JS::Value
|
||||
nsINode::GetUserData(JSContext* aCx, const nsAString& aKey, ErrorResult& aError)
|
||||
{
|
||||
|
@ -132,3 +132,5 @@ LenientThisWarning=Ignoring get or set of property that has [LenientThis] becaus
|
||||
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.
|
||||
# LOCALIZATION NOTE: Do not translate "getUserData", "setUserData", "WeakMap", or "element.dataset".
|
||||
GetSetUserDataWarning=Use of getUserData() or setUserData() is deprecated. Use WeakMap or element.dataset instead.
|
||||
|
Loading…
Reference in New Issue
Block a user