diff options
Diffstat (limited to 'Source/WebCore/page/DOMSelection.idl')
-rw-r--r-- | Source/WebCore/page/DOMSelection.idl | 75 |
1 files changed, 31 insertions, 44 deletions
diff --git a/Source/WebCore/page/DOMSelection.idl b/Source/WebCore/page/DOMSelection.idl index c1f763f9c..92eb2bf70 100644 --- a/Source/WebCore/page/DOMSelection.idl +++ b/Source/WebCore/page/DOMSelection.idl @@ -1,6 +1,6 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2009 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -27,63 +27,50 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// This is based off of Mozilla's Selection interface -// https://developer.mozilla.org/En/DOM/Selection +// https://www.w3.org/TR/selection-api/#idl-def-Selection [ GenerateIsReachable=ImplFrame, InterfaceName=Selection, ] interface DOMSelection { - readonly attribute Node anchorNode; - readonly attribute long anchorOffset; - readonly attribute Node focusNode; - readonly attribute long focusOffset; + readonly attribute Node? anchorNode; + readonly attribute unsigned long anchorOffset; + readonly attribute Node? focusNode; + readonly attribute unsigned long focusOffset; readonly attribute boolean isCollapsed; - readonly attribute long rangeCount; + readonly attribute unsigned long rangeCount; - [RaisesException] void collapse([Default=Undefined] optional Node node, - [Default=Undefined] optional long index); - [RaisesException] void collapseToEnd(); - [RaisesException] void collapseToStart(); + void collapse(Node? node, optional unsigned long offset = 0); + [MayThrowException] void collapseToEnd(); + [MayThrowException] void collapseToStart(); - void deleteFromDocument(); - boolean containsNode([Default=Undefined] optional Node node, - [Default=Undefined] optional boolean allowPartial); - [RaisesException] void selectAllChildren([Default=Undefined] optional Node node); + [CEReactions] void deleteFromDocument(); + boolean containsNode(Node node, optional boolean allowPartial = false); + void selectAllChildren(Node node); - [RaisesException] void extend([Default=Undefined] optional Node node, - [Default=Undefined] optional long offset); + [MayThrowException] void extend(Node node, optional unsigned long offset = 0); - [RaisesException] Range getRangeAt([Default=Undefined] optional long index); + [MayThrowException] Range getRangeAt(unsigned long index); void removeAllRanges(); - void addRange([Default=Undefined] optional Range range); + void addRange(Range range); -#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT [NotEnumerable] DOMString toString(); -#endif - // WebKit extensions - readonly attribute Node baseNode; - readonly attribute long baseOffset; - readonly attribute Node extentNode; - readonly attribute long extentOffset; - - // WebKit's "type" accessor returns "None", "Range" and "Caret" - // IE's type accessor returns "none", "text" and "control" readonly attribute DOMString type; - void modify([Default=Undefined] optional DOMString alter, - [Default=Undefined] optional DOMString direction, - [Default=Undefined] optional DOMString granularity); - [RaisesException] void setBaseAndExtent([Default=Undefined] optional Node baseNode, - [Default=Undefined] optional long baseOffset, - [Default=Undefined] optional Node extentNode, - [Default=Undefined] optional long extentOffset); - [RaisesException] void setPosition([Default=Undefined] optional Node node, - [Default=Undefined] optional long offset); + void setBaseAndExtent(Node? baseNode, unsigned long baseOffset, Node? extentNode, unsigned long extentOffset); + void setPosition(Node? node, optional unsigned long offset = 0); - // IE extentions - // http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx void empty(); -}; + // FIXME: The following operation should be implemented. + // void removeRange(Range range); + + // FIXME: Using "undefined" as default parameter value is wrong. + void modify(optional DOMString alter = "undefined", optional DOMString direction = "undefined", optional DOMString granularity = "undefined"); + + readonly attribute Node? baseNode; + readonly attribute unsigned long baseOffset; + readonly attribute Node? extentNode; + readonly attribute unsigned long extentOffset; +}; |