Bug 1359387 - Support Selection.empty()/setPosition() r=masayuki,smaug
authorAryeh Gregor <ayg@aryeh.name>
Tue, 25 Apr 2017 15:49:27 +0300
changeset 355005 24b122474ff5e4fcc0f974db274a5d1b76a1efe9
parent 355004 f8ce7739001e5b25a61e09c68f7121f88fdec92d
child 355006 3a56bcd8287899e63141788ba2422792c9a623e4
push id41520
push userayg@aryeh.name
push dateWed, 26 Apr 2017 11:09:05 +0000
treeherderautoland@24b122474ff5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki, smaug
bugs1359387
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359387 - Support Selection.empty()/setPosition() r=masayuki,smaug 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
-