summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsSelection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/generic/nsSelection.cpp')
-rw-r--r--layout/generic/nsSelection.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp
index e0d65632e..a2227c39c 100644
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -5349,6 +5349,18 @@ Selection::GetRangeCount(int32_t* aRangeCount)
return NS_OK;
}
+void
+Selection::GetType(nsAString& aOutType) const
+{
+ if (!RangeCount()) {
+ aOutType.AssignLiteral("None");
+ } else if (IsCollapsed()) {
+ aOutType.AssignLiteral("Caret");
+ } else {
+ aOutType.AssignLiteral("Range");
+ }
+}
+
NS_IMETHODIMP
Selection::GetRangeAt(int32_t aIndex, nsIDOMRange** aReturn)
{