mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
moebius#121: DOM - Selection API - getSelection() should exist on XMLDocument / Selection.type
https://github.com/MoonchildProductions/moebius/pull/121
This commit is contained in:
parent
f0c237ae6d
commit
9db39c42c0
10 changed files with 43 additions and 32 deletions
|
|
@ -179,6 +179,9 @@ public:
|
|||
{
|
||||
return mRanges.Length();
|
||||
}
|
||||
|
||||
void GetType(nsAString& aOutType) const;
|
||||
|
||||
nsRange* GetRangeAt(uint32_t aIndex, mozilla::ErrorResult& aRv);
|
||||
void AddRange(nsRange& aRange, mozilla::ErrorResult& aRv);
|
||||
void RemoveRange(nsRange& aRange, mozilla::ErrorResult& aRv);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue