diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-23 09:16:50 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-23 09:16:50 +0200 |
commit | 0a9acadccafe04aa5bc3335523bb55fe52ca8e50 (patch) | |
tree | ab49c5db5979719019b24c9086aa3701655702d5 /layout/generic/nsSelection.cpp | |
parent | c30ebdac27c93b57e368c69e9c13055a17229992 (diff) | |
download | UXP-0a9acadccafe04aa5bc3335523bb55fe52ca8e50.tar UXP-0a9acadccafe04aa5bc3335523bb55fe52ca8e50.tar.gz UXP-0a9acadccafe04aa5bc3335523bb55fe52ca8e50.tar.lz UXP-0a9acadccafe04aa5bc3335523bb55fe52ca8e50.tar.xz UXP-0a9acadccafe04aa5bc3335523bb55fe52ca8e50.zip |
moebius#121: DOM - Selection API - getSelection() should exist on XMLDocument / Selection.type
https://github.com/MoonchildProductions/moebius/pull/121
Diffstat (limited to 'layout/generic/nsSelection.cpp')
-rw-r--r-- | layout/generic/nsSelection.cpp | 12 |
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) { |