blob: d8f8e7828720cc8e39587eefc449c09d84829a23 [file] [log] [blame]
Victor Porof6e096922022-06-10 13:01:05 +00001// GENERATED CONTENT - DO NOT EDIT
2// Content was automatically extracted by Reffy into webref
3// (https://github.com/w3c/webref)
4// Source: Selection API (https://w3c.github.io/selection-api/)
5
6[Exposed=Window]
7interface Selection {
8 readonly attribute Node? anchorNode;
9 readonly attribute unsigned long anchorOffset;
10 readonly attribute Node? focusNode;
11 readonly attribute unsigned long focusOffset;
12 readonly attribute boolean isCollapsed;
13 readonly attribute unsigned long rangeCount;
14 readonly attribute DOMString type;
15 Range getRangeAt(unsigned long index);
16 undefined addRange(Range range);
17 undefined removeRange(Range range);
18 undefined removeAllRanges();
19 undefined empty();
20 undefined collapse(Node? node, optional unsigned long offset = 0);
21 undefined setPosition(Node? node, optional unsigned long offset = 0);
22 undefined collapseToStart();
23 undefined collapseToEnd();
24 undefined extend(Node node, optional unsigned long offset = 0);
25 undefined setBaseAndExtent(Node anchorNode, unsigned long anchorOffset, Node focusNode, unsigned long focusOffset);
26 undefined selectAllChildren(Node node);
27 [CEReactions]
28 undefined deleteFromDocument();
29 boolean containsNode(Node node, optional boolean allowPartialContainment = false);
30 stringifier;
31};
32
33partial interface Document {
34 Selection? getSelection();
35};
36
37partial interface Window {
38 Selection? getSelection();
39};
40
41partial interface mixin GlobalEventHandlers {
42 attribute EventHandler onselectstart;
43 attribute EventHandler onselectionchange;
44};