From fa080f402cad146e2ade8eedab057c8855b3615e Mon Sep 17 00:00:00 2001 From: Jeremy Chen Date: Fri, 17 Nov 2017 17:03:15 +0800 Subject: [PATCH] Bug 1387176 - switch nsFrameSelection to use per-member defaults. r=TYLin Many members of nsFrameSelection are uninitialized, which could cause some potential issues. In this patch, we use per-member defaults for nsFrameSelection, and make sure we initialize all the members properly. MozReview-Commit-ID: H9MMlSZoinh --HG-- extra : rebase_source : c68ac4f61a687fd981363efa924fdbb2e0804b10 --- layout/generic/nsFrameSelection.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsFrameSelection.h b/layout/generic/nsFrameSelection.h index de8406fec783..92dd44c4aa16 100644 --- a/layout/generic/nsFrameSelection.h +++ b/layout/generic/nsFrameSelection.h @@ -747,7 +747,7 @@ private: // maintain selection RefPtr mMaintainRange; - nsSelectionAmount mMaintainedAmount; + nsSelectionAmount mMaintainedAmount = eSelectNoAmount; //batching int32_t mBatching = 0; @@ -757,7 +757,7 @@ private: // Limit selection navigation to a descendant of this node. nsCOMPtr mAncestorLimiter; - nsIPresShell *mShell; + nsIPresShell* mShell = nullptr; // Reason for notifications of selection changing. int16_t mSelectionChangeReason = nsISelectionListener::NO_REASON; // For visual display purposes. @@ -779,12 +779,12 @@ private: bool mChangesDuringBatching = false; bool mNotifyFrames = true; bool mDragSelectingCells = false; - bool mDragState; //for drag purposes + bool mDragState = false; //for drag purposes bool mMouseDoubleDownState = false; //has the doubleclick down happened bool mDesiredPosSet = false; bool mAccessibleCaretEnabled = false; - int8_t mCaretMovementStyle; + int8_t mCaretMovementStyle = 0; static bool sSelectionEventsEnabled; static bool sSelectionEventsOnTextControlsEnabled;