-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add URL IDL tests & drop stale (untested) URL IDLs
This change: [x] adds URL & URLUtils* IDL tests (up-to-date with current URL spec) [x] drops untested URL & URLUtils* IDLs from html/dom/interfaces.html [x] replaces old untested html/dom/interfaces.html URLUtils* IDLs w/ stubs (Nothing in html/dom/interfaces.html references the URL interface anyway, so there's no reason to include it there. And the URLUtils* IDLs that were in there were out-of-date with the current URL spec, and regardless there's no need to include the actual whole interfaces for them there, so instead let's just put (untested) stubs for them there.)
- Loading branch information
1 parent
e37ef9f
commit 7576fde
Showing
2 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!doctype html> | ||
<title>URL IDL tests</title> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<script src=/resources/WebIDLParser.js></script> | ||
<script src=/resources/idlharness.js></script> | ||
|
||
<h1>URL IDL tests</h1> | ||
<div id=log></div> | ||
|
||
<script type=text/plain class=untested> | ||
[Constructor(DOMString url, optional DOMString base = "about:blank"), | ||
Exposed=Window,Worker] | ||
interface URL { | ||
static DOMString domainToASCII(ScalarValueString domain); | ||
static DOMString domainToUnicode(ScalarValueString domain); | ||
}; | ||
URL implements URLUtils; | ||
|
||
[NoInterfaceObject] | ||
interface URLUtils { | ||
stringifier attribute ScalarValueString href; | ||
readonly attribute DOMString origin; | ||
|
||
attribute ScalarValueString protocol; | ||
attribute ScalarValueString username; | ||
attribute ScalarValueString password; | ||
attribute ScalarValueString host; | ||
attribute ScalarValueString hostname; | ||
attribute ScalarValueString port; | ||
attribute ScalarValueString pathname; | ||
attribute ScalarValueString search; | ||
attribute URLSearchParams searchParams; | ||
attribute ScalarValueString hash; | ||
}; | ||
|
||
[NoInterfaceObject] | ||
interface URLUtilsReadOnly { | ||
stringifier readonly attribute DOMString href; | ||
readonly attribute DOMString origin; | ||
|
||
readonly attribute DOMString protocol; | ||
readonly attribute DOMString host; | ||
readonly attribute DOMString hostname; | ||
readonly attribute DOMString port; | ||
readonly attribute DOMString pathname; | ||
readonly attribute DOMString search; | ||
readonly attribute DOMString hash; | ||
}; | ||
interface URLSearchParams { | ||
void append(ScalarValueString name, ScalarValueString value); | ||
void delete(ScalarValueString name); | ||
DOMString? get(ScalarValueString name); | ||
sequence<DOMString> getAll(ScalarValueString name); | ||
boolean has(ScalarValueString name); | ||
void set(ScalarValueString name, ScalarValueString value); | ||
stringifier; | ||
}; | ||
typedef DOMString ScalarValueString; | ||
</script> | ||
<script> | ||
"use strict"; | ||
var idlArray; | ||
setup(function() { | ||
idlArray = new IdlArray(); | ||
[].forEach.call(document.querySelectorAll("script[type=text\\/plain]"), function(node) { | ||
if (node.className == "untested") { | ||
idlArray.add_untested_idls(node.textContent); | ||
} else { | ||
idlArray.add_idls(node.textContent); | ||
} | ||
}); | ||
}, {explicit_done:true}); | ||
window.onload = function() { | ||
idlArray.add_objects({ | ||
URL: ['new URL("http://foo")'] | ||
}); | ||
idlArray.test(); | ||
done(); | ||
}; | ||
</script> |