Bug 1850635 [wpt PR 41704] - Implement parseHTMLUnsafe and setHTMLUnsafe, a=testonly
[gecko.git] / accessible / interfaces / nsIAccessibleTextRange.idl
blob5a3e6facaf8f936f9d66674fe0021905297b1016
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIAccessible;
9 interface nsIAccessibleText;
10 interface nsIArray;
11 interface nsIVariant;
13 /**
14 * A range representing a piece of text in the document.
16 [scriptable, builtinclass, uuid(c4515623-55f9-4543-a3d5-c1e9afa588f4)]
17 interface nsIAccessibleTextRange : nsISupports
19 readonly attribute nsIAccessibleText startContainer;
20 readonly attribute long startOffset;
21 readonly attribute nsIAccessibleText endContainer;
22 readonly attribute long endOffset;
24 /**
25 * Return an accessible containing the whole range
27 readonly attribute nsIAccessible container;
29 /**
30 * Return true if this range has the same end points of the given range.
32 boolean compare(in nsIAccessibleTextRange aOtherRange);
34 /**
35 * The two endpoints of the range (starting and ending).
37 const unsigned long EndPoint_Start = 1;
38 const unsigned long EndPoint_End = 2;
40 /**
41 * Compare this and given ranges end points.
43 * @return -1/0/1 if this range end point is before/equal/after the given
44 * range end point.
46 long compareEndPoints(in unsigned long aEndPoint,
47 in nsIAccessibleTextRange aOtherRange,
48 in unsigned long aOtherRangeEndPoint);
50 /**
51 * Crops the range by the given accessible element.
53 boolean crop(in nsIAccessible aContainer);
55 const unsigned long AlignToTop = 0;
56 const unsigned long AlignToBottom = 1;