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
--- 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
-