summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-15 07:29:18 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-15 07:29:18 +0200
commitae14556114dcae29f679db7c15f0bc9b707bb89a (patch)
treeb7f02d4463293a5fb0f3823bd48230a142c5a42d /dom
parent8a95c03dcd2a7f2c6d64b6ee917f6cb363e9ca60 (diff)
downloadUXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar
UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.gz
UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.lz
UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.xz
UXP-ae14556114dcae29f679db7c15f0bc9b707bb89a.zip
moebius#130: URL parser - fix: don't allow empty host name
https://github.com/MoonchildProductions/moebius/issues/130
Diffstat (limited to 'dom')
-rw-r--r--dom/html/test/test_bug558788-1.html5
-rw-r--r--dom/url/tests/test_url.html12
2 files changed, 15 insertions, 2 deletions
diff --git a/dom/html/test/test_bug558788-1.html b/dom/html/test/test_bug558788-1.html
index 94b7a5f00..4db61ed73 100644
--- a/dom/html/test/test_bug558788-1.html
+++ b/dom/html/test/test_bug558788-1.html
@@ -154,13 +154,14 @@ function checkInputURL()
sendString("ttp://mozilla.org");
checkValidApplies(element);
- for (var i=0; i<13; ++i) {
+ for (var i=0; i<10; ++i) {
synthesizeKey("VK_BACK_SPACE", {});
checkValidApplies(element);
}
synthesizeKey("VK_BACK_SPACE", {});
- for (var i=0; i<4; ++i) {
+ // "http://" is now invalid
+ for (var i=0; i<7; ++i) {
checkInvalidApplies(element);
synthesizeKey("VK_BACK_SPACE", {});
}
diff --git a/dom/url/tests/test_url.html b/dom/url/tests/test_url.html
index d07a752bb..73e75667d 100644
--- a/dom/url/tests/test_url.html
+++ b/dom/url/tests/test_url.html
@@ -399,6 +399,18 @@
</script>
<script>
+ /** Test for Bug 1275746 **/
+ SimpleTest.doesThrow(() => { var url = new URL("http:"); }, "http: is not a valid URL");
+ SimpleTest.doesThrow(() => { var url = new URL("http:///"); }, "http: is not a valid URL");
+
+ var url = new URL("file:");
+ is(url.href, "file:///", "Parsing file: should work.");
+
+ url = new URL("file:///");
+ is(url.href, "file:///", "Parsing file:/// should work.");
+ </script>
+
+ <script>
var url = new URL("scheme:path/to/file?query#hash");
is(url.href, "scheme:path/to/file?query#hash");
is(url.pathname, "path/to/file");