Bug 1417376 Part 1 - Change nsPoint parameter to pass by value for DoAutoScroll().
This private method DoAutoScroll() modifies aPoint inside of it, and none of
other callers (StartAutoScrollTimer() and nsAutoScrollTimer::Notify()) read
aPoint afterwards, so we make aPoint pass by value rather than pass by
non-const-reference. This is necessary for later parts.
MozReview-Commit-ID: 9PtxFXIka7X
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -2210,17 +2210,17 @@ Selection::StopAutoScrollTimer()
{
if (mAutoScrollTimer) {
return mAutoScrollTimer->Stop();
}
return NS_OK;
}
nsresult
-Selection::DoAutoScroll(nsIFrame* aFrame, nsPoint& aPoint)
+Selection::DoAutoScroll(nsIFrame* aFrame, nsPoint aPoint)
{
NS_PRECONDITION(aFrame, "Need a frame");
if (mAutoScrollTimer) {
(void)mAutoScrollTimer->Stop();
}
nsPresContext* presContext = aFrame->PresContext();
--- a/dom/base/Selection.h
+++ b/dom/base/Selection.h
@@ -329,17 +329,17 @@ public:
*/
nsresult SetTextRangeStyle(nsRange* aRange,
const TextRangeStyle& aTextRangeStyle);
private:
friend class ::nsAutoScrollTimer;
// Note: DoAutoScroll might destroy arbitrary frames etc.
- nsresult DoAutoScroll(nsIFrame *aFrame, nsPoint& aPoint);
+ nsresult DoAutoScroll(nsIFrame* aFrame, nsPoint aPoint);
// We are not allowed to be in nodes whose root is not our document
bool HasSameRoot(nsINode& aNode);
// XXX Please don't add additional uses of this method, it's only for
// XXX supporting broken code (bug 1245883) in the following classes:
friend class ::nsCopySupport;
friend class ::nsHTMLCopyEncoder;