Skip to content

Commit

Permalink
Bug 1662124 - element.setPointerCapture should throw NotFoundError if…
Browse files Browse the repository at this point in the history
… the pointer id is invalid; r=smaug

w3c/pointerevents#256

Differential Revision: https://phabricator.services.mozilla.com/D88859
  • Loading branch information
EdgarChen committed Aug 31, 2020
1 parent defa918 commit 259f467
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
8 changes: 4 additions & 4 deletions dom/base/Element.h
Expand Up @@ -1192,11 +1192,11 @@ class Element : public FragmentOrElement {
bool activeState = false;
if (nsContentUtils::ShouldResistFingerprinting(GetComposedDoc()) &&
aPointerId != PointerEventHandler::GetSpoofedPointerIdForRFP()) {
aError.Throw(NS_ERROR_DOM_INVALID_POINTER_ERR);
aError.ThrowNotFoundError("Invalid pointer id");
return;
}
if (!PointerEventHandler::GetPointerInfo(aPointerId, activeState)) {
aError.Throw(NS_ERROR_DOM_INVALID_POINTER_ERR);
aError.ThrowNotFoundError("Invalid pointer id");
return;
}
if (!IsInComposedDoc()) {
Expand All @@ -1218,11 +1218,11 @@ class Element : public FragmentOrElement {
bool activeState = false;
if (nsContentUtils::ShouldResistFingerprinting(GetComposedDoc()) &&
aPointerId != PointerEventHandler::GetSpoofedPointerIdForRFP()) {
aError.Throw(NS_ERROR_DOM_INVALID_POINTER_ERR);
aError.ThrowNotFoundError("Invalid pointer id");
return;
}
if (!PointerEventHandler::GetPointerInfo(aPointerId, activeState)) {
aError.Throw(NS_ERROR_DOM_INVALID_POINTER_ERR);
aError.ThrowNotFoundError("Invalid pointer id");
return;
}
if (HasPointerCapture(aPointerId)) {
Expand Down
1 change: 0 additions & 1 deletion dom/base/domerr.msg
Expand Up @@ -30,7 +30,6 @@ DOM4_MSG_DEF(QuotaExceededError, "The quota has been exceeded.", NS_ERROR_DOM_QU
DOM4_MSG_DEF(TimeoutError, "The operation timed out.", NS_ERROR_DOM_TIMEOUT_ERR)
DOM4_MSG_DEF(InvalidNodeTypeError, "The supplied node is incorrect or has an incorrect ancestor for this operation.", NS_ERROR_DOM_INVALID_NODE_TYPE_ERR)
DOM4_MSG_DEF(DataCloneError, "The object could not be cloned.", NS_ERROR_DOM_DATA_CLONE_ERR)
DOM4_MSG_DEF(InvalidPointerId, "Invalid pointer id.", NS_ERROR_DOM_INVALID_POINTER_ERR)
DOM4_MSG_DEF(NotAllowedError, "The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.", NS_ERROR_DOM_NOT_ALLOWED_ERR)

/* StringEncoding API errors from http://wiki.whatwg.org/wiki/StringEncoding */
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion xpcom/base/ErrorList.py
Expand Up @@ -656,7 +656,6 @@ def SUCCESS(code):
errors["NS_ERROR_DOM_DATA_CLONE_ERR"] = FAILURE(25)
# StringEncoding API errors from http://wiki.whatwg.org/wiki/StringEncoding
errors["NS_ERROR_DOM_ENCODING_NOT_SUPPORTED_ERR"] = FAILURE(28)
errors["NS_ERROR_DOM_INVALID_POINTER_ERR"] = FAILURE(29)
# WebCrypto API errors from http://www.w3.org/TR/WebCryptoAPI/
errors["NS_ERROR_DOM_UNKNOWN_ERR"] = FAILURE(30)
errors["NS_ERROR_DOM_DATA_ERR"] = FAILURE(31)
Expand Down

0 comments on commit 259f467

Please sign in to comment.