summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
Diffstat (limited to 'layout')
-rw-r--r--layout/generic/nsSelection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp
index f2959dc9d..5ccb2d8bf 100644
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -3844,7 +3844,7 @@ Selection::AddItem(nsRange* aItem, int32_t* aOutIndex, bool aNoStartSelect)
if (mUserInitiated) {
AutoTArray<RefPtr<nsRange>, 4> rangesToAdd;
- *aOutIndex = -1;
+ *aOutIndex = int32_t(mRanges.Length()) - 1;
nsIDocument* doc = GetParentObject();
bool selectEventsEnabled =