Remove URL.domainToASCII and URL.domainToUnicode

This commit is contained in:
Mathieu Rheaume 2016-10-23 16:22:12 -04:00
parent a1306e1dd3
commit 943233afd6
7 changed files with 20 additions and 48 deletions

View file

@ -17,10 +17,8 @@ use ipc_channel::ipc;
use net_traits::{CoreResourceMsg, IpcSend};
use net_traits::blob_url_store::{get_blob_origin, parse_blob_url};
use net_traits::filemanager_thread::FileManagerThreadMsg;
use std::borrow::ToOwned;
use std::default::Default;
use url::{Host, Url};
use url::quirks::domain_to_unicode;
use url::Url;
use uuid::Uuid;
// https://url.spec.whatwg.org/#url
@ -96,23 +94,6 @@ impl URL {
Ok(result)
}
// https://url.spec.whatwg.org/#dom-url-domaintoasciidomain
pub fn DomainToASCII(_: &GlobalScope, origin: USVString) -> USVString {
// Step 1.
let ascii_domain = Host::parse(&origin.0);
if let Ok(Host::Domain(string)) = ascii_domain {
// Step 3.
USVString(string.to_owned())
} else {
// Step 2.
USVString("".to_owned())
}
}
pub fn DomainToUnicode(_: &GlobalScope, origin: USVString) -> USVString {
USVString(domain_to_unicode(&origin.0))
}
// https://w3c.github.io/FileAPI/#dfn-createObjectURL
pub fn CreateObjectURL(global: &GlobalScope, blob: &Blob) -> DOMString {
/// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround

View file

@ -5,9 +5,6 @@
// https://url.spec.whatwg.org/#url
[Constructor(USVString url, optional USVString base), Exposed=(Window,Worker)]
interface URL {
static USVString domainToASCII(USVString domain);
static USVString domainToUnicode(USVString domain);
[SetterThrows]
/*stringifier*/ attribute USVString href;
readonly attribute USVString origin;