diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index b064ec5c53a8..d91232ebd50e 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -2675,24 +2675,6 @@ Selection::CollapseToEnd(ErrorResult& aRv) Collapse(*container, lastRange->EndOffset(), aRv); } -/* - * IsCollapsed -- is the whole selection just one point, or unset? - */ -bool -Selection::IsCollapsed() const -{ - uint32_t cnt = mRanges.Length(); - if (cnt == 0) { - return true; - } - - if (cnt != 1) { - return false; - } - - return mRanges[0].mRange->Collapsed(); -} - /* virtual */ bool Selection::Collapsed() diff --git a/dom/base/Selection.h b/dom/base/Selection.h index 4606b6e8bb22..1facb5c8ae70 100644 --- a/dom/base/Selection.h +++ b/dom/base/Selection.h @@ -174,7 +174,22 @@ public: nsINode* GetFocusNode(); uint32_t FocusOffset(); - bool IsCollapsed() const; + /* + * IsCollapsed -- is the whole selection just one point, or unset? + */ + bool IsCollapsed() const + { + uint32_t cnt = mRanges.Length(); + if (cnt == 0) { + return true; + } + + if (cnt != 1) { + return false; + } + + return mRanges[0].mRange->Collapsed(); + } // *JS() methods are mapped to Selection.*(). // They may move focus only when the range represents normal selection.