summaryrefslogtreecommitdiffstats
path: root/layout/forms/nsTextControlFrame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/forms/nsTextControlFrame.cpp')
-rw-r--r--layout/forms/nsTextControlFrame.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp
index aa3185d39..b34e132e6 100644
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -758,7 +758,12 @@ nsTextControlFrame::SetSelectionInternal(nsIDOMNode *aStartNode,
// we have access to the node.
nsCOMPtr<nsINode> start = do_QueryInterface(aStartNode);
nsCOMPtr<nsINode> end = do_QueryInterface(aEndNode);
- nsresult rv = range->Set(start, aStartOffset, end, aEndOffset);
+ // XXXbz nsRange::SetStartAndEnd takes int32_t (and ranges generally work on
+ // int32_t), but we're passing uint32_t. The good news is that at this point
+ // our endpoints should really be within our length, so not really that big.
+ // And if they _are_ that big, SetStartAndEnd() will simply error out, which
+ // is not too bad for a case we don't expect to happen.
+ nsresult rv = range->SetStartAndEnd(start, aStartOffset, end, aEndOffset);
NS_ENSURE_SUCCESS(rv, rv);
// Get the selection, clear it and add the new range to it!