1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/Range.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,88 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * The origin of this IDL file is 1.10 + * http://dom.spec.whatwg.org/#range 1.11 + * http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment 1.12 + * http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface 1.13 + * 1.14 + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C 1.15 + * liability, trademark and document use rules apply. 1.16 + */ 1.17 + 1.18 +[Constructor] 1.19 +interface Range { 1.20 + [Throws] 1.21 + readonly attribute Node startContainer; 1.22 + [Throws] 1.23 + readonly attribute unsigned long startOffset; 1.24 + [Throws] 1.25 + readonly attribute Node endContainer; 1.26 + [Throws] 1.27 + readonly attribute unsigned long endOffset; 1.28 + readonly attribute boolean collapsed; 1.29 + [Throws] 1.30 + readonly attribute Node commonAncestorContainer; 1.31 + 1.32 + [Throws] 1.33 + void setStart(Node refNode, unsigned long offset); 1.34 + [Throws] 1.35 + void setEnd(Node refNode, unsigned long offset); 1.36 + [Throws] 1.37 + void setStartBefore(Node refNode); 1.38 + [Throws] 1.39 + void setStartAfter(Node refNode); 1.40 + [Throws] 1.41 + void setEndBefore(Node refNode); 1.42 + [Throws] 1.43 + void setEndAfter(Node refNode); 1.44 + void collapse(optional boolean toStart = false); 1.45 + [Throws] 1.46 + void selectNode(Node refNode); 1.47 + [Throws] 1.48 + void selectNodeContents(Node refNode); 1.49 + 1.50 + const unsigned short START_TO_START = 0; 1.51 + const unsigned short START_TO_END = 1; 1.52 + const unsigned short END_TO_END = 2; 1.53 + const unsigned short END_TO_START = 3; 1.54 + [Throws] 1.55 + short compareBoundaryPoints(unsigned short how, Range sourceRange); 1.56 + [Throws] 1.57 + void deleteContents(); 1.58 + [Throws] 1.59 + DocumentFragment extractContents(); 1.60 + [Throws] 1.61 + DocumentFragment cloneContents(); 1.62 + [Throws] 1.63 + void insertNode(Node node); 1.64 + [Throws] 1.65 + void surroundContents(Node newParent); 1.66 + 1.67 + Range cloneRange(); 1.68 + void detach(); 1.69 + 1.70 + [Throws] 1.71 + boolean isPointInRange(Node node, unsigned long offset); 1.72 + [Throws] 1.73 + short comparePoint(Node node, unsigned long offset); 1.74 + 1.75 + [Throws] 1.76 + boolean intersectsNode(Node node); 1.77 + 1.78 + stringifier; 1.79 +}; 1.80 + 1.81 +// http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment 1.82 +partial interface Range { 1.83 + [Throws] 1.84 + DocumentFragment createContextualFragment(DOMString fragment); 1.85 +}; 1.86 + 1.87 +// http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface 1.88 +partial interface Range { 1.89 + DOMRectList? getClientRects(); 1.90 + DOMRect getBoundingClientRect(); 1.91 +};