Bug 1323400 - Part 1: Mark Touch::Equals as a const method; r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D18232

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edgar Chen 2019-02-15 16:28:35 +00:00
parent 7f0a1d33d8
commit 0518b15392
3 changed files with 4 additions and 4 deletions

View File

@ -180,7 +180,7 @@ void Touch::SetTouchTarget(EventTarget* aTarget) {
mTarget = aTarget;
}
bool Touch::Equals(Touch* aTouch) {
bool Touch::Equals(Touch* aTouch) const {
return mRefPoint == aTouch->mRefPoint && mForce == aTouch->mForce &&
mRotationAngle == aTouch->mRotationAngle &&
mRadius.x == aTouch->mRadius.x && mRadius.y == aTouch->mRadius.y;

View File

@ -48,7 +48,7 @@ class Touch final : public nsISupports,
// Note, this sets both mOriginalTarget and mTarget.
void SetTouchTarget(EventTarget* aTarget);
bool Equals(Touch* aTouch);
bool Equals(Touch* aTouch) const;
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;

View File

@ -273,8 +273,8 @@ bool TouchManager::PreHandleEvent(WidgetEvent* aEvent, nsEventStatus* aStatus,
touches.RemoveElementAt(i);
continue;
}
RefPtr<Touch> oldTouch = info.mTouch;
if (!touch->Equals(oldTouch)) {
const RefPtr<Touch> oldTouch = info.mTouch;
if (!oldTouch->Equals(touch)) {
touch->mChanged = true;
haveChanged = true;
}