| Index: core/editing/Selection.idl
|
| diff --git a/core/page/Selection.idl b/core/editing/Selection.idl
|
| similarity index 77%
|
| rename from core/page/Selection.idl
|
| rename to core/editing/Selection.idl
|
| index 53b0826171bd7f6edf7d947f72554f62c79f969f..dc27b0d9bfbe2d06112f4fcaed18e339ecad9d87 100644
|
| --- a/core/page/Selection.idl
|
| +++ b/core/editing/Selection.idl
|
| @@ -27,11 +27,17 @@
|
| * 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
|
| +// This is based on the W3C standard HTML Editing APIs
|
| +// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selection
|
| +//
|
| +// FIXME: Fix discrepancies from the standard, especially
|
| +// * unsigned types where should be unsigned
|
| +// * Nullability
|
| +// * RemoveRange(Range range) method
|
| +// http://crbug.com/391673
|
| [
|
| + ImplementedAs=DOMSelection,
|
| WillBeGarbageCollected,
|
| - ImplementedAs=DOMSelection
|
| ] interface Selection {
|
| readonly attribute Node anchorNode;
|
| readonly attribute long anchorOffset;
|
| @@ -39,26 +45,30 @@
|
| readonly attribute long focusOffset;
|
|
|
| readonly attribute boolean isCollapsed;
|
| - readonly attribute long rangeCount;
|
| -
|
| - [RaisesException, TypeChecking=Interface|Nullable] void collapse(Node node,
|
| - optional long offset);
|
| - [RaisesException] void collapseToEnd();
|
| + [RaisesException, TypeChecking=Interface] void collapse(Node node, optional long offset);
|
| [RaisesException] void collapseToStart();
|
| + [RaisesException] void collapseToEnd();
|
|
|
| - [CustomElementCallbacks] void deleteFromDocument();
|
| - boolean containsNode([Default=Undefined] optional Node node,
|
| - [Default=Undefined] optional boolean allowPartial);
|
| - [RaisesException] void selectAllChildren([Default=Undefined] optional Node node);
|
| + // FIXME: should be: optional long offset = 0 http://crbug.com/258153
|
| + // We mark offset as optional, defaulting to 0; this differs from spec.
|
| + // http://crbug.com/384966
|
| + [RaisesException, TypeChecking=Interface] void extend(Node node, optional long offset);
|
|
|
| - [RaisesException] void extend([Default=Undefined] optional Node node,
|
| - [Default=Undefined] optional long offset);
|
| + [RaisesException] void selectAllChildren([Default=Undefined] optional Node node);
|
| + [CustomElementCallbacks] void deleteFromDocument();
|
|
|
| + readonly attribute long rangeCount;
|
| [RaisesException] Range getRangeAt([Default=Undefined] optional long index);
|
| - void removeAllRanges();
|
| void addRange([Default=Undefined] optional Range range);
|
| + void removeAllRanges();
|
| +
|
| + [NotEnumerable] stringifier;
|
|
|
| - [NotEnumerable] DOMString toString();
|
| + // Firefox extensions
|
| + // https://developer.mozilla.org/En/DOM/Selection
|
| + //
|
| + // FIXME: Add use counters.
|
| + boolean containsNode([Default = Undefined] optional Node node, [Default = Undefined] optional boolean allowPartial);
|
|
|
| // WebKit extensions
|
| [MeasureAs=SelectionBaseNode] readonly attribute Node baseNode;
|
| @@ -77,11 +87,10 @@
|
| [Default=Undefined] optional long baseOffset,
|
| [Default=Undefined] optional Node extentNode,
|
| [Default=Undefined] optional long extentOffset);
|
| - [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, TypeChecking=Interface|Nullable] void setPosition(Node node,
|
| - optional long offset);
|
| + [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, TypeChecking=Interface] void setPosition(Node node,
|
| + optional long offset);
|
|
|
| - // IE extentions
|
| + // IE extensions
|
| // http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
|
| [MeasureAs=SelectionEmpty] void empty();
|
| };
|
| -
|
|
|