1 /* -*- Mode: IDL; 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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * http://dom.spec.whatwg.org/#range
8 * http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment
9 * http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface
11 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
12 * liability, trademark and document use rules apply.
18 readonly attribute Node startContainer;
20 readonly attribute unsigned long startOffset;
22 readonly attribute Node endContainer;
24 readonly attribute unsigned long endOffset;
25 readonly attribute boolean collapsed;
27 readonly attribute Node commonAncestorContainer;
30 void setStart(Node refNode, unsigned long offset);
32 void setEnd(Node refNode, unsigned long offset);
34 void setStartBefore(Node refNode);
36 void setStartAfter(Node refNode);
38 void setEndBefore(Node refNode);
40 void setEndAfter(Node refNode);
41 void collapse(optional boolean toStart = false);
43 void selectNode(Node refNode);
45 void selectNodeContents(Node refNode);
47 const unsigned short START_TO_START = 0;
48 const unsigned short START_TO_END = 1;
49 const unsigned short END_TO_END = 2;
50 const unsigned short END_TO_START = 3;
52 short compareBoundaryPoints(unsigned short how, Range sourceRange);
54 void deleteContents();
56 DocumentFragment extractContents();
58 DocumentFragment cloneContents();
60 void insertNode(Node node);
62 void surroundContents(Node newParent);
68 boolean isPointInRange(Node node, unsigned long offset);
70 short comparePoint(Node node, unsigned long offset);
73 boolean intersectsNode(Node node);
78 // http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment
79 partial interface Range {
81 DocumentFragment createContextualFragment(DOMString fragment);
84 // http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface
85 partial interface Range {
86 DOMRectList? getClientRects();
87 DOMRect getBoundingClientRect();