Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | * |
michael@0 | 6 | * The origin of this IDL file is |
michael@0 | 7 | * http://dom.spec.whatwg.org/#range |
michael@0 | 8 | * http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment |
michael@0 | 9 | * http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface |
michael@0 | 10 | * |
michael@0 | 11 | * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C |
michael@0 | 12 | * liability, trademark and document use rules apply. |
michael@0 | 13 | */ |
michael@0 | 14 | |
michael@0 | 15 | [Constructor] |
michael@0 | 16 | interface Range { |
michael@0 | 17 | [Throws] |
michael@0 | 18 | readonly attribute Node startContainer; |
michael@0 | 19 | [Throws] |
michael@0 | 20 | readonly attribute unsigned long startOffset; |
michael@0 | 21 | [Throws] |
michael@0 | 22 | readonly attribute Node endContainer; |
michael@0 | 23 | [Throws] |
michael@0 | 24 | readonly attribute unsigned long endOffset; |
michael@0 | 25 | readonly attribute boolean collapsed; |
michael@0 | 26 | [Throws] |
michael@0 | 27 | readonly attribute Node commonAncestorContainer; |
michael@0 | 28 | |
michael@0 | 29 | [Throws] |
michael@0 | 30 | void setStart(Node refNode, unsigned long offset); |
michael@0 | 31 | [Throws] |
michael@0 | 32 | void setEnd(Node refNode, unsigned long offset); |
michael@0 | 33 | [Throws] |
michael@0 | 34 | void setStartBefore(Node refNode); |
michael@0 | 35 | [Throws] |
michael@0 | 36 | void setStartAfter(Node refNode); |
michael@0 | 37 | [Throws] |
michael@0 | 38 | void setEndBefore(Node refNode); |
michael@0 | 39 | [Throws] |
michael@0 | 40 | void setEndAfter(Node refNode); |
michael@0 | 41 | void collapse(optional boolean toStart = false); |
michael@0 | 42 | [Throws] |
michael@0 | 43 | void selectNode(Node refNode); |
michael@0 | 44 | [Throws] |
michael@0 | 45 | void selectNodeContents(Node refNode); |
michael@0 | 46 | |
michael@0 | 47 | const unsigned short START_TO_START = 0; |
michael@0 | 48 | const unsigned short START_TO_END = 1; |
michael@0 | 49 | const unsigned short END_TO_END = 2; |
michael@0 | 50 | const unsigned short END_TO_START = 3; |
michael@0 | 51 | [Throws] |
michael@0 | 52 | short compareBoundaryPoints(unsigned short how, Range sourceRange); |
michael@0 | 53 | [Throws] |
michael@0 | 54 | void deleteContents(); |
michael@0 | 55 | [Throws] |
michael@0 | 56 | DocumentFragment extractContents(); |
michael@0 | 57 | [Throws] |
michael@0 | 58 | DocumentFragment cloneContents(); |
michael@0 | 59 | [Throws] |
michael@0 | 60 | void insertNode(Node node); |
michael@0 | 61 | [Throws] |
michael@0 | 62 | void surroundContents(Node newParent); |
michael@0 | 63 | |
michael@0 | 64 | Range cloneRange(); |
michael@0 | 65 | void detach(); |
michael@0 | 66 | |
michael@0 | 67 | [Throws] |
michael@0 | 68 | boolean isPointInRange(Node node, unsigned long offset); |
michael@0 | 69 | [Throws] |
michael@0 | 70 | short comparePoint(Node node, unsigned long offset); |
michael@0 | 71 | |
michael@0 | 72 | [Throws] |
michael@0 | 73 | boolean intersectsNode(Node node); |
michael@0 | 74 | |
michael@0 | 75 | stringifier; |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | // http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment |
michael@0 | 79 | partial interface Range { |
michael@0 | 80 | [Throws] |
michael@0 | 81 | DocumentFragment createContextualFragment(DOMString fragment); |
michael@0 | 82 | }; |
michael@0 | 83 | |
michael@0 | 84 | // http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface |
michael@0 | 85 | partial interface Range { |
michael@0 | 86 | DOMRectList? getClientRects(); |
michael@0 | 87 | DOMRect getBoundingClientRect(); |
michael@0 | 88 | }; |