зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1443513 [wpt PR 9024] - Fix Selection API idlharness.js test, a=testonly
Automatic update from web-platform-testsFix Selection API idlharness.js test It was entirely broken because SVGElement was unknown. Drive-by: split out the IDL into selection-api.idl. Like with webrtc-pc.idl, match the spec shortname and not the wpt dir. wpt-commits: 6fbbcf8242c40b8ec0dc4ab7ebec9c7a2ae55a34 wpt-pr: 9024 wpt-commits: 6fbbcf8242c40b8ec0dc4ab7ebec9c7a2ae55a34 wpt-pr: 9024
This commit is contained in:
Родитель
7accc3a805
Коммит
5850a7e84d
|
@ -285480,6 +285480,11 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"interfaces/selection-api.idl": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"interfaces/touchevents.idl": [
|
||||
[
|
||||
{}
|
||||
|
@ -570561,6 +570566,10 @@
|
|||
"b280c2a72795d4abd55a361a0afd8adce70562dc",
|
||||
"support"
|
||||
],
|
||||
"interfaces/selection-api.idl": [
|
||||
"f9f483a150b0e918f653f6ce4e84eb9c044d921f",
|
||||
"support"
|
||||
],
|
||||
"interfaces/touchevents.idl": [
|
||||
"6ce4f601cda6cd3b99a300e0b28d2886647f06d3",
|
||||
"support"
|
||||
|
@ -589486,7 +589495,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"selection/interfaces.html": [
|
||||
"1fb2684472fc29c5460b709908b6f0c4f779f1c1",
|
||||
"78e92642e2562da8040c791e4c3a7ad1de53e600",
|
||||
"testharness"
|
||||
],
|
||||
"selection/isCollapsed.html": [
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// http://w3c.github.io/selection-api/#selection-interface
|
||||
interface Selection {
|
||||
readonly attribute Node? anchorNode;
|
||||
readonly attribute unsigned long anchorOffset;
|
||||
readonly attribute Node? focusNode;
|
||||
readonly attribute unsigned long focusOffset;
|
||||
readonly attribute boolean isCollapsed;
|
||||
readonly attribute unsigned long rangeCount;
|
||||
readonly attribute DOMString type;
|
||||
Range getRangeAt(unsigned long index);
|
||||
void addRange(Range range);
|
||||
void removeRange(Range range);
|
||||
void removeAllRanges();
|
||||
void empty();
|
||||
void collapse(Node? node, optional unsigned long offset = 0);
|
||||
void setPosition(Node? node, optional unsigned long offset = 0);
|
||||
void collapseToStart();
|
||||
void collapseToEnd();
|
||||
void extend(Node node, optional unsigned long offset = 0);
|
||||
void setBaseAndExtent(Node anchorNode,
|
||||
unsigned long anchorOffset,
|
||||
Node focusNode,
|
||||
unsigned long focusOffset);
|
||||
void selectAllChildren(Node node);
|
||||
[CEReactions]
|
||||
void deleteFromDocument();
|
||||
boolean containsNode(Node node,
|
||||
optional boolean allowPartialContainment = false);
|
||||
stringifier DOMString ();
|
||||
};
|
||||
|
||||
partial interface Document {
|
||||
Selection? getSelection();
|
||||
};
|
||||
|
||||
partial interface Window {
|
||||
Selection? getSelection();
|
||||
};
|
||||
|
||||
partial interface GlobalEventHandlers {
|
||||
attribute EventHandler onselectstart;
|
||||
attribute EventHandler onselectionchange;
|
||||
};
|
|
@ -5,58 +5,14 @@
|
|||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/resources/WebIDLParser.js></script>
|
||||
<script src=/resources/idlharness.js></script>
|
||||
<script type=text/plain>
|
||||
// http://w3c.github.io/selection-api/#selection-interface
|
||||
interface Selection {
|
||||
readonly attribute Node? anchorNode;
|
||||
readonly attribute unsigned long anchorOffset;
|
||||
readonly attribute Node? focusNode;
|
||||
readonly attribute unsigned long focusOffset;
|
||||
readonly attribute boolean isCollapsed;
|
||||
readonly attribute unsigned long rangeCount;
|
||||
readonly attribute DOMString type;
|
||||
Range getRangeAt(unsigned long index);
|
||||
void addRange(Range range);
|
||||
void removeRange(Range range);
|
||||
void removeAllRanges();
|
||||
void empty();
|
||||
void collapse(Node? node, optional unsigned long offset = 0);
|
||||
void setPosition(Node? node, optional unsigned long offset = 0);
|
||||
void collapseToStart();
|
||||
void collapseToEnd();
|
||||
void extend(Node node, optional unsigned long offset = 0);
|
||||
void setBaseAndExtent(Node anchorNode,
|
||||
unsigned long anchorOffset,
|
||||
Node focusNode,
|
||||
unsigned long focusOffset);
|
||||
void selectAllChildren(Node node);
|
||||
[CEReactions]
|
||||
void deleteFromDocument();
|
||||
boolean containsNode(Node node,
|
||||
optional boolean allowPartialContainment = false);
|
||||
stringifier DOMString ();
|
||||
};
|
||||
|
||||
partial interface Document {
|
||||
Selection? getSelection();
|
||||
};
|
||||
|
||||
partial interface Window {
|
||||
Selection? getSelection();
|
||||
};
|
||||
|
||||
partial interface GlobalEventHandlers {
|
||||
attribute EventHandler onselectstart;
|
||||
attribute EventHandler onselectionchange;
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
function doTest([dom, cssom, touchevents, uievents, html]) {
|
||||
function doTest([selection, dom, cssom, touchevents, uievents, html]) {
|
||||
var idlArray = new IdlArray();
|
||||
idlArray.add_untested_idls('interface SVGElement {};');
|
||||
idlArray.add_untested_idls(dom + cssom + touchevents + uievents + html);
|
||||
idlArray.add_idls(document.querySelector("script[type=text\\/plain]").textContent);
|
||||
idlArray.add_idls(selection);
|
||||
idlArray.add_objects({Selection: ['getSelection()']});
|
||||
idlArray.test();
|
||||
}
|
||||
|
@ -66,7 +22,8 @@ function fetchData(url) {
|
|||
}
|
||||
|
||||
promise_test(function() {
|
||||
return Promise.all([fetchData("/interfaces/dom.idl"),
|
||||
return Promise.all([fetchData("/interfaces/selection-api.idl"),
|
||||
fetchData("/interfaces/dom.idl"),
|
||||
fetchData("/interfaces/cssom.idl"),
|
||||
fetchData("/interfaces/touchevents.idl"),
|
||||
fetchData("/interfaces/uievents.idl"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче