Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: core/editing/Selection.idl

Issue 581453002: Dartium Roll 38 roll (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: Sync'd w/ r 182210 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/dom/shadow/ShadowRoot.idl ('k') | core/events/EventTarget.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
};
-
« no previous file with comments | « core/dom/shadow/ShadowRoot.idl ('k') | core/events/EventTarget.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698