Bug 1359387 - Support Selection.empty()/setPosition() draft
authorAryeh Gregor <ayg@aryeh.name>
Tue, 25 Apr 2017 15:49:27 +0300
changeset 568044 c3f74762f56080c649ba8739f1857aaf5d5c59a6
parent 568041 a3dd9cf536609e79a607929694e79bd6b3c058ac
child 625802 610eb040dde2bbdd969283ec678363218f6821dd
push id55737
push userbmo:ayg@aryeh.name
push dateTue, 25 Apr 2017 17:46:02 +0000
bugs1359387
milestone55.0a1
Bug 1359387 - Support Selection.empty()/setPosition() Blink, WebKit, and Edge already support these, and they're in the spec. Tests submitted to wpt upstream. MozReview-Commit-ID: 5NFBeClNN7y
dom/webidl/Selection.webidl
testing/web-platform/meta/selection/interfaces.html.ini
--- a/dom/webidl/Selection.webidl
+++ b/dom/webidl/Selection.webidl
@@ -21,20 +21,22 @@ interface Selection {
   [Throws]
   Range     getRangeAt(unsigned long index);
   [Throws, BinaryName="addRangeJS"]
   void      addRange(Range range);
   [Throws]
   void      removeRange(Range range);
   [Throws]
   void      removeAllRanges();
-  //void      empty();
+  [Throws, BinaryName="RemoveAllRanges"]
+  void      empty();
   [Throws, BinaryName="collapseJS"]
   void      collapse(Node? node, optional unsigned long offset = 0);
-  //void      setPosition(Node? node, optional unsigned long offset = 0);
+  [Throws, BinaryName="collapseJS"]
+  void      setPosition(Node? node, optional unsigned long offset = 0);
   [Throws, BinaryName="collapseToStartJS"]
   void      collapseToStart();
   [Throws, BinaryName="collapseToEndJS"]
   void      collapseToEnd();
   [Throws, BinaryName="extendJS"]
   void      extend(Node node, optional unsigned long offset = 0);
   [Throws, BinaryName="setBaseAndExtentJS"]
   void      setBaseAndExtent(Node anchorNode,
--- a/testing/web-platform/meta/selection/interfaces.html.ini
+++ b/testing/web-platform/meta/selection/interfaces.html.ini
@@ -1,23 +1,8 @@
 [interfaces.html]
   type: testharness
   [Selection interface: attribute type]
     expected: FAIL
 
-  [Selection interface: operation empty()]
-    expected: FAIL
-
-  [Selection interface: operation setPosition(Node,unsigned long)]
-    expected: FAIL
-
   [Selection interface: getSelection() must inherit property "type" with the proper type (6)]
     expected: FAIL
 
-  [Selection interface: getSelection() must inherit property "empty" with the proper type (11)]
-    expected: FAIL
-
-  [Selection interface: getSelection() must inherit property "setPosition" with the proper type (13)]
-    expected: FAIL
-
-  [Selection interface: calling setPosition(Node,unsigned long) on getSelection() with too few arguments must throw TypeError]
-    expected: FAIL
-