Bug 1417376 Part 2 - Pass nsPoint parameters by const references instead of references.
MozReview-Commit-ID: 6TveqwkOvc0
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -2171,17 +2171,17 @@ Selection::SetTextRangeStyle(nsRange* aR
RangeData *rd = FindRangeData(aRange);
if (rd) {
rd->mTextRangeStyle = aTextRangeStyle;
}
return NS_OK;
}
nsresult
-Selection::StartAutoScrollTimer(nsIFrame* aFrame, nsPoint& aPoint,
+Selection::StartAutoScrollTimer(nsIFrame* aFrame, const nsPoint& aPoint,
uint32_t aDelay)
{
NS_PRECONDITION(aFrame, "Need a frame");
nsresult result;
if (!mFrameSelection) {
return NS_OK;//nothing to do
}
--- a/dom/base/Selection.h
+++ b/dom/base/Selection.h
@@ -171,18 +171,18 @@ public:
int32_t aContentLength,
UniquePtr<SelectionDetails> aDetailsHead,
SelectionType aSelectionType,
bool aSlowCheck);
NS_IMETHOD Repaint(nsPresContext* aPresContext);
// Note: StartAutoScrollTimer might destroy arbitrary frames etc.
- nsresult StartAutoScrollTimer(nsIFrame *aFrame,
- nsPoint& aPoint,
+ nsresult StartAutoScrollTimer(nsIFrame* aFrame,
+ const nsPoint& aPoint,
uint32_t aDelay);
nsresult StopAutoScrollTimer();
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
// WebIDL methods
nsINode* GetAnchorNode();
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -419,20 +419,20 @@ nsFrameSelection::InvalidateDesiredPos()
void
nsFrameSelection::SetDesiredPos(nsPoint aPos)
{
mDesiredPos = aPos;
mDesiredPosSet = true;
}
nsresult
-nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree(nsIFrame *aFrame,
- nsPoint& aPoint,
- nsIFrame **aRetFrame,
- nsPoint& aRetPoint)
+nsFrameSelection::ConstrainFrameAndPointToAnchorSubtree(nsIFrame* aFrame,
+ const nsPoint& aPoint,
+ nsIFrame** aRetFrame,
+ nsPoint& aRetPoint)
{
//
// The whole point of this method is to return a frame and point that
// that lie within the same valid subtree as the anchor node's frame,
// for use with the method GetContentAndOffsetsFromPoint().
//
// A valid subtree is defined to be one where all the content nodes in
// the tree have a valid parent-child relationship.
--- a/layout/generic/nsFrameSelection.h
+++ b/layout/generic/nsFrameSelection.h
@@ -603,19 +603,19 @@ public:
* Dragging or extending selection will never allow for a subset
* (or the whole) of the maintained selection to become unselected.
* Primary use: double click selecting then dragging on second click
* @param aAmount the initial amount of text selected (word, line or paragraph).
* For "line", use eSelectBeginLine.
*/
nsresult MaintainSelection(nsSelectionAmount aAmount = eSelectNoAmount);
- nsresult ConstrainFrameAndPointToAnchorSubtree(nsIFrame *aFrame,
- nsPoint& aPoint,
- nsIFrame **aRetFrame,
+ nsresult ConstrainFrameAndPointToAnchorSubtree(nsIFrame* aFrame,
+ const nsPoint& aPoint,
+ nsIFrame** aRetFrame,
nsPoint& aRetPoint);
nsFrameSelection();
void StartBatchChanges();
void EndBatchChanges(int16_t aReason = nsISelectionListener::NO_REASON);
/*unsafe*/