зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1390382 - Part 1: Inline Selection::IsCollapsed(); r=smaug
This commit is contained in:
Родитель
2413c60be8
Коммит
dea2e72d91
|
@ -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()
|
||||
|
|
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче