Include square brackets for IPv6 addresses in Document::domain.

The specification changed out from under us.

It's unfortunately impossible to write a test for this right now.
This commit is contained in:
Ms2ger 2016-03-30 16:45:02 +02:00
parent 821afa071e
commit 231208a522

View file

@ -1767,12 +1767,6 @@ impl DocumentMethods for Document {
fn Domain(&self) -> DOMString {
// TODO: This should use the effective script origin when it exists
let origin = self.window.get_url();
if let Some(&Host::Ipv6(ipv6)) = origin.host() {
// Omit square brackets for IPv6 addresses.
return DOMString::from(ipv6.to_string());
}
DOMString::from(origin.serialize_host().unwrap_or_else(|| "".to_owned()))
}