Bug 1259665 part.3 Rename WidgetPointerEvent::isPrimary to mIsPrimary r?smaug
MozReview-Commit-ID: LfKzpwCjMcz
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -763,17 +763,18 @@ nsDOMWindowUtils::SendPointerEventCommon
event.buttons = nsContentUtils::GetButtonsFlagForButton(aButton);
event.pressure = aPressure;
event.inputSource = aInputSourceArg;
event.pointerId = aPointerId;
event.mWidth = aWidth;
event.mHeight = aHeight;
event.tiltX = aTiltX;
event.tiltY = aTiltY;
- event.isPrimary = (nsIDOMMouseEvent::MOZ_SOURCE_MOUSE == aInputSourceArg) ? true : aIsPrimary;
+ event.mIsPrimary =
+ (nsIDOMMouseEvent::MOZ_SOURCE_MOUSE == aInputSourceArg) ? true : aIsPrimary;
event.mClickCount = aClickCount;
event.mTime = PR_IntervalNow();
event.mFlags.mIsSynthesizedForTests = aOptionalArgCount >= 10 ? aIsSynthesized : true;
nsPresContext* presContext = GetPresContext();
if (!presContext) {
return NS_ERROR_FAILURE;
}
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3829,17 +3829,17 @@ CreateMouseOrPointerWidgetEvent(WidgetMo
if (sourcePointer) {
PROFILER_LABEL("Input", "DispatchPointerEvent",
js::ProfileEntry::Category::EVENTS);
nsAutoPtr<WidgetPointerEvent> newPointerEvent;
newPointerEvent =
new WidgetPointerEvent(aMouseEvent->IsTrusted(), aMessage,
aMouseEvent->mWidget);
- newPointerEvent->isPrimary = sourcePointer->isPrimary;
+ newPointerEvent->mIsPrimary = sourcePointer->mIsPrimary;
newPointerEvent->pointerId = sourcePointer->pointerId;
newPointerEvent->mWidth = sourcePointer->mWidth;
newPointerEvent->mHeight = sourcePointer->mHeight;
newPointerEvent->inputSource = sourcePointer->inputSource;
newPointerEvent->relatedTarget =
nsIPresShell::GetPointerCapturingContent(sourcePointer->pointerId)
? nullptr
: aRelatedContent;
--- a/dom/events/PointerEvent.cpp
+++ b/dom/events/PointerEvent.cpp
@@ -88,17 +88,17 @@ PointerEvent::Constructor(EventTarget* a
WidgetPointerEvent* widgetEvent = e->mEvent->AsPointerEvent();
widgetEvent->pointerId = aParam.mPointerId;
widgetEvent->mWidth = aParam.mWidth;
widgetEvent->mHeight = aParam.mHeight;
widgetEvent->pressure = aParam.mPressure;
widgetEvent->tiltX = aParam.mTiltX;
widgetEvent->tiltY = aParam.mTiltY;
widgetEvent->inputSource = ConvertStringToPointerType(aParam.mPointerType);
- widgetEvent->isPrimary = aParam.mIsPrimary;
+ widgetEvent->mIsPrimary = aParam.mIsPrimary;
widgetEvent->buttons = aParam.mButtons;
e->SetTrusted(trusted);
return e.forget();
}
// static
already_AddRefed<PointerEvent>
@@ -151,17 +151,17 @@ int32_t
PointerEvent::TiltY()
{
return mEvent->AsPointerEvent()->tiltY;
}
bool
PointerEvent::IsPrimary()
{
- return mEvent->AsPointerEvent()->isPrimary;
+ return mEvent->AsPointerEvent()->mIsPrimary;
}
} // namespace dom
} // namespace mozilla
using namespace mozilla;
using namespace mozilla::dom;
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6825,39 +6825,44 @@ nsIPresShell::GetPointerInfo(uint32_t aP
void
PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
{
switch (aEvent->mMessage) {
case eMouseEnterIntoWidget:
// In this case we have to know information about available mouse pointers
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
gActivePointersIds->Put(mouseEvent->pointerId,
- new PointerInfo(false, mouseEvent->inputSource, true));
+ new PointerInfo(false, mouseEvent->inputSource,
+ true));
}
break;
case ePointerDown:
// In this case we switch pointer to active state
if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
gActivePointersIds->Put(pointerEvent->pointerId,
- new PointerInfo(true, pointerEvent->inputSource, pointerEvent->isPrimary));
+ new PointerInfo(true, pointerEvent->inputSource,
+ pointerEvent->mIsPrimary));
}
break;
case ePointerUp:
// In this case we remove information about pointer or turn off active state
if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
if(pointerEvent->inputSource != nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
gActivePointersIds->Put(pointerEvent->pointerId,
- new PointerInfo(false, pointerEvent->inputSource, pointerEvent->isPrimary));
+ new PointerInfo(false,
+ pointerEvent->inputSource,
+ pointerEvent->mIsPrimary));
} else {
gActivePointersIds->Remove(pointerEvent->pointerId);
}
}
break;
case eMouseExitFromWidget:
- // In this case we have to remove information about disappeared mouse pointers
+ // In this case we have to remove information about disappeared mouse
+ // pointers
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
gActivePointersIds->Remove(mouseEvent->pointerId);
}
break;
default:
break;
}
}
@@ -7191,17 +7196,17 @@ DispatchPointerFromMouseOrTouch(PresShel
for (uint32_t i = 0; i < touchEvent->mTouches.Length(); ++i) {
mozilla::dom::Touch* touch = touchEvent->mTouches[i];
if (!touch || !touch->convertToPointer) {
continue;
}
WidgetPointerEvent event(touchEvent->IsTrusted(), pointerMessage,
touchEvent->mWidget);
- event.isPrimary = i == 0;
+ event.mIsPrimary = i == 0;
event.pointerId = touch->Identifier();
event.mRefPoint = touch->mRefPoint;
event.mModifiers = touchEvent->mModifiers;
event.mWidth = touch->RadiusX();
event.mHeight = touch->RadiusY();
event.tiltX = touch->tiltX;
event.tiltY = touch->tiltY;
event.mTime = touchEvent->mTime;
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -663,36 +663,36 @@ private:
class WidgetPointerEvent : public WidgetMouseEvent
{
friend class mozilla::dom::PBrowserParent;
friend class mozilla::dom::PBrowserChild;
WidgetPointerEvent()
: mWidth(0)
, mHeight(0)
- , isPrimary(true)
+ , mIsPrimary(true)
{
}
public:
virtual WidgetPointerEvent* AsPointerEvent() override { return this; }
WidgetPointerEvent(bool aIsTrusted, EventMessage aMsg, nsIWidget* w)
: WidgetMouseEvent(aIsTrusted, aMsg, w, ePointerEventClass, eReal)
, mWidth(0)
, mHeight(0)
- , isPrimary(true)
+ , mIsPrimary(true)
{
}
explicit WidgetPointerEvent(const WidgetMouseEvent& aEvent)
: WidgetMouseEvent(aEvent)
, mWidth(0)
, mHeight(0)
- , isPrimary(true)
+ , mIsPrimary(true)
{
mClass = ePointerEventClass;
}
virtual WidgetEvent* Duplicate() const override
{
MOZ_ASSERT(mClass == ePointerEventClass,
"Duplicate() must be overridden by sub class");
@@ -701,25 +701,25 @@ public:
new WidgetPointerEvent(false, mMessage, nullptr);
result->AssignPointerEventData(*this, true);
result->mFlags = mFlags;
return result;
}
uint32_t mWidth;
uint32_t mHeight;
- bool isPrimary;
+ bool mIsPrimary;
// XXX Not tested by test_assign_event_data.html
void AssignPointerEventData(const WidgetPointerEvent& aEvent,
bool aCopyTargets)
{
AssignMouseEventData(aEvent, aCopyTargets);
mWidth = aEvent.mWidth;
mHeight = aEvent.mHeight;
- isPrimary = aEvent.isPrimary;
+ mIsPrimary = aEvent.mIsPrimary;
}
};
} // namespace mozilla
#endif // mozilla_MouseEvents_h__
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -286,29 +286,29 @@ struct ParamTraits<mozilla::WidgetPointe
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam));
WriteParam(aMsg, aParam.pointerId);
WriteParam(aMsg, aParam.mWidth);
WriteParam(aMsg, aParam.mHeight);
WriteParam(aMsg, aParam.tiltX);
WriteParam(aMsg, aParam.tiltY);
- WriteParam(aMsg, aParam.isPrimary);
+ WriteParam(aMsg, aParam.mIsPrimary);
}
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
bool rv =
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
ReadParam(aMsg, aIter, &aResult->pointerId) &&
ReadParam(aMsg, aIter, &aResult->mWidth) &&
ReadParam(aMsg, aIter, &aResult->mHeight) &&
ReadParam(aMsg, aIter, &aResult->tiltX) &&
ReadParam(aMsg, aIter, &aResult->tiltY) &&
- ReadParam(aMsg, aIter, &aResult->isPrimary);
+ ReadParam(aMsg, aIter, &aResult->mIsPrimary);
return rv;
}
};
template<>
struct ParamTraits<mozilla::WidgetTouchEvent>
{
typedef mozilla::WidgetTouchEvent paramType;