michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://dom.spec.whatwg.org/#range michael@0: * http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment michael@0: * http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface michael@0: * michael@0: * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C michael@0: * liability, trademark and document use rules apply. michael@0: */ michael@0: michael@0: [Constructor] michael@0: interface Range { michael@0: [Throws] michael@0: readonly attribute Node startContainer; michael@0: [Throws] michael@0: readonly attribute unsigned long startOffset; michael@0: [Throws] michael@0: readonly attribute Node endContainer; michael@0: [Throws] michael@0: readonly attribute unsigned long endOffset; michael@0: readonly attribute boolean collapsed; michael@0: [Throws] michael@0: readonly attribute Node commonAncestorContainer; michael@0: michael@0: [Throws] michael@0: void setStart(Node refNode, unsigned long offset); michael@0: [Throws] michael@0: void setEnd(Node refNode, unsigned long offset); michael@0: [Throws] michael@0: void setStartBefore(Node refNode); michael@0: [Throws] michael@0: void setStartAfter(Node refNode); michael@0: [Throws] michael@0: void setEndBefore(Node refNode); michael@0: [Throws] michael@0: void setEndAfter(Node refNode); michael@0: void collapse(optional boolean toStart = false); michael@0: [Throws] michael@0: void selectNode(Node refNode); michael@0: [Throws] michael@0: void selectNodeContents(Node refNode); michael@0: michael@0: const unsigned short START_TO_START = 0; michael@0: const unsigned short START_TO_END = 1; michael@0: const unsigned short END_TO_END = 2; michael@0: const unsigned short END_TO_START = 3; michael@0: [Throws] michael@0: short compareBoundaryPoints(unsigned short how, Range sourceRange); michael@0: [Throws] michael@0: void deleteContents(); michael@0: [Throws] michael@0: DocumentFragment extractContents(); michael@0: [Throws] michael@0: DocumentFragment cloneContents(); michael@0: [Throws] michael@0: void insertNode(Node node); michael@0: [Throws] michael@0: void surroundContents(Node newParent); michael@0: michael@0: Range cloneRange(); michael@0: void detach(); michael@0: michael@0: [Throws] michael@0: boolean isPointInRange(Node node, unsigned long offset); michael@0: [Throws] michael@0: short comparePoint(Node node, unsigned long offset); michael@0: michael@0: [Throws] michael@0: boolean intersectsNode(Node node); michael@0: michael@0: stringifier; michael@0: }; michael@0: michael@0: // http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment michael@0: partial interface Range { michael@0: [Throws] michael@0: DocumentFragment createContextualFragment(DOMString fragment); michael@0: }; michael@0: michael@0: // http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface michael@0: partial interface Range { michael@0: DOMRectList? getClientRects(); michael@0: DOMRect getBoundingClientRect(); michael@0: };